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

Bill Adams gofish at evilbill.org
Sun Jun 4 23:25:02 CEST 2006


I am trying to do a MPEG-2 TS to MPEG-2 PS conversion and am having some 
issues...

This is using slightly patched ffmpeg/mplayer from a SVN pull today 
(Sunday). (The patches from from the livna FC5 source rpms.)

AFAIK, My local ABC affiliate seems to be broadcasting a broken  ATSC  
TS stream. The ts stream I have was acquired with a pchdtv3000 and a 
hacked version of getatsc that filters out unwanted PIDs. This version 
of getatsc works fine for all stations except ABC so I doubt it is the 
program. (Indeed, I have seen the problem with an unfiltered ts stream 
from ABC).

For example, the following command works fine for some PBS content I have:

mencoder -oac copy -ovc lavc -lavcopts 
vcodec=mpeg2video:vqscale=4:dia=4:keyint=20 -vf 
pp=fd,scale=1280:720,harddup -of mpeg -frames 4000 -o Test.mpg 
OPB-SecretsOfTheDead-Titantics_Ghosts.ts

I get a few duplicate frames and a number of lines like:
ERROR: scr 11.701, dts 7.240, pts 7.274
But overall it seems to work and the video is smooth.

However, when I go to encode a stream from ABC, many bad things happen. 
You can download a sample from here: 
http://evilbill.org/static/Bad-FPS.ts (This is the opening to Lost 
season 2 episode 1 so be warned it is be a spoiler for anyone who has 
not already seen all of season one.)

First, I get an invalid FPS:
mencoder -oac copy -ovc lavc -lavcopts 
vcodec=mpeg2video:vqscale=4:dia=4:keyint=20 -vf 
pp=fd,scale=1280:720,harddup -of mpeg -o Test.mpg Bad-FPS.ts
[snip]
[mpeg2video @ 0x8618dec]MPEG1/2 does not support 19001/317 fps

So then I add a -ofps 30000/1001 and every tenth of a second I get at 
least two "Skipping frame!" messages and the video is jerky when played 
back. If I add -noskip, I get "Too many video packets in the buffer: 
..." and the Test.mpg is no good at all.

xine does not like the raw .ts stream: It stutters and gives corrupted 
images. mplayer plays the broken .ts stream fine (smooth video, sound in 
sync) but I really want a clean MPEG-2 PS file.

Any help on converting this file would be greatly appreciated. I also 
have transcode installed if that will fix the bad ts file somehow.

Thanks in advance.

b.




More information about the MEncoder-users mailing list