[FFmpeg-user] converting AV from mpeg_ts to mp4 container error

Carl Eugen Hoyos cehoyos at ag.or.at
Sun Jan 13 13:51:38 CET 2013

Albert Scholtalbers <compuvision.sr <at> gmail.com> writes:

> >The file can be read / converted here with:
> >$ ffmpeg -analyzeduration 6M -i mpegts_not_convert_to_mp4.ts
> The problem was related to the fact that FFmpeg couldn't find 
> the codec parameters at the beginning of the file.

Allow me to repeat that FFmpeg did warn about this 
and suggested a (working) work-around.

> In the current situation I cut the recordings on the sync-byte 
> 0x47 as I log the filesize during a recording every minute.

> Is there a way to make cuts in mpeg-ts files so the cutting 
> starts just before the codec parameters and more software 
> like the extracted av file by default?

I think so, yes.
Simply analyze the transport stream and cut it at the beginning 
of an I (or, if present, an IDR) frame.
Note that this is not guaranteed to work, valid streams without 
I-frames are allowed.

Carl Eugen

More information about the ffmpeg-user mailing list