Sorry, I will be more precise.

Michel Bardiaux <[EMAIL PROTECTED]> writes:

> >> What does ffmpeg -i say about your output file? 

Original output file.

FFmpeg version SVN-r12661, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --enable-memalign-hack --disable-shared --enable-static --
enable-pthreads --disable-stripping --prefix=/home/wl
  libavutil version: 49.6.0
  libavcodec version: 51.54.0
  libavformat version: 52.13.0
  libavdevice version: 52.0.0
  built on Apr  2 2008 10:26:52, gcc: 4.2.1 (Ubuntu 4.2.1-5ubuntu4)
Input #0, mpeg, from 'p8211_2221_2231_2008-04-04-14-25-00_2008-04-04-14-35-
00.mpg':
  Duration: 00:10:01.0, start: 84077.479689, bitrate: 3312 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x576 [PAR 16:15 DAR 
4:3], 3165 kb/s, 25.00 tb(r)
    Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, mono, 64 kb/s

Then
$ ffmpeg -i p8211_2221_2231_2008-04-04-14-25-00_2008-04-04-14-35-00.mpg -acodec 
copy -vcodec copy p8.mpg -f dvd

Then

$ ffmpeg -i p8.mpg
FFmpeg version SVN-r12661, Copyright (c) 2000-2008 Fabrice Bellard, et al.
  configuration: --enable-memalign-hack --disable-shared --enable-static --
enable-pthreads --disable-stripping --prefix=/home/wl
  libavutil version: 49.6.0
  libavcodec version: 51.54.0
  libavformat version: 52.13.0
  libavdevice version: 52.0.0
  built on Apr  2 2008 10:26:52, gcc: 4.2.1 (Ubuntu 4.2.1-5ubuntu4) 

Input #0, mpeg, from 'p8.mpg':
  Duration: 00:10:01.0, start: 0.500000, bitrate: 3237 kb/s
    Stream #0.0[0x1c0]: Audio: mp2, 48000 Hz, mono, 64 kb/s
    Stream #0.1[0x1e0]: Video: mpeg2video, yuv420p, 720x576 [PAR 16:15 DAR 
4:3], 3165 kb/s, 25.00 tb(r)

 
> No, all wrong. Dont you notice you have mpeg2 in, but mpeg1 in the 
> output? That's because you put the spec of p8.mpg after the file, it 
> must be before.

Now all correct. :)
 
> > Sorry, one thing I forgot to mention.
> > When adding streams to the OutputFormatContext, I set
> >             st->pts.num=st->time_base.num;
> >             st->pts.den=st->time_base.den;
> > st is the result of av_new_stream( )
> > 
> > I got divizion by 0 without setting pts, because compute_pkt_fileds2() 
calls 
> > avfrac_add, which tries to divide by pts.den, which is 0.
> > 
> > And one more thing: 
> >  
> > static float mux_preload= 0.5;      
> > static float mux_max_delay= 0.7;
> > output->preload= (int)(mux_preload*AV_TIME_BASE);
> > output->max_delay= (int)(mux_max_delay*AV_TIME_BASE);
> > 
> > I was advised to do that here, mpeg muxer complains on buffer underflow 
without 
> > these assignments.
> > 
> > 
> >>> If the movie is recorded as MPEG PS and contains MPEG2 video and MPEG-1 
> > audio, 
> >>> how does a media player calculate its duration?
> >> There are several possible ways: subtract the first time stamp from the 
> >> last; or, divide the file size by the nominal bit rate stated by the 
> >> container (some containers like avi, store the duration explicitly; 
> >> MPEG-PS doesn't though). IIRC ffmpeg uses the 2nd method.
> >  
> > VLC and Kaffeine seem to use another method, or use some other fields in 
the 
> > file. I must set up them also.
 
> I cant comment on that if you are not more precise. *Which* other method?
 
That was only my supposition. 
You have named two methods, and said that ffmpeg uses the second one, and 
calculates the duration correctly. I just supposed that since vlc and kaffeine 
don't calculate the movie duration correctly, they don't use that method, but 
use some other.
I understand that this is a wrong list to ask questions about other media 
players specifics.




_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to