2012 02 14 Movie Ripping HOW-TO --------------------------------- Quick notes to assist / remind how to rip a movie from optical source. Almost everything I've used are Windows 32bit executables, exceptions are mplayer/mencoder, which I had to recompile and use in Linux, BDSup2sub (java) and the Perl script from perl monks for time shifting SRT files. Every call I make in Wine starts in a terminal window at the command line, where the executable is installed. To my knowledge, AnyDVD-HD is the only piece of software that will rip a blu ray or new DVD properly, and it must be used in a Windows environment. I have read that it will work in a virtualized installation of Windows. Everything else can be done in Linux, one way or another. Software List ------------------ DVD-Decrypter AnyDVD-HD ($$) eac3to (322 AOTW) AviSynth (2.5.8 AOTW) x264vfw VirtualDUB (1.9.2 AOTW) dgmpgdec (DGIndex files) DGAVCdec (DGAVCIndex files) FFmpegSource2 ( http://code.google.com/p/ffmpegsource/ ) BDSup2Sub.jar SubRip SubtitleWorkshop SRTtimeShifter ( http://www.perlmonks.org/?node_id=794976 ) SRTtoSSA.zip (converter is called "converser") mkvtoolnix tsmuxer mplayer/mencoder (edit mencoder.s mux_v->buffer_size to 4M) (only for lossless recompression) Other optional software : DVDFab Decrytper or IMGburn (I believe can be used in place of DVD Decrypter) XBOX360.HD-DVDRom.UDF.Reader.v2.5.WindowsXP-BluePrint.rar (to use UDF in WinXP) ******************************** ******************************** INDEXING and FRAME-SERVING ******************************** ******************************** -------------------------- DVD to x264-AC3 -------------------------- NOTE - AutoMKV in Wine works very well. Try that first. Mount the disc, point AutoMKV at the drive and walk away. If you choose a final file size that's too small, AutoMKV will hang - it'll just keep cycling through its statistical pass, again and again. You'll have to kill it off and increase the final file size, or do it manually. Usually, I rip the DVD manually (rip as a single VOB), then direct Automkv at the decrypted VOB; it just seems to work better, plus the queueing function seems to like big VOBs best. To do things manually - Rip DVD down to a single large VOB. Most DVDs will rip through DVDdecrypter (WinNT4.0/3.5 emulation in Wine) easily enough. The new AACS-encrypted DVDs from SONY may require using AnyDVD-HD in a Windows box, or DVDFab Decrypter under Wine. - Use DGIndex to index the decrypted VOB. Set Audio from menu to demux all audio tracks. Will create .AC3 and .D2V files wherever you save the project. If you've installed AutoMKV, the necessary executables are under the /exe directory in the installation path. You can either start DGIndex normally and load/save through the GUI, or do it from the command line : wine DGIndex.exe -IF=[Input.VOB] -OM=2 -OF=[Ouput] - Create an AVISynth frame-serving file "Moviename.avs" like this: LoadPlugin("C:\Program Files\avisynth 2.5\plugins\DGDecode.dll") MPEG2Source("C:\WineHD\MOVIEindexNAME.d2v") LoadPlugin("C:\Program Files\avisynth 2.5\plugins\DeComb.dll") AssumeTFF() Telecide(post=0) Decimate(cycle=5, quality=2) #crop(0,0,0,0) - Open Moviename.avs with VirtualDub, apply filters as desired. - Use x264vfw to perform a 2-pass encode of the movie. Note that you will have to tell x264vfw how many threads to use, if you have a multi-core machine. Also, set the VirtualDub hack, and set the profile/level to 4.1. Note that, under Wine, it seems if you try to run each pass separately (that is, not in batch mode) that you will have to leave VirtualDUB as the last program you started, and you won't be able to do anything else, or the program will stall. The best choice is to use batch processing, even if you are only doing one pass at a time. - Use mkvmerge to interleave the video and audio tracks into the matroska container. See below for mkvmerge usage. ------------------------------------- BD/HD-DVD to x264-AC3 ------------------------------------- - Rip the BD/HD-DVD with AnyDVD-HD (possible DVDFab Decrypter-HD under Wine - I haven't tried yet). You can use AnyDVD-HD to just rip the entire contents of the disc down to the hard drive, then work with that directory. Alternately, if you have a UDF-2.5 parser, after AnyDVD-HD has finished scanning/analyzing the disc, the disc's contents will be available to any Windows programs. I believe the filename you're looking for, for WindowsXP, is "XBOX360.HD-DVDrom.UDF.Reader.v2.5.WindowsXP-Blueprint.rar". Personally, I have no use to browse the disc. AnyDVD-HD has a UDF parser built in, so you can just copy the disc straight to the hard drive and work from there. - The best method to determine which track(s) you want, is to use eac3to to analyze the entire disc structure. wine eac3to "C:\MovieName" Which will yield the playback contents of the entire disc from the menu. If the main feature is menu item 12) , the desired video track is track 3, and the audio track you want is track 5, then you can use that menu item to automagically put things together. wine eac3to "C:\MovieName\" "12)" 3:"C:\MovieName\Movie.vc1" 5:"C:\MovieName\Movie.ac3" that command will add up all the necessary files and output the demuxed tracks as single files. You can do it manually, as well. With HD-DVD rips, it is usually pretty clear which files are the feature movies. They will be large, and ordered alpha-numerically, generally with reasonably clear titles. Feature_1.EVO, Feature_2.EVO, that kinda thing. Just find the two largest consecutive files. It is just a matter of combining the files in eac3to when you're demuxing them : wine eact3to "C:\MovieName\HVDVD_TS\Feature_1.EVO"+"C:\MovieName\HVDVD_TS\Feature_2.EVO" 1:"C:\MovieName.vc1" 3:"C:\MovieName.eac3" - Note that you can combine as many files as you like, you are not just limited to two. - Bluray is a little more difficult. In a movie like Wall-E, for instance, Pixar has rendered scenes with printed language for the various language tracks, so although the movie length will always appear the same, it is tough to tell which is correct, for your language of preference. It may take several tries to put together the correct combination. You can use the -check function with eac3to on a playlist file (PLAYLIST\0000.mpls), but it doesn't yield a full list of files its using - the only useful piece of information is the time (length), possibly the video resolution. It does appear that eac3to can use a bluray playlist to demux the selected files though. You can go through the various .M2TS files and look for a scene containing rendered language, find the scene with your language of choice (usually there are two or three .M2TS files of the approximate same size), then try to discern which playlist employs that scene (the playlist is usually several kilobytes in size). tsMuxerGUI.exe is an excellent piece of software for determining the main movie, manually. Just open playlists until you find the group of files with the one you're after. Somtimes, there are so many braches that the output filename will exceed the maximum character count for. When that happens, just mux it into an .M2TS file instead of immediately demuxing, then demux the .M2TS file Many blu rays feature just a single huge track under the /STREAM directory. You can also just work on that track directly. Let's extract and demulitplex the two desired tracks. In the example, we are extracting a vc1 file from stream 1, and a DTS audio track from stream 3, from a bluray rip : wine eac3to C:\MovieName\BDMV\Stream\InputName.m2ts 1:"C:\MovieName.vc1" 3:"C:\MovieName.dts" If it was an h264 stream on track 3 and a PCM stream on track 5 from and HD-DVD rip: eac3to "C:\MovieName\HVDVD_TS\InputName.EVO" 3:"C:\MovieName.264" 5:"C:\MovieName.pcm" To extract the chapters from a BDROM just export them as text files eac3to C:\MovieName\BDMV\Stream\InputName.m2ts 1:"C:\MovieChapters.txt" You can also use playlists to combine multiple tracks : - This example uses playlist 0000.mpls to extract a vc1 video track and a TrueHD audio track : eac3to "C:\MovieName\BDMV\PLAYLIST\00000.mpls" 1:"C:\Moviename.vc1" 2:"C:\Moviename.thd" - At this point, if the video is MPEG-2 or H264, you can use the Indexing programs to index the video files and open them in VirtualDub via AVIsynth, to check if they are correct. If the video is VC1, you'll likely have to do a full lossless conversion first (see below). Common file extensions eac3to expects : Video.........: .h264 .vc1 .mpeg2 Audio.........: .pcm .dts .thd .ac3 .eac3 .wav .wav64 Chapters......: .txt PGS Subtitles.: .sup .srt - Keep in mind, that eac3to can convert your audio on the fly as well. So if you are extracting a DTS audio track (say, on track 2), but it is your intention to make it a 24bit 448kbps AC3-5.1 track, you can do it thus : wine eac3to "C:\MovieName\Movie.m2ts" 1:"C:\MovieName\Movie.h264" 2:"C:\MovieName\Movie.ac3" -448 -down24 To index an h264 track, use DGAVCIndex.exe. You can either fire it up and load/save through the graphical interface, or use the command line with the switches wine dgAVCIndex.exe -i "Input.h264" -o "Output.dga" The basic procedures for recoding one of the three high-def codecs on optical disc, using VirtualDub, are : === MPEG-2: Use the DVD procedure above, just generates a larger picture. If you demux with eac3to, you'll have to give it the extension .MPEG2, but to run DGIndex on it, you'll have to rename the extension to .MPEG === H264: Use a similar procedure to the DVD way, except use dgAVCIndex instead of DGIndex to index the file. === VC1: Index with ffmsindex , then use the DVD way. === All codecs : Convert to HuffYUV lossless file (huge file, say, 300G) with mencoder then encode in VirtualDub. See VC1 below. Use the approriate AVIsynth script from the net five examples to load the indexed video into VirtualDub. AVIsynth SCRIPT EXAMPLES ------------------------------------------ vvvvvvvvvvvvvvvvvvvvv # .avs script # for H264 AVC sources # LoadPlugin("C:\Program Files\avisynth 2.5\plugins\DGAVCDecode.dll") AVCSource("C:\WineHD\MOVIEindexNAME.dga") # ONLY UNCOMMENT THE NEXT OPTIONS IF THE FILE COMES UP AT 29.97fps # #LoadPlugin("C:\Program Files\avisynth 2.5\plugins\DeComb.dll") #AssumeTFF() #Telecide(post=0) #Decimate(cycle=5, quality=2) # #CROPPING and RESIZING # Best compression achieved with mod16 resolutions. #crop(0,0,0,0) # # RESIZE TO STANDARD 720p USING BLACKMAN #BlackmanResize(1280,720) ^^^^^^^^^^^^^^^^^^^^^ vvvvvvvvvvvvvvvvvvvvv # # .avs script # for VC1 sources # LoadCPlugin("C:\Program Files\avisynth 2.5\plugins\ffms2.dll") # NOTE that was # LoadCPlugin *not* LoadPlugin # Import("C:\Program Files\avisynth 2.5\plugins\FFMS2.avsi") FFmpegSource2("C:\MOVIEwork\MOVIEname.mkv", cachefile="C:\MOVIEwork\MOVIEname.mkv.ffindex") ^^^^^^^^^^^^^^^^^^^^^ vvvvvvvvvvvvvvvvvvvvvvvvvvv # # .avs script # for MPEG2 sources # LoadPlugin("C:\Program Files\avisynth 2.5\plugins\DGDecode.dll") MPEG2Source("C:\WineHD\MOVIEindexNAME.d2v") # The following with decimates the video. # Usually unnecessary on blu ray sources. # Uncomment only if source is 29.97fps # Check frame rate through Virtualdub menu. #LoadPlugin("C:\Program Files\avisynth 2.5\plugins\DeComb.dll") #AssumeTFF() #Telecide(post=0) #Decimate(cycle=5, quality=2) # # Crop and resize, if necessary. Best compression is achieved # with mod16 resolutions. #crop(0,0,0,0) #BlackmanResize(1280,720) #PointResize(1280,720) #SplineResize(1280,720) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ vvvvvvvvvvvvvvvvvvvvvvvvvvvv # For Direct Show Sources DirectShowSource("C:\Filename.avi") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ vvvvvvvvvvvvvvvvvvvvvvvvvvvv # For AVI sources AVISource("C:\AVIsource.avi") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ----------------- VC1 ripping ----------------- There are two methods described here. VC1 indexing took the community a little longer to get at, so initially I would just recode the VC1 track as a lossless HUFFman avi, then open that in VDub. AOTW, there is a method for indexing VC1 files with FFmpegSource2 software, which can be frame-served through AVIsynth into VirtualDub. Rip the disc with AnyDVD-HD. Use tsMuxer (or eac3to) to demux the preferred video and audio streams. INDEXING VC1 WITH FFmpegSource2 ------------------------------------------------------- Make sure the ffms-2.17-cplugin is decompressed and installed in the AviSynth /plugins directory. Use mkvmerge to put the VC1 file into a matroska container. If you don't do this, then you will not be able to use the seek function in VirtualDub. Once the video stream has been placeed into the MKV container, decend ito the /AVIsynth /plugin/ffms-2.17-cplugin directory and use ffmsindex.exe to index the mkv file wine ffmsindex.exe "C:\MOVIE_DIRECTORY\MOVIEname.mkv" If you don't call ffmsindex from this position, when you go to open the file in VirtualDub, it will re-index the file again. Not a big deal, just a time waster. INDEXING VC1 WITH DGDecodeNV ----------------------------------------------------- Alternately, if you are in Windows and have an nVidia video card, you can use DGDecodeNV and just perform the rip like an h264 rip. DGDecodeNV will create a .DGI file, so use an AVS file like DGIndex to open the indexed VC1 track. This does not yet work under Wine, yet, as the CUDA implementation appears to be limited to a true Win environment. LOSSLESS RECOMPRESSION METHOD ---------------------------------------------------------- Convert the video track into HUFFyuv or ffv1 lossless. 45 minutes requires about 100Gb with HUFFman, FFV1 makes smaller files (about 1/3 the size of HUFF) but takes a lot longer. There is an issue with the stock video frame buffer size in mencoder which may cause HUFFman encoding to fail when you go to recode in VirtualDUB. The workaround is to increase the buffer size to 4M from 2M (see below). FFV1 sems to fit inside the stock buffer easily, but is a very slow codec to work with. LJPEG (lossless jpeg) is another option, but suffers the same issue buffer_size issue as ffvhuff. HUFFman, in my experience, is by far the prefeable codec to use. Whichever you choose, make sure output is in AVI format, if you want to use VirtualDub to encode. MENCODER USAGE -------------------------------- mencoder InputName.vc1 -vc ffvc1 -ovc lavc -lavcopts vcodec=ffvhuff -nosound -o OutputName.avi mencoder InputName.mkv -vc ffvc1 -ovc lavc -lavcopts vcodec=ffvhuff -oac pcm -o OutputName.avi OR (with pcm sound) mencoder InputName.mkv -vc ffvc1 -ovc lavc -lavcopts vcodec=ffv1 -oac pcm -o OutputName.avi Often, the first video frame of the lossless encoding will appear as a bright solid colour, when opened in Virtualdub, but I have found that it doesn't have any influence on the work. I don't understand why it is this way. We are using ffvhuff / ffv1, so HUFF must be enabled in the FFV codec in VirtualDub. The default behaviour for the HUFFyuv decoder in FFV under VDub is disabled. You can change it by going under Compression, selecting the ffvshow codec, right-clicking and "set libavcodec to all stable". Open the avi, recode with x264vfw and no audio track, then finish by mkvmerge-ing the x264 video and AC3 audio To encode just a portion of video mencoder Input.avi -ovc lavc -lavcopts vcodec=ffvhuff -nosound -ss 01:03:00 -endpos 60 -o Output.avi starts at point 01:03:00 and encodes 60 seconds of video with no audio If doing a lossless encode on a VOB file, mencoder will automatically hard sub one of the subtitles tracks into the video, there doesn't seem to be a switch to disable autosubs (-noautosub doesn't work). The only solution I've been able to come up with is to use the switch "-sid 42", which apparently tricks mencoder into not using subs at all : mencoder InputName.VOB -ovc lavc -lavcopts vcodec=ffvhuff -oac pcm -o -sid 42 OutputName.avi If you are using mencoder for some other source, to HUFF, make sure the resolutions are modulo 4 compliant (-lavcopts vcodec=ffvhuff -vf scale=720:480) If you have multiple sources to be appended together, you can use something like : mencoder -vc ffvc1 -ovc lavc -lavcopts vcodec=ffv1 -oac pcm -o OutputName.avi InputName01.mkv InputName02.mkv InputName03.mkv ----------------------------------------------- Build mencoder with a bigger buffer ----------------------------------------------- Build mencoder with an increased buffer size. The ffv1 codec works, but is very slow in every respect (encoding, seeking after encode, etc). When compiling mplayer, just edit mplayer/mencoder.c, at about line 895, from this : mux_v->buffer_size=0x200000; // 2MB change to : mux_v->buffer_size=0x400000; // 4MB That will give you a 4 meg frame buffer, which should be plenty for anything 1080p. If you are working with even larger source material, maybe prepping something for 4k video, then you'll need a larger buffer still. ------------------------------------ Machine-specific resolutions ------------------------------------ - PS3 - If your intention is to play back on a PS3, you have to make the final video stream an industry standard width (1920, 1280, 720). If you plan on making a blu ray disc (AVCHD disc), you have to make the video stream a standard resolution (1920x1080, 1280x720, 720x480). - NVIDIA - Some earlier nVidia-based cards cannot cope with some non-standard widths : http://en.wikipedia.org/wiki/Nvidia_PureVideo All feature set B hardware cannot decode H.264 for the following widths: 769-784, 849-864, 929-944, 1009-1024, 1793-1808, 1873-1888, 1953-1968, 2033-2048 pixels. This stopped being an issue after the 9000-series GeForce chips, everything since then is capable of (AFAIK) any width base-16 (maybe base-4). ******************************** ******************************** SUBTITLES ******************************** ******************************** ------------------------------- Subtitles in AVIsynth ------------------------------- Rip your subtitles to .sub format using one of the above methods, then open them in SubtitleWorkshop and convert them to SSA. Open in an AVisynth script using the line: TextSub(C:\YourSubtitle.ssa") There are various output options for choosing colour, margins etc, in the drop down menu of SubtitleWorkshop, and Textsub is capable of using many types of subtitles format. ------------------------------- DVD Subtitles in VirtualDub ------------------------------- - Rip the DVD with DVD Decrypter into a single VOB - Open up SubRip - Set the global options to "Forced Only" if that's all you want. - Open the IFO or VOB with SubRip - Start the OCR process. This will involve the computer trying to recognize the characters, and prompting you for input when it doesn't. If it presents an entire letter, just enter the letter, but if it presents a portion of a letter, you are better off clicking the "Enter Manually" and putting in the whole line. - Once the program has run its course, click the "save" icon, save your file as an SRT file. Check the time offset to make sure the subs are timing with the movie. You can do this by checking the "stream information" text file that DVD Decrypter includes, comparing the start times indicated there with the start time indicated in the first sub in the lower window of Subrip. - Open with Wordpad (wine wordpad.exe), go in and edit as required. The OCR rarely gets things entirely correct. When you are finished, save as type ANSI, not unicode.You can use KWord under KDE, just make sure to save the plain text style with Windows-style carriage return and linefeeds. Leafpad also work nicely. - open the SRT to SSA converter, it is called Converser.exe. Run it on the SRT file you made, choose the colour options and font that suit you best, save it as type SSA. I usually change out the font definition line with this one : Style: Default,Book Antiqua,24,16763283,0,16777215,0,-1,0,2,1,2,20,20,13,0,0 which is a nice light blue font, 13 pixels from the bottom of the image, 24 pixels in height. - Now your subtitles are ready for hard coding, open VirtualDub, use the subtitler filter, and select the .ssa file you created. Subtitles should show nicely. - If the subs don't sync with the movie, use the SRTtimeShifter from http://www.perlmonks.org/?node_id=794976 to sync it. Be advised that it struggles with any subtitles that fall directly on the 00 minute mark (I believe it has to do with how an SRT uses a comma for a decimal), you'll probably have to fix those circumstances manually (both beginning and ending at 00 minutes). I think that Subrip also gives you the option to time shift before you save the OCRed file,but it will mean re-doing the OCR process. - Note that, if you don't want to hard code, you can just use the SRT file without converting to SSA, mux it in with mkvmerge. You'll need SSA format if you want to first test sync in Virtualdub, though. ----------------------------------- Blu ray Subtitles in VirtualDub ----------------------------------- While this will work for full subtitles, I'd say it is primarily best for forced subs, as the OCR process requires a *lot* of manual effort. Use tsMuxerGUI to open up a playlist and show the various subtitles files. You can use eac3to as well, but I have found that eac3to does't show the subtitle tracks when you analyze the disc structure - You'll have to look at the output to determine which tracks are needed. Demux the English tracks, they will come out as .SUP files. Two circumstances : If there is a (relatively) small track, it is likely the forced track. If there is/are only large SUP file(s), open one of them and look for the word "forced" to be highlighted on the top right corner. It will only say "yes" if that particular subtitle is forced, so there is no real way to determine if the track contains forced subtitles, without saving it first (as described next). Open with BDSup2Sub.jar. java -jar ./BDSup2Sub.jar Settings for BDSup2Sub -Settings->Conversion Settings : Convert resolution to 720x480 Set frame rate to same is input Apply Free Scaling - if there is a scene that has two lines of text, then set X&Y to 0.5, otherwise Subrip will skip it. Click "OK" -Edit->Move All Captions : For Y position, "move outside bounds" Offset Y = 2 Click "Move..." The above is used to get the subs on the bottom of the screen, so Subrip can OCR them later. SubRip only looks at the bottom of the screen, and if the subs aren't present in its "field of vision", they will be omitted. Export the file. If you are dealing with a large file, then tick the "forced only" box. This will create an IDX/SUB file pair. - Open the IDX with SubRip and OCR the file. If Subrip 's Global Option is set to "forced only" (from, say, a previous DVD rip) it won't read the file properly, so uncheck that. You'll find that it doesn't do a very good job on its own, you'll almost certainly have to manually enter every line. Once it's done, save it. Now you've got an SRT file to work with. Spellcheck it, then open with the SRTtoSSA program Converser. Import the SSA with the subtitler filter in Virtualdub. Style: Default,Book Antiqua,48,16763283,0,16777215,0,-1,0,2,1,2,20,20,35,0,0 which is a nice light blue font with black border, 35 pixels from the bottom, 48 pixels high. - Note that, if you don't want to hard code the subs, you can just mux the SRT in with mkvmerge, but if you want to test sync under Virtualdub, they need to be rendered in SSA format. Sometimes the subtitles won't sync up. Use the SRTtimeShifter perl script from http://www.perlmonks.org/?node_id=794976 to change the timing offsets on the SRT file, then convert it to SSA. Download the script and save as SRTtimeShifter.sh, make executable, then : SRTtimeShifterScript.sh TimeInSeconds INPUT.SRT > OUTPUT.SRT SRTtimeShifter BUG --------------------------- Note that the script has trouble subtracting time with subtitles that begin/end on the 00 minute mark (I think because SRT protocol uses a comma instead of a decimal for thousandths of a second), you'll have to manually correct anything that has been adjusted to a 00 minutes mark (beginning and ending). It seems to do OK with ad time, though. Although I haven't used it for this purpose, yet, is appears tha SubtitleWorkshop can do all this work as well. You may be better off trying to make your changes in there. ******************************** ******************************** AUDIO ******************************** ******************************** The primary piece of software for converting audio is eac3to. Usually: wine eac3to.exe "C:\InputAudio.dts" "C:\OutputAudio5.1.ac3" -down24 -448 wine eac3to.exe "C:\InputAudio.dts" "C:\OutputAudioSTEREO.ac3" -down2 -down16 -192 eac3to output, AOTW, is limited to 2.0 and 5.1 soundtrack. It can extract the core sound from the various exotic/high-end soundtracks, but its output is limited to these two types of channels. When demuxing an audio stream in tsMuxer , I find it best to select the option to extract/reduce the core component of the audio stream, rather than have eac3to do it. See below for additinal information on eac3to. ******************************** ******************************** VARIOUS SOFTWARE NOTES ******************************** ******************************** ------------------------- MKVmerge Usage ------------------------- Official howto: http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html Personal notes: In Wine, and from the directory where mkvmerge is installed : wine mkvmerge.exe -o "C:\MOVIENAME.mkv" --chapters "C:\SimpleChaptersFile.txt" --default-duration -0:24000/1001fps --track-name -0:"MOVIENAME" --aspect-ratio -0:1.7778 -A "C:\VIDEOSOURCE.avi" --language -0:eng -y 0:500 --default-track -0:yes "C:\AUDIOSOURCE.ac3" will output (-o) the .mkv in the C drive, using the simple chapter text file "SimpleChaptersFile.txt", no audio from the AVI (-A), delaying the AC3 audio 500ms (-y 0:500 ). If the mkv already exists, and you want to fix the AV sync, use : wine mkvmerge.exe -o "C:\OUTPUTNAME.mkv" -d 1 -a 2 -y 2:200 "C:\INPUTNAME.mkv" which will delay the audio track (track 2) by 200ms. ------------------------------------------ tsMuxer Usage for PS3 Playback ------------------------------------------ If you want to mux as an M2TS file for playback on a PS3, first make a .meta file thus : MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbr --auto-chapters=5 --vbv-len=500 V_MPEG4/ISO/AVC, "C:\WineHD\MOVIENAME.mkv", level=4.1, insertSEI, contSPS, track=1 A_AC3, "C:\WineHD\MOVIENAME.mkv", lang=eng, track=2 Or maybe MUXOPT --no-pcr-on-video-pid --new-audio-pes --vbr --split-size=20GB --auto-chapters=5 --vbv-len=500 V_MPEG4/ISO/AVC, "C:\WineHD\VIDEOSTREAM.h264", insertSEI, contSPS A_AC3, "C:\WineHD\AUDIOSTREAM.ac3", lang=eng the above will spit the m2ts files at 20G each, but will not change the level like the first example. It also inserts chapters every 5 minutes. Now call tsMuxeR.exe "C:\YOUR-META-FILE.meta" "C:\OUTPUT-NAME.m2ts" Note that anamorphic rips are not supported in transport Streams (TS, M2TS) - they will only play pure pixel aspect ratios. If your view screen is the correct aspect ratio for an anamorphic encode, you can set the PS3 to "fullscreen" mode and they will play properly, but really, if the plan is play them on a PS3, just rip them with the proper "pure" aspect ratio. ------------------ eac3to Usage ------------------ In Wine, and from the directory where eac3to is installed : wine eac3to "C:\AudioInput.dts" "C:\AudioOutput.ac3" -448 simply converts a DTS track to AC3, will make it 64 bits depth. I generally take it down to 24 bits, with the -down24 switch as well wine eac3to "C:\AudioInput.dts" "C:\AudioOutput.ac3" -448 -down24 This is the general approach for all conversions. eac3to is capable of a lot more, though. You can use it to demux AV files, mux them, alter audio in fundmental ways. eac3to Inputname -demux eac3to InputName 1:track1_Output 2:track2_Output eac3to InputDTStrack.dts OutputWAVtrack.wav eac3to -help ---------------------------------------------------------------- Burning 8G files to DVD+R/DL for PS3 playback ---------------------------------------------------------------- Make the ISO under wine using IMGBURN. Use UDF-2.5 filesystem. Burn the ISO with K3B - it will complain that the disc is not a standard ISO9660 tpe, but it will still burn. A 2.5X DL disc takes about 45 minutes to burn. --------------- AAC audio --------------- The best way is to build the FAAD2 libraries and executable i Linux and use faad to convert to a wav. Otherwise, this may work To convert AAC stereo, use mplayer : mplayer -ao pcm ./MOVIENAME.mov -ao pcm:file="MOVIENAME.wav" or maybe mplayer -vc null -ao pcm ./MOVIENAME.mov -ao pcm:file="MOVIENAME.wav" then convert the WAV using eac3to. --------------- WMV files --------------- WMV have variable frame rates, so when they are converted with mencoder, they show up as 1000fps. Specify the fps at the command line, then open in VirtualDub, save the WAV, and encode the video. Encodee the audio w/eac3to or lame, then remux the streams with mkvmerge. mencoder InputMovie.wmv -ofps 29.97 -ovc lavc -lavcopts vcodec=ffvhuff -oac pcm -o OutputMovie.avi ------------- FLV files ------------- Convert with mencoder as above. Put into an MKV container with mkvmerge. Extract the audio track with eac3to, convert to AC3. If you want to encode the audio to OGG, then use oggenc -b 320 -raw Input.Wav Open HUFF AVI in Virtualdub and encode, mux AC3. Extract audio from FLV files with FFMPEG -------------------------------------------------------- FFMPEG to extact audio from FLVs ffmpeg -i Input.flv -acodec pcm_s16le -ac 2 Output.wav