Playing interlaced VC-1 videos on Linux

MKV playback, recompression, remuxing, codec packs, players, howtos, etc.
Post Reply
BitJam2
Posts: 53
Joined: Wed Sep 01, 2010 7:04 am

Playing interlaced VC-1 videos on Linux

Post by BitJam2 » Mon Dec 20, 2010 10:22 pm

I'm trying to watch the BBC bluray "Ganges". The main features are VC-1 encoded and I suspect they are interlaced. I am unable to play them on my 64-bit Linux system. I made a 32-bit chroot environment and installed mplayer in it with the win32codecs. I was able to play ripped .mkv files generated by MakeMKV but was not able to play streams.

Unfortunately, the audio gets way out of sync with the video and starts to stutter. I can get them re-synced momentarily by doing a seek (for example mouse-wheel down one click and then up one click) but this gets tiresome and annoying. I'm hoping I might be able to re-encode the .mkv files so they play nicely. Bonus points if I can get them to play on my 64-bit system.

I tried the instructions in the sticky "Simple Howto for re-encoding (bluray) MKV's (linux)" but of course that didn't work because x264 is unable to read/decode the VC-1 interlaced video. I've had some success using mencoder (after many failures). The following seems to work okay, but it may be far from optimal:

Code: Select all

$ mencoder title0.mkv -o title0.avi -vc wmvvc1dmo -ovc lavc -lavcopts vbitrate=5000:vqscale=2 -oac copy
Replace "title0.mkv" and "title0.avi" with your input and output file names.

I can play the created videos on my 64-bit system in mplayer, smplayer, and xine. XBMC segfaults and vlc can only play the audio. Still, the video quality and audio quality and sync seem to be fine in the players that can play the file. I'm sure there are more optimal ways of doing this but at least this is a start.

Just to be clear: I use makemkv to generate .mkv files. Then I run mencoder in the 32-bit chroot environment to transcode the .mkv files to .avi files. I can then play these .avi files in smplayer, mplayer, and xine on my 64-bit system.

skittle
Posts: 349
Joined: Thu Jan 14, 2010 4:23 am

Re: Playing interlaced VC-1 videos on Linux

Post by skittle » Thu Dec 23, 2010 12:47 am

x264 is unable to read/decode the VC-1 interlaced video
Actually because ffmpeg cantnot decode VC-1 interlaced video (there is a unsupported patch somewhere i think). Unforunately besides ffmpeg the only other decoder is windows decoder...

You can try piping the mplayer output to x264... mencoder is known for sucking with audio sync.

BitJam2
Posts: 53
Joined: Wed Sep 01, 2010 7:04 am

Re: Playing interlaced VC-1 videos on Linux

Post by BitJam2 » Thu Dec 23, 2010 6:36 pm

Yes, I completely agree with you that the onus rests on ffmpeg and its current lack of support for VC-1 interlaced. There was a Google Summer of Code project to add VC-1 interlaced support to ffmpeg but the last reported status was they were working on parsing the headers.

Until that support is added, I see no alternative to using the win32codec inside a 32-bit chroot (unless someone starts supporting a binary 32-bit version of mplayer/mencoder again). The command I gave above produces good quality audio and video with AFAICT perfect sync. The size of the generated files are only a litter smaller than the original .mkv files (5.6G versus 6.7G). Some of my failed attempts were to have mencoder output via the x264 codec. For example:

Code: Select all

opts="subq=6:partitions=all:8x8dct:me=umh:frameref=5:bframes=3:b_pyramid:weight_b"
mencoder $1 -o $2 -vf kerndeint -ovc x264  -x264encopts $opts -oac copy
What would the advantages be for piping the mecoder output to x264, and how would I go about doing that?

This page gives some examples of piping mencoder output to x264. But all the different options tend to make my head swim. I'm interested in keeping the quality high without greatly increasing the file sizes. The page I linked to seems it indicate it is a three step process (video, audio, remuxing).

skittle
Posts: 349
Joined: Thu Jan 14, 2010 4:23 am

Re: Playing interlaced VC-1 videos on Linux

Post by skittle » Thu Dec 23, 2010 7:44 pm

I doubt it will help... I do not know.
you can use fifo pipe, or stdin/stdo pipes...
x264 has an audio patch that might help too..

Code: Select all

mkfifo foo.y4m
mplayer -stuff here -vo yuv4mpeg:file=foo.y4m && x264 foo.y4m --more stuff -o foo.mkv
Btw, I see here there is codecs for linux x64... http://www.mplayerhq.hu/design7/dload.html

Post Reply