[MEncoder-users] How to Change FPS on a Broken TS Stream?

Bill Adams gofish at evilbill.org
Tue Jun 6 03:56:48 CEST 2006


Thanks again everyone for taking the time to help me.

For good measure, I have recompiled ffmpeg/mplayer/mencoder without any 
patches.

 > use :muxrate=36000 or higher (it's harmless and fixes the scr issues)

Thanks, that fixed the scr issues.

> Why not just do scaling on playback, then?
>
> Relatedly, why do you need mpeg2 video in program stream?
>   
My computer is slow and my video card only supports mpeg2 hardware 
decompression under Linux. So I want to pre-process the video 
(deinterlace, resize). Also, I am trying to reduce the HD content file 
size. The raw TS stream for an hour of lost takes up 8.5-9.5GB and that 
will not quite fit on one data DVD and takes up way too much HD space. 
And/or I want to rip the stream to a DVD that can be played in a normal 
DVD player. (As a side note, ABC is being retarded and not releasing the 
second season of Lost on DVD until after the third season starts. Uh, 
yeah, that's a great marketing plan. The iTunes versions suck because 
they are such low bitrate, not surround, etc.)

And at this point, it is the principal of it. :)

>>> The strange thing about this capture is that there are many video
>>> packets full of zeros. There are also no null packets - how exactly did
>>> you capture it?
>>>       
>> I use a version of getatsc (dvb-atsc-tools 
>> http://www.pchdtv.com/downloads.html) that I hacked to filter out 
>> specific PIDs.
>>     
>
> My guess is you introduced a bug that's corrupting the video stream (and
> maybe causing other problems that I didn't notice).
>   
I did some poking around with dvbsnoop. Those packets were introduced by 
xtscut when I chopped up the ts stream. The original ts stream does not 
have them. However, even when I dump a full stream with a stock getatsc, 
I get the same illegal fps error (assuming I am not using vstrict=-2).

>> The hack that I did writes all packets to the disks 
>> except the ones for the PIDs of the sub-channels I do not want
>>     
>
> That sounds backwards...
>   
The concept was that I wanted to maintain the other meta-data in the 
stream (program information, etc.). So the hack does automatic 
determination of what PIDs match to what channels. The reason I did this 
is that xine has no way to select the sub-channel in TS files. (yes, 
yes, mplayer is way better. It is just so powerful that it can be 
difficult to learn. But now that I have read the man page many, many 
times, I lub it.) It seems like dtvstream does what I want but the 
version I found via google is written for V4L and will not compile on my 
FC5 box.

> There are tons of utils out there that do proper packet filtering
> without messing anything up.
>   
Please do tell. It seems that perhaps mencoder is a good candidate?

When I encode and change the fps, e.g.: -fps 60000/1001 -ofps 30000/1001 
then I get a stream of "Skipping frame!" messages and the video looks 
jerky (that is I can notice the missing frames). However if I keep the 
fps the same (that is use -fps 60000/1001), the video looks great in 
mplayer. BUT, I think that is because mencoder is keeping the broken 
frame rate. (If I try to mencode the final file without any options, it 
too reports the broken frame rate).

I am still not able to re-encode to dvd. If I try to specify "-fps 
60000/1001 -ofps 60000/1001" when encoding the DVD, it gives back the 
same error: "[mpeg2video @ 0x861accc]MPEG1/2 does not support 19001/317 
fps". So the "vstrict=-2" stops mencoder from complaining about the 
broken frame rate. Say I run this:

mencoder \
        -oac copy \
        -ovc lavc \
        -lavcopts 
vcodec=mpeg2video:vqscale=4:dia=4:mbd=2:keyint=20:vstrict=-2 \
        -lavdopts skiploopfilter=all:fast \
        -mpegopts muxrate=36000 \
         -mc 0.1 \
        -fps 60000/1001 \
        -ofps 60000/1001 \
        -of mpeg \
        -o Lost-HD.mpg Bad-FPS.ts

Then I run this:
mencoder -oac copy -ovc lavc -lavcopts vcodec=mpeg2video -o Test2.mpg  
Lost-HD.mpg

I still get the "MPEG1/2 does not support 19001/317 fps" error message. 
If I remove the "vstrict=-2" from the first command, I get the same 
message on trying to run it.

If I change the -ofps to 60, then it will re-encode the video without 
vstrict. And the second, short command will convert the stream without 
complaining. Is that a bug that giving the same values for -fps and 
-ofps results in a no-op for fps conversion?

Anyway, sorry if this rambled on. I have been trying different things 
all day and writing this as I go.

b.




More information about the MEncoder-users mailing list