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

Jeff Clagg snacky at ikaruga.co.uk
Mon Jun 5 00:51:49 CEST 2006


On Sun, Jun 04, 2006 at 02:25:02PM -0700, Bill Adams wrote:
> 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

What is so special about 1280:720 that you always scale to this
resolution? PBS is almost certainly standard def, and you are wasting a
lot of space by upscaling it.

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

This is due to a bug in the mpeg muxer. Not a sign of a problem in the
source material.

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

ABC affiliates use 1280x720, so you don't need to scale to that res.

Use -ofps 24000/1001 for this particular show. Do not use -noskip. If
-ofps 24000/1001 messes you up because commercials are not 24fps (afaik
the only "harm" this will do is to make the commercials look horrible
and jerky), then use -ofps 60000/1001. Also consider using an unpatched
version of mplayer and see if it's different.

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?

> 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.
> 
> _______________________________________________
> MEncoder-users mailing list
> MEncoder-users at mplayerhq.hu
> http://lists.mplayerhq.hu/cgi-bin/mailman/listinfo/mencoder-users



More information about the MEncoder-users mailing list