[mythtv-users] Is anyone transcoding BBC HD using Mencoder?

belcampo belcampo at zonnet.nl
Fri Mar 26 14:12:00 UTC 2010


Another Sillyname wrote:
> Until recently transcoding BBC HD transmissions to a more managable
> size was fairly straightforward, however just before Christmas the BBC
> have changed their transmission standard and my scripts that worked
> before Christmas now fail.
> 
> Specifically what's happening is that the video stream is running at
> 50% of the speed of the audio stream (and the audio stream is
> correct).  I'm pretty certain that this is related to the BBC's
> interlacing standard and although I've faffed around with lots of
> different settings I cannot find anything that works.
> 
> What I want to do is transcode the original source material to
> 1280x720 x264 and shove it into a mkv container (I use mkkgui to do
> this).
> 
> I anyone has a working mencoder line for BBC HD they could post here
> I'd be very grateful as my backend is starting to fill up and I'd
> really like to stick the stuff in the library.
> 
> Regards
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
Not using mencoder but ffmpeg with good/fast and insync results by 
working this way:

Play source to determine start and endposition.
Rename source.mpg source.ts, as tsmuxer will not recognize the file as 
being a ts.
tsMuxerGUI `pwd`/source.ts
Disable the NAR-audio, if not needed of course, select "Split & cut", 
enable "Cutting" add Start End values, select Demux, select "Start 
demuxing".
You now will have source.track_5500.264 and source.track_5501.ac3 which 
are perfectly synced sources, which means if merging with mkvmerge or 
tsmuxer or ffmpeg there will be NO delay for audio or video.
You now only have to encode the cutted parts, not with the overlapping 
parts, with whatever tool you like.
On an  AMD Athlon(tm) 64 X2 Dual Core Processor 4000+ it encodes the 
file to 1280x720 at 10fps, so it takes 2.5hours for a 1hour program, 
with following encoding parameters:
ffmpeg -i source.track_5500.264 -an -vcodec libx264 -threads 0 -b 2872k 
-deinterlace -flags +loop -coder 1 -refs 2 -deblockalpha 0 -deblockbeta 
0  -partitions +parti4x4+partp8x8+parti8x8+partb8x8 -me_method umh -subq 
4 -me_range 16 -flags2 +dct8x8+mixed_refs -cmp +chroma -bf 0 -b_strategy 
1 -g 250 -keyint_min 25 -sc_threshold 40 -maxrate 2500k -qmin 22 -qmax 
27 -s 1280x720 -f rawvideo source720p.264

I want 'quality', hence qmax 27, with 'low bitrates' 2872k. If it's a 
low movement source q will be at 22, not wasting bits on, not perceived 
by me, 'better' quality. While giving adequate quality, -qmax 27, at 
lowest possible bitrate in fast moving scenes.

Merge the encoded results with mkvmerge or MP4Box or tsMuxerGUI to what 
you want. If you want subtitles, you can extract them with projectx. 
Doing this for BBCHD, the command is:
projectx -ini ~/888.ini -id 0x157F -demux -out . $1
where 888.ini is a renamed X.ini from projectx where teletext page 888 
is defined as the wanted page#.
You'll get the uncutted length of the subtitles. With mmg, the gui for 
mkvmerge, you can define a negative delay for the subtitles, so you're 
able to get them in sync.
mediainfo tells me about "a BBCHD-sourcefile' that
Video delay                      : -1176
By using tsMuxerGUI for cutting and demuxing, you don't have to fiddle 
with these values sources are 'padded' to get them in sync.

Hope it helps someone.


More information about the mythtv-users mailing list