[FFmpeg-user] Video jumps after segmenting, transcoding, and rejoining video

Paul Cruickshank cruickshankpg at gmail.com
Wed Jul 17 11:33:19 EEST 2019


We're working on a project to have a highly parallelized video rescaling
pipeline but we're finding that small audio and video jumps are being
introduced into the video when we put the video back together. Can anyone
point out anything we're doing wrong?

The pipeline has 3 stages. First we split the video using the segment muxer
$ ./ffmpeg -i samples/2160p-h264-aac-20mbs-2m.mp4 -muxdelay 0 -muxpreload 0
-g 96 -keyint_min 96 -sc_threshold 0 -c copy -copyts -f segment -fflags
+genpts -segment_time 4 -segment_format mpegts out/segments/%04d.ts

Then we change the scale for each of the segments using:
$ ./ffmpeg -i out/segments/0000.ts -muxdelay 0 -vf scale=1920:1080 -c:v
libx264 -profile:v main -c:a aac -copyts out/segments/out00.ts

And then we rejoin
$ ./ffmpeg -i
-c copy -copyts out/transcoded.mp4

The jumps seem to correlate to the segment boundaries. The jumps are even
worse if we have to change audio codec from ac3 to aac in the middle
transcode stage. It we skip the middle rescaling stage then we don't get
any jumps in the output video so it's something that's going wrong in that

For reference the commands are using ffmpeg 4.1.3 and the video I tested
the commands with


More information about the ffmpeg-user mailing list