[MPlayer-dev-eng] Re: -of mpeg

Andriy N. Gritsenko andrej at lucky.net
Tue Oct 21 10:02:20 CEST 2003


    Hi, D Richard Felker III!

Sometime (on Saturday, October 18 at  1:39) I've received something...
>> So, can someone please give a comment about this patch ?

>I'm curious...is there any way to encode duplicate frames in mpeg
>output? Otherwise -of mpeg will always hopelessly break A/V sync, so
>it's pointless to fix it and it should just be removed...

    Do you prefer encode MPEG files into "mpeg in avi" that are playable
only with MPlayer? Do you still think it's better than put MPEG video in
apropriate container?

>Perhaps it would be possible to fix mencoder so it actually encodes
>duplicate frames twice (at least optionally)...although I looked at
>this once and the code seemed to be too horrible to fix.

    Look to muxer_mpeg.c - it doesn't do anything with MPEG stream so if
you want duplicate frames then just insert them into video stream. But
note that MPEG video stream doesn't allow empty frame without header so
MEncoder must write not frame with just size=0 but frame with data size 0
and marked as Picture predictional type (0,0,1,0,0,0x10). Another note
that your codec will be confused with that data since MPEG video stream
must contain frames in predefined order: I,P,P,B,P,P,B,P,P,B,... If you
insert frame with undefined sequence code and also break the order then
decoder may be confused when you will play that mpeg file. So if you want
change fps in your outgoing MPEG file then do it in MPEG codec (-ovc).
Another way is incompatible with MPEG standard. :)
    On other hand, if you just skip video frame in MPEG video stream (put
frame with size 0) then you don't get MPEG file broken, since each frame
already have it's own PTS and DTS values saved in the file. ;)

    With best wishes.
    Andriy.



More information about the MPlayer-dev-eng mailing list