[FFmpeg-user] mpeg-ts to mkv without sound delay

Armel Bourgon-Drouot armel.bourgon-drouot at esial.net
Sat May 21 17:35:16 CEST 2011


Hi,

thanks a lot for your reply Peter.

>Explain in more detail what kind of delay you experience.

I think video and audio streams are not synchronized at all. The delay is
huge (about 2s) and it's present during the whole movie. Maybe "delay" is
not the correct word, sorry for my poor English.
I read somewhere this append because some errors in the input file (due to
transmission) lead to frame deletion while audio stream is not modified.

>I do not have any bright ideas about that. However, since the source
>is h264, I would try very hard to avoid reencoding, unless it is
>absolutely necessary. I don't know how much you care about the
>resulting file size, but I doubt that you can achieve significant file
>size reduction (say, 50%) while maintaining the video quality. On the
>other hand, I may be wrong. I am no expert in this field.

>Another question is whether it is worth to reencode the video if you
>know that it will reduce its size only by, say 20%. Would you sitll
>want to do it? Most of the time, I would not.

I expect a significant file size reduction, at least 50%. I know it will be
probably time consuming but it's not a problem.


On Sat, May 21, 2011 at 5:07 PM, Peter Bašista <pbasista at gmail.com> wrote:

> > Hi everyone,
> >
> > I wood like to change the container of some videos I record with my TV,
> and
> > compress it for archiving purpose.
> > The container is mpeg-ts, the video codec is h264 and the audio one is
> mp2.
> > I wood like mkv, h264, aac. I also want the video stream to be more
> > compress.
>
> We seem to have similar goals :)
>
> > So the first step is to change the container, I try :
> >
> > ffmpeg -i test.ts -vcodec copy -acodec copy movie.mkv
> >
> >  The process run normally except this message :
> >
> > [NULL @ 0x645bb0]missing picture in access unit
> >
> > The output file is fine but there is a delay between sound and video.
>
> Can you be more specific? If I do the same thing with my captured
> mpeg-ts file, I have no delay at all. Only for the first a few seconds
> after the playback starts, there is an audio delay, but it is
> continuously fading away and after about 10 seconds, everything is in
> sync.
>
> A piece from mplayer's status line:
> A:   1.9 V:   3.4 A-V: -1.534
>
> That is, I suppose, mplayer's issue. It is just not able to sync audio
> and video from this file immediately after the start of the playback.
> But then it all plays in sync. I don't think the reason is that the
> audio and video are not synchronized in the resulting file.
>
> > So my questions are :
> >
> >    1. How to avoid this delay ?
>
> Explain in more detail what kind of delay you experience.
>
> >    2. How to compress more the video stream ? Maybe try with a
> >    different bitrate ? Is there a way to automatically choose a suitable
> >    bitrate?
>
> I do not have any bright ideas about that. However, since the source
> is h264, I would try very hard to avoid reencoding, unless it is
> absolutely necessary. I don't know how much you care about the
> resulting file size, but I doubt that you can achieve significant file
> size reduction (say, 50%) while maintaining the video quality. On the
> other hand, I may be wrong. I am no expert in this field.
>
> Another question is whether it is worth to reencode the video if you
> know that it will reduce its size only by, say 20%. Would you sitll
> want to do it? Most of the time, I would not.
>
> >    3. To change the audio codec -acodec aac will be ok ?
>
> This will only work if you add -strict experimental to your command
> line. I do not have any experience with that, but you can also use the
> non experimental codec libfaac.
>
> Peter Basista
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>



-- 
Armel Bourgon-Drouot
Élève-ingénieur Esial 2A IL


More information about the ffmpeg-user mailing list