VirtualDub: save direct to MP4 (Fraps to YouTube) with external encoders

Discussion in 'Video Encoding' started by raffriff, Jan 18, 2013.

  1. raffriff

    raffriff Moderator Staff Member Site Contributor

    Sometimes with AVI videos uploaded to YouTube, the audio gets cut off early. Uploading as MP4 seems to help. MP4+H.264+AAC is one of YouTube's recommended formats.

    Here's one way to get VirtualDub to create MP4's directly, instead of remuxing with another program. Remuxing is easier but takes more time.

    Using VirtualDub external encoders is difficult at first. I have tried to make this as easy to follow as possible, and I hope you find it helpful. Please let me know how this works if you try it! You need VirtualDub version 1.10 or higher to get the "external encoders" feature.

    This has been tested with:
    VirtualDub (32-bit) version 1.10.2 (June 03 2012) and 1.10.3 (Dec 27, 2012)
    Nero AAC version (Feb 18 2010)

    x264 (32bit, 8bit-depth) version 0.125.2200 (May 23 2012) & 0.129.2245 (Jan 10 2013)
    MP4Box version 0.4.6 (March 2, 2011) and 0.5.0 (May 25, 2012)

    UPDATE: 22-Jun-2013: using ffmpeg as an external encoder - see post #28.

    UPDATE: 12-Dec-2013: using batch files with an external encoders - see post #46.

    Thanks to the VirtualDub forum:

    1. copy all the text in the "code" box below and save anywhere as "fraps2.vdprof"
      (or download from Dropbox)
    2. VirtualDub Options menu, External Encoders, Import, "fraps2.vdprof"
    3. search program folders for "neroAacEnc.exe" (you may have it already);if not found, download it from the link above
      1. Options menu, External encoders, Encoders tab
      2. Click on "A nero aac q035," Edit
      3. Update Program location by browsing to neroAacEnc.exe.
      4. Hit OK.
    4. search program folders for "x264.exe" (you may have it already);if not found, download it from the link above
      1. Same as before, go to the Encoders tab
      2. Click on "V x264 r18," Edit
      3. Update Program location by browsing to x264.exe.
      4. Hit OK
    5. search program folders for "MP4Box.exe" (you may have it already);if not found, download it from the link above
      1. Same as before, go to the Encoders tab
      2. Click on "M mp4box," Edit
      3. Update Program location by browsing to MP4Box.exe.
      4. Hit OK
    1. source video:
      • file name must not have any "#" characters; it confuses MP4Box
      • must have an audio track
        • a silent track is OK
        • use Audio from another file if required
        • recommend stereo, 16 bit, 44100 or 48000 Hz; if not, encode may fail mysteriously.
    2. VirtualDub Video menu, Color Depth, Output format =
      "24 bit RGB (888)" or "32 Bit RGB (888)"
      (others may work too; these have been tested)
    3. VirtualDub File menu, Save as Avi.. right-click file name, copy
    4. VirtualDub File menu, Export-> Using external encoder
      File menu, Queue batch operation-> Export using external encoder)
      1. Select "mp4 x264+aac (fraps2)" as your Encoder Set
      2. optional: paste file name copied in step 3 (why? see post #31)
      3. file extension must be "mp4"
      4. file name must not have any "#" characters
      5. hit Save

    If working with Rec.709 video, keep it in YUV color space if possible. This can be done by staying in fast recompress mode if you don't need filters, or using only YUV filters. In the Filters dialog box, check "show image formats" and try to avoid using filters that convert the source to RGB.

    Converting RGB to Rec.601 for external encoders.
    • Source = RGB or YUV-709 upsampled to RGB (many VfW and DirectShow decoders do this)
    • Full processing mode
    • Filter 1: Convert Format 4:2:0 YV12 Rec.709
    • Filter 2: Alias Format color=Rec.601, range=no change
    • for x264.exe, use VUI flags --colorprim bt709 --transfer bt709 --colormatrix bt709
    Save as "fraps2.vdprof" (see Installation step 1)
        "description": "VirtualDub external encoder profile collection",
        "externalEncoders": {
            "sets": {
                "mp4 x264+aac (fraps2)": {
                    "videoEncoder": "V x264 r18",
                    "audioEncoder": "A nero aac q035",
                    "multiplexer": "M mp4box",
                    "description": "mp4",
                    "extension": "mp4",
                    "processPartial": true,
                    "useOutputAsTemp": false
            "profiles": {
                "A nero aac q035": {
                    "name": "A nero aac q035",
                    "program": "neroAacEnc.exe",
                    "commandArguments": "-q 0.35 -ignorelength -if - -of \"%(tempaudiofile)\"",
                    "outputFilename": "%(outputname).aac",
                    "type": 1,
                    "inputFormat": 1,
                    "checkReturnCode": true,
                    "logStdout": true,
                    "logStderr": true,
                    "bypassCompression": true,
                    "predeleteOutputFile": true
                "M mp4box": {
                    "name": "M mp4box",
                    "program": "MP4Box.exe",
                    "commandArguments": "-add \"%(tempvideofile)\" -add \"%(tempaudiofile)\" \"%(outputname)\" -fps %(fps)",
                    "outputFilename": "",
                    "type": 2,
                    "inputFormat": 0,
                    "checkReturnCode": true,
                    "logStdout": true,
                    "logStderr": true,
                    "bypassCompression": false,
                    "predeleteOutputFile": true
                "V x264 r18": {
                    "name": "V x264 r18",
                    "program": "x264.exe",
                    "commandArguments": "--crf 19 --preset veryfast --demuxer raw --input-res %(width)x%(height) --fps %(fpsnum)/%(fpsden) --colormatrix bt709 -o \"%(tempvideofile)\" -",
                    "outputFilename": "%(outputname).264",
                    "type": 0,
                    "inputFormat": 0,
                    "checkReturnCode": true,
                    "logStdout": true,
                    "logStderr": true,
                    "bypassCompression": false,
                    "predeleteOutputFile": true
    Update 12 Apr 2013 version "#3a" - updated description to be more accurate
    Update 21 Jun 2013 version "#3b" - replace description with "mp4" and simplified instructions
    Update 17 July 2013 version 2 - simplified instructions again (no more editing the .vdprof file)
    Update 11 August 2013 - removed tune=zerolatency
    Update 13 August 2013 - YUV mode
    Update 02 September 2013 - Converting to Rec.601
    Last edited: Dec 18, 2013
    substitutemyown and Netif like this.
  2. Hey

    I have done all the instructions in this post, but when I go to export I get the message

    CLI: unable to launch video encoder: the system can not find the path specified.

    I honestly don't know where I went wrong?
  3. It's working great for me!!! I've been using your other guide, for the longest time before trying this.

    Do you mind explaining how to do this whole process as a batch operation? I'm not sure if it's done the same way as your old guide with this process.

    Thanks again!
  4. raffriff

    raffriff Moderator Staff Member Site Contributor

    Check the file paths:
    find & modify "C:\\<whatever>\\x264.exe" (etc) to point to the actual file locations.

    Resh, yes it works! File, Queue batch operation, Export with external encoder.
    Resh Haydee likes this.
  5. Thanks for the reply! I was actually hoping for the kind of quick batch operation that retains filename, etc. similar to what happens when encoding without external encoders. Saves a lot more time than having to drag a file into VirtualDub, queue for batch export, type a name with .mp4, etc. and so on.

    Still very glad I can do this though! I've actually been using most of your FRAPS to YouTube settings for archiving and further editing in Premiere Pro since it still has great quality with smaller file sizes. Compared to something like your ARCHIVE & INTERMEDIATE CLIPS settings which have considerably larger file sizes compared to your For YouTube settings. If you have any other recommended settings that I might have missed that would be better suited for my purposes, I would love to hear from you!

    Thanks again very much!
    raffriff likes this.
  6. raffriff

    raffriff Moderator Staff Member Site Contributor

    Pro tip: when saving, select Save as AVI but don't hit OK - just select, right-click & copy the file name that Virtualdub gives you. Then cancel, Export & paste the name, remembering to add ".mp4"
  7. Hey raffriff, my friend pointed me to this forum when he told me my files are pretty big and that i could lower it by close to a gig. Anyways i dont see the option external encoders
    i use virtual dub to compress my videos using x264xfw without any audio compression and 40min-50 min files end up being 2gb or so. I dont really mind except it just makes the upload take longer which is a hassle with bad upload speeds here in aus. I also upload the videos at 1080P, i have screenshots of the settings i use too if it can help you help me.
  8. raffriff

    raffriff Moderator Staff Member Site Contributor

    Hi Major, external encoding is still more difficult to use, and most times encoding in VirtualDub the normal way is fine. I've written about x264 settings in detail in my thread Fraps to YouTube with H.264. I just made a new post about file size there:
    You can play with the encoding parameters with the external encoding method too; in "fraps1.vdprof" above, find...
    "commandArguments": "--crf 19 --preset veryfast ...
    ...and adjust as needed. This is left as an exercise (you are on your own!)
    Last edited: Aug 11, 2013
  9. Damn lol, well i will post my screenshots of my current settings (you might have to zoom in but it should be good)
    audi i dont have a compression for in vdub. I would like to keep video quality as it is when im currently compressing its mainly audio im concerned about as well, and trying to save as mp4 with it but like i said i cant do step 5 because i cant see the option for it in my version of vdub which is 1.9.11

    Attached Files:

    Last edited by a moderator: Aug 11, 2013
  10. raffriff

    raffriff Moderator Staff Member Site Contributor

  11. i apologize for that. i might give this a try in the future, for now the way im doing it just seems to do the trick and is simple enough i guess
    i pretty much just followed this guide but its a couple years old now
  12. raffriff

    raffriff Moderator Staff Member Site Contributor

    That's OK. Please start a new thread if you have more questions :)
  13. When I go to options in virtual dub, I see nothing that says external encoder, or import...?
  14. raffriff

    raffriff Moderator Staff Member Site Contributor

    You need VirtualDub version 1.10 or higher to get the "external encoders" feature. Sorry, I should have made that more clear! (fixed)
  15. I have version 1.9.11 64 bit
  16. raffriff

    raffriff Moderator Staff Member Site Contributor

    You need to get VirtualDub 1.10 or higher to work with this feature. Also I recommend the 32-bit version of VirtualDub, as there are more filters (video effects) available for it. I haven't tested the settings described in the top post with 64-bit, and I don't plan to.

    Again, let me emphasize that working with external encoders is not very easy. If it's too frustrating and you need your video in MP4 format, try remuxing instead, as I describe here. It's easy and fast (50-100 fps)
  17. Question why is the video and audio settings uncompressed in your guide, but audio set to 44.1 and 128k? Most use 48k...
  18. Also why is working with external encoders not easy? Seems to be decompressing just fine.
  19. raffriff

    raffriff Moderator Staff Member Site Contributor

    I find uncompressed audio to be more compatible, especially with YouTube and video editors - any case where the file must be read and re-compressed. Uncompressed audio is not supported in MP4, so you must use MP3 or AAC compression. AAC is better.

    I don't recall recommending 44.1kHz audio; I say, following YouTube's advice, to leave it at the original sampling rate, whether that's 44100 or 48000, as there is always a slight quality loss in the conversion process (nowadays, very slight indeed). Some video editing programs will convert to 48000 - and 48000 *is* better if you are doing processing like speed adjustment.

    The sample rate on the Fraps video depends on the game and your sound card - Fraps copies the audio & video bits just as they come from the computer.

    Why 128k? I dunno - it's good enough. Actually now I'm using 192k for AAC and 256k for MP3.

    If it's easy for you, great. It's not easy for everyone.
  20. *****EDIT**** - Hmm somethings wrong I looked at the details of the video file and the audio is 89kbps, Video seems fine at 15000kbps~ Any ideas why the audio messed up? The original fraps audio is 1536kbps.

    Yeah I went into your code and changed 44100 to 48000 and 128 to 192, I record both sound and my voice at 48k

    Took me about 34 minutes to do the encoding for a 38 minute video, not bad. :)
    It was 80.7gb before it is now 3.96gb.

    Do you have any filters you can recommend?

Share This Page