Vladimir Eremeev wrote:
> Hi all.
> I am remuximg the MPEG-2 Transport Stream from a DVB-S card to the MPEG 
> Program 
> stream using libav* functions.
> 
> Recorded videos are played perfectly with VLC and Kaffeine.
> However, these players say that 15-min video has the duration of only 9 sec.
> 
> I don't recode the data, only change the container.
> 
> When adding streams to the OutputFormatContext, I copy all codec information 
> from the InputFormatContext.
> 
> Copied fields include codec_id, bitrate, sample_rate, channels, frame_size, 
> block_align, pix_fmt, width, height.
> 
> I have taken the code from FFmpeg.c and added copying of some other fields 
> (codec->sub_id, me_method, sample_fmt), just to be sure.
> 
> Is it correct?

What does ffmpeg -i say about your output file? Compared to what it says 
on the output file of ffmpeg -vcodec copy etc...?

> 
> 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.

-- 
Michel Bardiaux
http://www.mediaxim.com/
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to