[Ffmpeg-devel] [Ffmpeg-devel-old] Re: avi out is buggy
Rich Felker
dalias
Mon May 9 20:01:40 CEST 2005
On Mon, May 09, 2005 at 07:04:53PM +0200, Michael Niedermayer wrote:
> Hi
>
> On Monday 09 May 2005 18:38, Rich Felker wrote:
> > On Mon, May 09, 2005 at 02:31:54PM +0200, Michel Bardiaux wrote:
> > > Erik Slagter wrote:
> > > >On Mon, 2005-05-09 at 11:24 +0000, Thomas Herrmann wrote:
> > > >>>stream copy from mpeg to avi isnt synchronizable, mpeg has timestamps,
> > > >>>avi does not, so frame drop / audio resampling might be needed but its
> > > >>>not possible with stream copy
> > > >>>
> > > >>>-> bug closed / invalid
> > > >>
> > > >>Ok, but your answer does not help me to generate usable video file.
> > > >>
> > > >>I was asking what output format and/or ffmpeg options should I use to
> > > >>transcode
> > > >>a MPEG file containing a MPEG2 video stream and an AC3 audio stream to
> > > >> a video
> > > >>file (avi, mpg, mov, ... ???) containing a h264 video stream and a
> > > >> ac3/aac audion stream?
> > > >>
> > > >>I tried:
> > > >>
> > > >>ffmpeg -i sample_w_ac3.mpg -vcodec h264 -acodec copy -sameq -hq out.avi
> > > >>
> > > >>which leads to asynchronous output, so does:
> > > >>
> > > >>ffmpeg -i sample_w_ac3.mpg -vcodec h264 -acodec aac -sameq -hq out.avi
> > > >
> > > >How about using mp4 output container (which does understand timestamps).
> > >
> > > Since the posted commands produce a desynched avi from a file that is
> > > said to play correctly in mplayer, one could deduce that the streams in
> > > it are not inherently synchronized, but the synchro is maintained by the
> > > timestamps themselves; in other words, as Michael wrote, at places there
> > > are too many or not enough audio samples. Obviously that cant be done if
> > > acodec=copy.
> >
> > Actually it can. Just leave 0byte packets in the avi to serve in place
> > of timestamps. I thought lavf already did this..
>
> hmm yes it should, but it cant drop frames, so it still wont work unless you
> set the framerate to a large enough value
IMO there's never too many frames, only too few, in "desynced"
sources.
Also if you want to have the sync involve both audio and video, you
can add 0byte audio frames whenever there's too many video frames, or
0byte video frames whenever there's too many audio frames. But this is
rather stupid and shouldn't be needed..
Rich
More information about the ffmpeg-devel
mailing list