2006
08.16

I have a Hauppage PVR-250 card that I use to capture video with. I love the card but it only lets me capture audio in mp2 format. This is fine for about 85% of standalone DVD players out there but I happen to have one of the 15% that doesn’t play mp2 audio. Mp2 is not actually in the official DVD spec so players are not “required” to support it, even though most do.

The officially supported audio formats are PCM and AC3. PCM is a raw audio stream. It sounds very good but it’s incredibly huge. That makes it impractical for all but the shortest of videos. AC3 is a great sounding, small codec and is perfect for most situations. The only time it’s not practical is when your source audio is really lousy. In that case it can actually make it a lot worse. But as long as you have a good sounding source, you can encode to AC3 pretty painlessly.

I use FFMPEG for almost all my transcoding needs these days. It can do pretty much anything you want, including making perfectly DVD compliant ac3 audio streams from an mp2 source. I wrote the following batch file(called transcode.bat) to make it happen:

@echo off

@set videos=C:\videos
@set tools=C:\tools

:: Prerun commands
C:
cd \transcode\

:: Convert audio to ac3
::
IF EXIST %1.ac3 GOTO CLEANUP
echo Create an ac3 audio stream from mp2...
%tools%\ffmpeg -i "%videos%\%1.mp2" -vn -ab 224 -ac 2 -acodec ac3 -y "%1.ac3"

:CLEANUP
::
echo Multiplex streams...
%tools%\mplex -f 8 -S 0 -o "%1.vob" "%videos%\%1.m2v" "%1.ac3"

pause

If your file is called “home_movie1.mp2″, you would call the script like this:

> transcode.bat home_movie1

Before I call this script I use ReJig to demultiplex the .mpg file created by the Hauppage software into an .m2v(mpeg 2 video stream) and an .mp2(mpeg 2 audio stream). I keep all these source video/audio files in a directory called “C:\videos” and all my command line tools (like ffmpeg.exe and mplex.exe) in a directory called “C:\tools”. Just download the latest ffmpeg and mplex and put them in “C:\tools” before you run this. The script uses “C:\transcode” as it’s working directory so create it also before running. When the script finishes transcoding the AC3 it will multiplex the .m2v and the newly created .ac3 into a DVD compliant .vob file. If you don’t want this just comment that part out.

No Comment.

Add Your Comment

Switch to our mobile site