I am trying to alternate segments of MPEG-TS, but fail. One set of segments was actually captured using the built-in camera in a laptop, and then encoded using FFMPEG with the following command:
ffmpeg -er 4 -y -f video4linux2 -s 640x480 -r 30 -i %s -isync -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 640x480 -vcodec libx264 -fflags +genpts -b 386k -coder 0 -me_range 16 -keyint_min 25 -i_qfactor 0.71 -bt 386k -maxrate 386k -bufsize 386k -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -aspect 640:480
And the other is an avi file that has been encoded using the following command:
fmpeg -er 4 -y -f avi -s 640x480 -r 30 -i ./DSCF2021.AVI -vbsf dump_extra -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 640x480 -vcodec libx264 -fflags +genpts -b 386k -coder 0 -me_range 16 -keyint_min 25 -i_qfactor 0.71 -bt 386k -maxrate 386k -bufsize 386k -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -aspect 640:480
The output is then segmented into ts segments using an open source segmenter.
If both come from the same source (both from the camera), they work fine. However, in this case, the second set of segments freezes. Time passes, but the video does not move. Therefore, I believe this is a coding problem. So my question is: how do I change the ffmpeg command for this?
By alternation, I mean having a playlist with the first set of segments and another playlist with a different set of segments and having a client call, and then another (streaming HTTP streaming)
The output of ffprobe is one of the first sets of segments:
Input
The output ffprobe of one of the second set of segments:
Input
Thanks,
source share