[FFmpeg-user] Is a video generated with transitions different from a normal video?

DEF shaker.doc at gmail.com
Sun Jun 20 20:04:54 EEST 2021


>
> Ffmpeg -i v1.mp4 -i v2.mp4 -filter_complex
> "xfade=transition=hlslice:duration=4:offset=7"  -pix_fmt yuv420p output.mp4
>
>
>
> So far so good. The transition happens between 7 and 11 of the new video.
>
>
>
> Now I want to create a new video by extracting the part that has the
> transition, with an additional second on each side, so I want to cut from 6
> to 12 and I use the following:
>
>
>
> Ffmpeg -ss 6 -i input.mp4 -to 6 -c copy output.mp4
>
>
>
> I expect a final video with 6 seconds, showing the transition starting at 1
> and ending at 5. Instead I get a video with 9 seconds and the transition
> seems to start at 5.
>

What you get is technically correct because ffmpeg will cut only at
key frames when you use the copy option.

IMHO, You have two options:

1. reencode the video rather than copying to get exact cutting points or
2. use a  smaller GOP size with the transitions command on v1 and v2.
 Then you  get more keygrames (with a heavy overhead, ofcourse)

i hope this helps.

DEF


More information about the ffmpeg-user mailing list