Vladimir Eremeev wrote:
> Michel Bardiaux <[EMAIL PROTECTED]> writes:
> 
>> It is the original (input to your program) or output (of your program). 
>> Cant be both.
> Well, again, from very beginning. :)
> My program captures the MPEG Transport Stream from a DVB-S card. It works 
> under 
> MS Windows and uses the card's specific API. I cannot open this stream with 
> ffmpeg.exe (command line utility) directly. 
> I can either dump the stream to a file and open this with ffmpeg -i, or 
> define 
> ByteIOContext and use libav* functions.
> 
> I post the output of ffmpeg on the stream dump below, as it is rather long.
> 
> Using ffmpeg, I save the parts of the stream to files. For example, one user 
> defined video stream from a user defined program and one accompanying audio 
> stream.
> 
> The file p8211<etc>.mpg is one of such files. It is the output of my program.
> 
> It stores the program 8211, pids 2221 (0x08AD) and 2231 (0x08b7)
> 
>> So please post (again)! ffmpeg -i p8211<etc>.mpg, ffmpeg -vcodec copy 
>> p8.mpg, ffmpeg -i p8.mpg, *and* ffmpeg -i on the *output* of your program.
> 
> The result of ffmpeg -i <input for my program> is given below at the bottom 
> of 
> my message.
> 
> Now, file p8211_2221_2231_2008-04-04-14-25-00_2008-04-04-14-35-00.mpg is the 
> *output* for my program
> 
> Here it is.
> 
> $ ffmpeg -i p8211_2221_2231_2008-04-04-14-25-00_2008-04-04-14-35-00.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 '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 -f dvd p8.mpg

You dont need this part at all, you can force format to dvd in your code.

> 
> $ 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: 3311 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)
> 

So, in short: ffmpeg reports, correctly, a duration of 10' on the file 
produced by your program.

> 
>> And please post what durations VLC reports for all 3 mpg files too.
> 
> Unfortunately, I cannot store the original transport stream during the 
> recording (the computer runs out of resources).
> 
> VLC (0.8.6c) displays two different numbers, but they are the same for both 
> files (p8211_2221_2231_2008-04-04-14-25-00_2008-04-04-14-35-00.mpg, written 
> with my program, and p8.mpg, written with ffmpeg after processing 
> p8211<etc>.mpg)
> 
> It shows 0:00:04 in the lower left corner of the video window, and 0:10:00 in 
> View->Stream and media info->Advanced information.
> 
> VLC (0.8.6a) displays 4sec everywhere.

Now *this* is very interesting, the change between the 2 versions of VLC 
shows they were aware the duration was wrong in 1 place, fixed it, but 
it is still wrong in another place. I would say there is simply another 
vlc bug. Try the latest vlc maybe?

> 
> Kaffeine also shows 4 sec for both files.
> 
>> On reflexion, let's use the strategy that is usually best in this list: 
>> let us rehearse what you want using ffmpeg CLI. So post what I asked 
>> above, omitting what concerns the file output by your program.
>>
>> Greetings,
> 
> Output for the MPEG2 TS dump, saved in file 'ab.mpegts'
> 
> $ ffmpeg -i ab.mpegts
> 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, mpegts, from 'ab.mpegts':
>   Duration: 19:23:01.3, start: 21295.218344, bitrate: 176 kb/s

That is interesting too: the duration is wrong, because the container 
bitrate is wrong (or is it? I have no idea whether a TS stream header 
should contain an aggregate or an average bitrate).

[snip]

Greetings,
-- 
Michel Bardiaux
R&D Director
T +32 [0] 2 790 29 41
F +32 [0] 2 790 29 02
E mailto:[EMAIL PROTECTED]

Mediaxim NV/SA
Vorstlaan 191 Boulevard du Souverain
Brussel 1160 Bruxelles
http://www.mediaxim.com/
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to