Vladimir Eremeev wrote: > Michel Bardiaux <[EMAIL PROTECTED]> writes: > >> What does ffmpeg -i say about your output file?
You did not give that info. >> Compared to what it says >> on the output file of ffmpeg -vcodec copy etc...? > > Original recorded file: > > $ ffmpeg -i p8211_2221_2231_2008-04-04-14-25-00_2008-04-04-14-35-00.mpg You have snipped the version info. Dont. Always post *complete* output, you never know what might be significant. > > 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 > Must supply at least one output file > > Then > $ ffmpeg -i p8211_2221_2231_2008-04-04-14-25-00_2008-04-04-14-35-00.mpg > p8.mpg - > f dvd -acodec copy -vcodec copy > > $ ffmpeg -i p8.mpg > > Input #0, mpeg, from 'p8.mpg': > Duration: 00:10:00.9, start: 0.500000, bitrate: 704 kb/s > Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 720x576 [PAR 178:163 DAR > 445:326], 104857 kb/s, 25.00 tb(r) > Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, mono, 64 kb/s > Must supply at least one output file > > All correct... 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. > > 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? -- Michel Bardiaux http://www.mediaxim.com/ _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
