Reputation: 18789
Whenever I split a video using Apple's mediafilesegmenter
, using the following command: medifilesegmenter video.ts -t 10
. I get the following error for each segment except the first:
segment does not contain sync frame
Before splitting I've converted the .MP4 version to a .TS with the following command:
avconv -y -i video.mp4 -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 640x480 -vcodec libx264 -b 64k -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 7 -trellis 0 -refs 0 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 64k -bufsize 64k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 30 -qmax 51 -qdiff 4 -level 30 -aspect 640:480 -g 30 -async 2 sample_64.ts
Can anyone tell me why this error occurs?
Upvotes: 4
Views: 1348
Reputation: 18789
I fixed the problem by updating to the latest version of ffmpeg instead of using avconv. The command I finally used to convert the MP4
videos:
ffmpeg -y -i video.mp4 -f mpegts -acodec libmp3lame -ar 48000 -ab 64k -s 640x480 -vcodec libx264 -b 150k -flags +loop -cmp chroma -partitions +parti4x4+partp8x8+partb8x8 -subq 7 -trellis 0 -refs 0 -coder 0 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -bt 200k -maxrate 150k -bufsize 150k -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.6 -qmin 30 -qmax 51 -qdiff 4 -level 30 -aspect 640:480 -g 30 -async 2 sample_150.ts
Upvotes: 1
Reputation: 6739
This is because I pictures are needed at the 10 second point. Find your video frame rate. If you want 10 second segments you need an I frame at every 10th second. So you can insert one every seconds, 2 seconds, 5 seconds or 10 seconds. To do that set sc_threshold to 0 and keyint_interval to frame_rate*[one of 1,2,5,10] depending on the key frame interval you want.
Upvotes: 1