pt type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-16982186-1']); _gaq.push(['_setDomainName', 'none']); _gaq.push(['_setAllowLinker', true]); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })();
HOME | BIO | RESUME | HACKS | CODE | PROJECTS | GALLERY
________________________________________________________________________________
This is circa August 2001:
I've been mucking with mpeg2 transcoding to mpeg1.
The two projects I'm working on are making VCD's from MJPEG captures on linux
using a DC10+ capture card and transcoding mpeg2 files to VCD that have been
extracted from my Tivo.
The most common way to do the transcode on linux is:
cat file.m2v | mpeg2dec -o YUV | yuvscale -O VCD | mpeg2enc -s -r 16 -o file.m1v
Unfortunately some of the mpeg2 files I've pulled off my tivo are a little
screwed up and cause mpeg2dec to Seg Fault.
MPlayer has done some excellent work in regards to playing
slighting screwed up mpeg2 files.
I wanted to use MPlayer in place of mpeg2dec in the transcode operation
to get around these Seg Faults.
To do this I needed a YUV output from MPlayer.
I wrote a YUV output plugin for libvo that MPlayer uses. It outputs a
YUV4MPEG format file (thats what the mjpeg tools expect)
Here is the patch. I did the diff on the current CVS snapshot of MPlayer
MPlayer-vo_YUV.patch
Unfortunately MPlayer has a ton of printf's in it and seems to rely heavily
on stdout. I didn't want to get to into hacking MPlayer so the YUV output plugin
uses a file named tmp.yuv in the current working directory of where MPlayer is
called.
Here is how I use it:
(I can't seem to background MPlayer because it does I/O on
stdin and stdout and will pause when put in the background)
So in one window:
cd /mpegdirectory
mkfifo tmp.yuv
mplayer -vo YUV file.m2v
Then in another window:
cd /mpegdirectory
cat tmp.yuv | yuvscaler -O VCD | mpeg2enc -s -r 16 file.m1v
Thats It.
Good Luck.
________________________________________________________________________________