[FFmpeg-user] Need help using segment muxer to create mpegts segment every 10 second.

Stefano Sabatini stefasab at gmail.com
Fri Jan 13 00:31:59 CET 2012


On date Wednesday 2012-01-11 14:29:07 +0000, Tom Evans encoded:
> On Wed, Jan 11, 2012 at 10:14 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> > Please try current git head.
> >
> 
> With git head from a few hours ago, I can get this to work for mpeg2
> output, but not for x264.
> 
> So this works as expected:
> 
> ffmpeg -i /tank/video/scratch/ashes09-5.vob -r 25 \
>     -c:a libfaac -ab:a 128k -ac:a 2 \
>     -c:v mpeg2video -s:v 640x360 -aspect:v 16:9 -map 0 \
>     -f segment -segment_time 10 -segment_list test.m3u8 \
>     -segment_format mpegts stream%05d.ts
> 
> This does not:
> 
> ffmpeg -i /tank/video/scratch/ashes09-5.vob -r 25 \
>     -c:a libfaac -ab:a 128k -ac:a 2 \
>     -c:v libx264 -s:v 640x360 -aspect:v 16:9 -map 0 \
>     -f segment -segment_time 10 -segment_list test.m3u8 \
>     -segment_format mpegts stream%05d.ts
> 
> ffmpeg version N-36703-g98dfdfd Copyright (c) 2000-2012 the FFmpeg developers
[...]
> [mpegts @ 0x803c42200] muxrate VBR, pcr every 2 pkts, sdt every 200,
> pat/pmt every 40 pkts
> Output #0, segment, to 'stream%05d.ts':
>   Metadata:
>     encoder         : Lavf53.29.100
>     Stream #0:0: Video: h264, yuv420p, 640x360 [SAR 1:1 DAR 16:9],
> q=-1--1, 90k tbn, 25 tbc
>     Stream #0:1: Audio: aac, 48000 Hz, 2 channels, s16, 128 kb/s
> Stream mapping:
>   Stream #0:0 -> #0:0 (mpeg2video -> libx264)
>   Stream #0:1 -> #0:1 (ac3 -> libfaac)
> Press [q] to stop, [?] for help

> [mpegts @ 0x803c42200] H.264 bitstream malformed, no startcode found,
> use -vbsf h264_mp4toannexb
> av_interleaved_write_frame(): Operation not permitted

 > If I add the suggested bitstream filter, then this additional error is
> output before the 'bitstream malformed' line:
> 
> h264_mp4toannexb failed for stream 0, codec libx264: Invalid argument

Try to add:
-flags -global_header

just after -vbsf h264_mp4toannexb and tell me if it works for you (and
yes overall poor error reporting from ffmpeg/libav*).
-- 
ffmpeg-user random tip #9
One minute of audio silence with ffmpeg:
ffmpeg -ar 48000 -t 60 -f s16le -acodec pcm_s16le -i /dev/zero  \
    -ab 64K -f mp2 -acodec mp2 -y silence.mp2


More information about the ffmpeg-user mailing list