Log in

View Full Version : A comprehensive guide to converting Real Media video to .avi using VirtualDubMod


Painkiller90
26th January 2006, 15:57
Hello, this is my first post to DOOM9 forum and I would like to offer some help with something that bothered me for a while and that is conversion of .rm and .rmvb files to avi using VirtualDubMod and Avisynth 2.56. There are other similar posts but I wish to share my solution to that problem too and I hope people will find my guide useful. Okay here we go.

First of all, you need to install the latest versions of Avisynth and VirtualDubMod, which can be found at the software section of Doom9.org,Real Player and Gabest's directshowsplitter (http://prdownloads.sourceforge.net/guliverkli/realmediasplitter_20051125.7z?download).After decompressing the file (the .7z format can be decompressed with the latest WinRAR or 7-Zip, you need to register the filter file, which has .ax extension.Extract the file in C:\windows\system directory.Go to Start>>Run>>Type :regsvr32.exe C:\windows\system\RealMediaSplitter.ax - Then Hit Enter.It should give a successful registration message. I also recommend using RMMuxer (http://elwood.webz.cz/RMMuxer.zip) to separate and encode separately the audio and the video part of the real media file you wish to process.

Step 1: Extracting video from the Real Media File

Unzip RMMuxer, run GUIMux.exe, press "Add" and select the .rm or .rmvb file. At the file tree, select the video stream and press Merge.Select the folder you want to save your file and add the .rmvb extension to the filename cause the program doesn't do it for you. See the pictures below:
5346

5347

Step 2. Opening the file in VirtualDubMod

Create a text file with Notepad and type the following:

#ASYNTHER RMVB 23.976
DirectShowSource("%f", fps=23.976 , convertfps=true)

Save the script in the Template folder of VirtualDubMod as "RMVB 23.976.avst".This script is to be used for rmvb files that have 24 fps.

Start VirtualDubMod. Go to "Tools", select "Script editor". Go to the template folder and open the script.

Then press "Edit", select "script handling" and choose avisynth, otherwise virtualdubmod will not recognise the "convertfps=true" line and it will result in badly desync video.


Then do the same but instead of 23.976 use 29.97. That template is to be used for files that are 30fps. Save that template and now it's time to open the file we extracted.

In VirtualDubMod, go to "file"->"Open file..", choose "all files" at "Files of type", choose the file choose the appropriate template according to the frame rate from "Use Avisynth template" at the bottom.See pictures below:

5349

5350

5348

Now use your favorite codec to encode the avi file. I will not give instructions on avi encoding as there are very good guides about that in Doom9.org.

Step 3: extracting and encoding the audio

Open the original .rmvb file (the one with the sound) in VirtualDubMod as described above. Go to "Streams"-> "stream list" and choose the audio track. Press "Save Wav". Encode the wav file with Besweet to whatever you want (mp3,ogg etc.) and then use Nandub or VirtualdubMod to join the two files( don't forget to choose "direct stream copy" for both). Before joining, go to "Video"->"Frame Rate" and check "change frame rate so video and audio duration match" so the video will be completely sync.

That's it. All done.

You can also encode the audio through VirtualDubMod with a simple procedure and without having to extract the video with RMMuxer. Open the original .rmvb file and go to "stream list" like before.Right-click on the audio file and choose "Full processing mode" and then compression. So VirtualDubMod will do both video and audio encoding. Though it's much simpler, it gave me a badly desync file...maybe I did something wrong. If you try it and it succeeds, let me know please.

I hope I've been helpful to the newcomers in the world of encoding.

Painkiller90

Sirber
26th January 2006, 16:14
6) No warez, cracks, serials or illegally obtained copyrighted content! Links to content of a questionable nature, asking for, offering, or asking for help/helping to process such content in any way or form is not tolerated.
From the sticky:

RealVideo Codec Packs
Note that distributing so called RealVideo codec packs, which is nothing but re-distribution of codec DLLs copyrighted by RealNetworks, and a few registry keys, is illegal. This is not unique for RealPlayer DLLs, most proprietary software products have this restriction. Any posts of links to such codec packs will warrant a double strike for breaking of Forum rule #6. To obtain legal and the most recent RealVideo decoders, install the latest RealPlayer. A link to instructions on how to make this well behaved, can be found near the end of this post.

Inventive Software
26th January 2006, 17:46
Whilst I agree that linking to RealAlternative is in breach of rule #6, the software that he references to use that's also in Real Alternative is not in breach of any rules here (far from it in fact). So I'm not sure if that classes as a breach of rule #6. Correct me if I'm wrong please!

Painkiller90
26th January 2006, 22:46
I didn't know that the program was Warez, it clearly states that it's freeware...still I understand the part about the copyrighted Real codecs. I didn't mean to break any rules nor am I trying to promote any warez sites...far from it. I just described what worked for me just because I saw many people in the forum who have problems dealing with real media files. If there's a legitimate DirectShowFilter for Real, apart from the ones I described, please use it instead.

karl_lillevold
26th January 2006, 23:16
The "official" way would be to install RealPlayer, then get realmediasplitter.ax from Gabest's sourceforge site.
See these two links:
RealVideo Playback (http://forum.doom9.org/showthread.php?s=&threadid=68399)
How to make Realplayer behave nicely (http://forum.doom9.org/showthread.php?s=&threadid=68399)

Painkiller90
27th January 2006, 13:24
I wouldn't have recommended RealAlternative or put a link to it if it hadn't been mentioned by Matroska project (http://packs.matroska.org/) and didn't offer a simpler solution for a beginner (since it installs both codecs and directshowsplitter). The link did not point to a warez site.It was totally clean and the application is freeware. Although in matroska home page it does say that it's unlicensed and they don't have a direct link to it, however they do mention it and ,in a way, recommend it. If I knew that creating a direct link to it was against the rules, I surely wouldn't have done it. In Matroska downloads page for example it has a link to its Google search, but not to a download location. Still, that doesn't mean I have to be branded as a warez distributor, cause I'm not. I didn't even use its codecs or its player. When its installation begins, it recommends to uninstall Real Player if it is already installed. I choosed NOT to unistall the player. Then, it gave me the options to install only the player and the directshowsplitter but NOT the codecs. In conclusion, the only part of the program I used was its directshowsplitter. I was willing to upload a direct link to Gabest's directshowsplitter, but since the Matroska project, which in their playback pack include the above, mentioned RealAlternative, I imagined it would be okay for people to use it. Anyway, I'm not a warez distributor, nor I ever was or will ever be. Follow the "official" recommendation by karl_lillevold to set up your system to work with .rmvb files. The rest is the same. Hope you find the guide useful.I will edit my original message to change the links to the ones reccomended by Doom9 team.

Sirber
27th January 2006, 13:26
@Painkiller90

Give Sasuke back! ;)

Painkiller90
27th January 2006, 16:43
@ Sirber

I'd rather do sexual favors to Ero-Sennin :devil:

Painkiller90
27th January 2006, 18:00
I got a private message asking me how to find out the frame rate of the .rmvb file. I believe, and I would like someone to correct me if I'm wrong, that you should open the file in Real player, go to Tools->Playback Statistics, open the statistics tree and then, at the tree of Statistics.Player.Source.Renderer check the value of AllFrameRates and CodecRate.
Also, check the Real Media utilities sticky by Sirber for RM Analyser/Shell Extension.

Sirber
27th January 2006, 20:22
I could try to add RMVB as input for RealAnime, so you can convert to new x264 or old xvid with no troubles.

Sirber
27th January 2006, 21:26
well, I talked with Karl and there no possible way to get the FPS needed for AVISynth :(

Inventive Software
27th January 2006, 21:39
Play it in RealPlayer and see what the frame-rate is?

Sirber
27th January 2006, 21:43
So for each rmvb file I want to encode in a batch, I will have to launch RealPlayer, capture a screenshot of it, find the FPS in it, then use it in AVSynth. Right :p

Inventive Software
28th January 2006, 12:44
It was just a suggestion! ;)

Sirber
28th January 2006, 14:36
Maybe if I merge RMVB to MKV I could get a kind of FPS, or else I'll have to ask the user :(

damrod
30th January 2006, 03:41
in dambatch i try to retreive framerate for a directshowsource avs but it don't always works..

why convertftps=true? it's not the default value?

i reteive framerate via mediainfo lib...doesn't handle rmvb for this value argggg (no problem with mkv/mp4/avi/wmv sniff)

is there a cmdline tool for rmvb who can do it? ;-)

Sirber
30th January 2006, 03:43
I read on mediainfo website that it doesn't handle it (FPS), and Karl assured me there is not way to get that info. RMVB use timestamps for each frames, and doesn't store a FPS.

damrod
30th January 2006, 04:09
ouinnnnnn

:-)

i will try another method....rmvb_analzy from DC retrieve fps no?
how can he do it...compute/estimation?

usually to be sure i look a the stats in mpc when playing...usually it's 23.976 / 25 or 29.97 ;-)
if only everybody can use "unique" fps like pal/25 (why two fps for ntsc) :-p

Sirber
30th January 2006, 04:21
I didn't tryed much about that. Well, if you find a way, my hears are all open and clean ;)

Sirber
30th January 2006, 04:23
@Damrod

Yous site still point on my old forum, and when I try to contact you I get:


Parse error: parse error, unexpected ';' in /var/www/sdb/7/1/vasaldo/itseasy/0sys_contact_engine.php on line 50

damrod
30th January 2006, 04:27
@sirber

i will correct that ;-)

Painkiller90
30th January 2006, 15:56
Of course you should also create a template for PAL frame rate...(25 fps). As a matter of fact you should create templates for all possible frame rates you might need, it's just that I encountered the above NTSC frame rates more often than PAL. Anyway, about the convertfps=true...when I didn't use that line in my template the file would play at an increased frame rate at the beginning and it would end at a still frame. It would still have the same duration as the original but would not fuction properly. The line "tells" Avisynth to generate or remove frames to achieve the frame rate desired. You can try it without and see what happens...;)

damrod
30th January 2006, 16:00
mum

maybe it can explain

i create my avs the do avs2wav to extract the sound in wave

sometimes...avs2wav crash a the end..the wav is good...avs2wav.exe crash...strange...maybe a problem of frame in the avs...i will try....

and it can't be bad to be sure about the output fps ;)

Sirber
31st January 2006, 01:27
RMVB has been added as source. The only restriction is the source audio has to be stereo, or else besweet fails.

Painkiller90
31st January 2006, 17:46
@Sirber

Good job man...You finally managed to solve the problem with the fps? How did you do it?

Sirber
31st January 2006, 18:03
I didn't solve it. All I know is it's encoding. I don't know if there a delay in the audio, or if there is any other problem. I didn,t have time to test it. All I know is that the encoders handle it.

lucindrea
28th March 2007, 00:42
hmm

not good

http://www.lucindrea.com/oops.jpg