Raffriff's awesome VirtualDub tutorial

Discussion in 'Video Encoding' started by raffriff, Oct 27, 2011.

  1. Wow thanks for the time and effort you're putting into this raff, I really appreciate that!

    Okay I followed the steps you described, plus I checked the "Execute as Admin" box in the properties of virtual Dub exe to avoid permission issues. So virtual Dub is now always being started with admin privileges. I git the following log file:

    Code:
    [*] AVI: Opening file "Z:\fraps\movies\penumbra 2013-09-16 00-37-14-55.avi"
    
    [i] AVI: OpenDML hierarchical index detected on stream 0.
    
    [i] AVI: OpenDML hierarchical index detected on stream 1.
    
    [*] AVI: Opening file "Z:\fraps\movies\FlashPlayerPlugin_11_8_800_168
      2013-09-16 02-57-15-73.avi"
    
    [i] AVI: OpenDML hierarchical index detected on stream 0.
    
    [i] AVI: OpenDML hierarchical index detected on stream 1.
    
    [*] Beginning dub operation.
    
    [i] Dub: Input (decompression) format is: RGB888.
    
    [i] Dub: Output (compression) format is: YUV420.
    
    [i] AudioEnc: **** AUDIO: NeroAAC ***********
    
    [i] AudioEnc: 21:17:59,18
    
    [i] AudioEnc: E:\fraps>"C:\Program Files
      (x86)\VirtualDub\NeroAAC\win32\neroAacEnc.exe" -q 0.35 -ignorelength -if -
      -of "E:\fraps\test_002.mp4.aac"
    
    [i] AudioEnc: ERROR: could not open AAC encoder
    
    [i] AudioEnc: 21:17:59,21
    
    [i] AudioEnc: USAGE q-factor output-path
    
    [i] AudioEnc: q-factor = 0.35
    
    [i] AudioEnc: output = "E:\fraps\test_002.mp4.aac"
    
    [i] VideoEnc: encoded 1 frames, 9.80 fps, 9294.79 kb/s
    
    [i] Mux: **** MUXING: MP4Box ***********
    
    [i] Mux: MUXER ERROR: BAD OR MISSING ARGUMENT
    
    [i] Mux: USAGE video-src-path audio-src-path fps output-path
    
    [i] Mux: video-src = "E:\fraps\test_002.mp4.264"
    
    [i] Mux: audio-src = "E:\fraps\test_002.mp4.aac"
    
    [i] Mux: fps = "test_002.mp4"
    
    [i] Mux: output = 29.97
    
    [E] Error: The audio encoding process has prematurely exited with an error
      code of 1 (00000001). Check the log for possible error messages.
    
    [*] Ending operation.
    
    
    For checking purposes here is also the re-exported profile from your debugging .vdprof profile
    Code:
    {
        "description": "VirtualDub external encoder profile collection",
        "externalEncoders": {
            "sets": {
                "NULL MUX x264 r18 +aac": {
                    "videoEncoder": "V x264 r18",
                    "audioEncoder": "A nero aac q035",
                    "multiplexer": "",
                    "description": "mp4",
                    "extension": "mp4",
                    "processPartial": true,
                    "useOutputAsTemp": true
                },
                "mp4 bat x264 r18 709 +aac (quiet)": {
                    "videoEncoder": "V x264 r18 709 (quiet)",
                    "audioEncoder": "A bat nero aac q035 (quiet)",
                    "multiplexer": "M bat mp4box",
                    "description": "mp4",
                    "extension": "mp4",
                    "processPartial": true,
                    "useOutputAsTemp": false
                }
            },
            "profiles": {
                "A nero aac q035": {
                    "name": "A nero aac q035",
                    "program": "C:\\Program Files (x86)\\VirtualDub\\NeroAAC\\win32\\neroAacEnc.exe",
                    "commandArguments": "-q 0.35 -ignorelength -if - -of \"%(tempaudiofile)\"",
                    "outputFilename": "%(outputname).aac",
                    "type": 1,
                    "inputFormat": 1,
                    "checkReturnCode": true,
                    "logStdout": true,
                    "logStderr": false,
                    "bypassCompression": true,
                    "predeleteOutputFile": true
                },
                "M mp4box": {
                    "name": "M mp4box",
                    "program": "C:\\Program Files (x86)\\GPAC\\MP4Box.exe",
                    "commandArguments": "-quiet -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": "C:\\Program Files (x86)\\VirtualDub\\x264\\x264.exe",
                    "commandArguments": "--quiet --no-progress --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
                },
                "A bat nero aac q035 (quiet)": {
                    "name": "A bat nero aac q035 (quiet)",
                    "program": "C:\\Program Files (x86)\\VirtualDub\\NeroAAC\\win32\\A-nero-aac.bat",
                    "commandArguments": "0.35 \"%(tempaudiofile)\"",
                    "outputFilename": "%(outputname).aac",
                    "type": 1,
                    "inputFormat": 1,
                    "checkReturnCode": true,
                    "logStdout": true,
                    "logStderr": false,
                    "bypassCompression": true,
                    "predeleteOutputFile": true
                },
                "V x264 r18 709 (quiet)": {
                    "name": "V x264 r18 709 (quiet)",
                    "program": "C:\\Program Files (x86)\\VirtualDub\\x264\\x264.exe",
                    "commandArguments": "--quiet --no-progress --crf 18 --preset veryfast --demuxer raw --input-res %(width)x%(height) --fps %(fpsnum)/%(fpsden) --colorprim bt709 --transfer bt709 --colormatrix bt709 -o \"%(tempvideofile)\" -",
                    "outputFilename": "%(outputname).264",
                    "type": 0,
                    "inputFormat": 0,
                    "checkReturnCode": true,
                    "logStdout": true,
                    "logStderr": true,
                    "bypassCompression": false,
                    "predeleteOutputFile": true
                },
                "M bat mp4box": {
                    "name": "M bat mp4box",
                    "program": "C:\\Program Files (x86)\\GPAC\\M-mp4-mp4box.bat",
                    "commandArguments": "\"%(tempvideofile)\" \"%(tempaudiofile)\" \"%(outputname)\" %(fps)",
                    "outputFilename": "",
                    "type": 2,
                    "inputFormat": 0,
                    "checkReturnCode": true,
                    "logStdout": true,
                    "logStderr": true,
                    "bypassCompression": false,
                    "predeleteOutputFile": true
                }
            }
        }
    }
    
    I also tried it a second time this time I removed the quite options from the x264 Encoder:
    Code:
    [*] Beginning dub operation.
    
    [i] Dub: Input (decompression) format is: RGB888.
    
    [i] Dub: Output (compression) format is: YUV420.
    
    [i] AudioEnc: **** AUDIO: NeroAAC ***********
    
    [i] AudioEnc: 21:20:30,97
    
    [i] AudioEnc: E:\fraps>"C:\Program Files
        (x86)\VirtualDub\NeroAAC\win32\neroAacEnc.exe" -q 0.35 -ignorelength -if -
        -of "E:\fraps\test_002.mp4.aac"
    
    [i] AudioEnc: ERROR: could not open AAC encoder
    
    [i] AudioEnc: 21:20:31,01
    
    [i] AudioEnc: USAGE q-factor output-path
    
    [i] AudioEnc: q-factor = 0.35
    
    [i] AudioEnc: output = "E:\fraps\test_002.mp4.aac"
    
    [i] VideoEnc: raw [info]: 1920x1080p 0:0 @ 30000/1001 fps (cfr)
    
    [i] VideoEnc: x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3
        FastShuffle SSE4.2 AVX
    
    [i] VideoEnc: x264 [info]: profile High, level 4.0
    
    [i] VideoEnc: 1 frames: 8.00 fps, 11624.54 kb/s 
    
    [i] VideoEnc:                                                               
    
    [i] VideoEnc: x264 [info]: frame I:1    Avg QP:15.53  size: 48484
    
    [i] VideoEnc: x264 [info]: frame P:1    Avg QP:16.92  size:  796
    
    [i] VideoEnc: x264 [info]: mb I  I16..4: 59.2% 29.1% 11.7%
    
    [i] VideoEnc: x264 [info]: mb P  I16..4:  0.5%  0.0%  0.0%  P16..4:  3.0% 
        0.5%  0.0%  0.0%  0.0%    skip:96.0%
    
    [i] VideoEnc: x264 [info]: 8x8 transform intra:28.9% inter:0.0%
    
    [i] VideoEnc: x264 [info]: coded y,uvDC,uvAC intra: 40.7% 26.6% 8.3% inter:
        0.1% 1.6% 0.0%
    
    [i] VideoEnc: x264 [info]: i16 v,h,dc,p: 69% 18%  8%  4%
    
    [i] VideoEnc: x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 28% 27% 28%  1%  3%
        2%  4%  2%  5%
    
    [i] VideoEnc: x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 27% 16%  4%  4%
        4%  5%  3%  5%
    
    [i] VideoEnc: x264 [info]: i8c dc,h,v,p: 70% 12% 16%  2%
    
    [i] VideoEnc: x264 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
    
    [i] VideoEnc: x264 [info]: kb/s:5907.69
    
    [i] VideoEnc: encoded 2 frames, 15.87 fps, 5907.69 kb/s
    
    [i] Mux: **** MUXING: MP4Box ***********
    
    [i] Mux: MUXER ERROR: BAD OR MISSING ARGUMENT
    
    [i] Mux: USAGE video-src-path audio-src-path fps output-path
    
    [i] Mux: video-src = "E:\fraps\test_002.mp4.264"
    
    [i] Mux: audio-src = "E:\fraps\test_002.mp4.aac"
    
    [i] Mux: fps = "test_002.mp4"
    
    [i] Mux: output = 29.97
    
    [E] Error: Write error occurred on file "<anonymous pipe>": Die Pipe wird
        gerade geschlossen.
    
    [*] Ending operation.
    
     
  2. raffriff

    raffriff Moderator Staff Member Site Contributor

    Thanks for again anticipating my request to remove the quiet options.
    Wow, we get no help at all from Nero besides "could not open AAC encoder" ?? :confused:
    At least now we know the message is coming from NeroAacEnc.exe, not VirtualDub, because of its position between the two timestamps.

    I'll list my current Audio settings in case there is something significant:
    • Full processing mode
    • Interleaving = default
      (enable; preload=500ms; interleave every 1 frame; delay=0)
    • Compression = AC3
      (I know for sure this doesn't matter for external encoding)
    • Advanced filtering = off
    • Conversion=default
      (sample rate=no change; precision=no change (16-bit); channels=no change (stereo))
    I've highlighted two items that may be a problem for you if you have recorded the audio in some other format.
     
  3. Okay thanks for the update most of the settings are identical on my system. Full processing mode was disabled so I enabled it. Further I have no AC3 Option
    so "No compression PCM" is active on my system I also tried it with mp3 as alternative - still getting the error.

    Just to make sure it has nothing to do with the source footage: Here is my FRAPS recording configuration:

    fraps_settings.png

    Could you try recording a short snippet with these sttings and see if it also corrupts your encoding process? I'm thinking it might have sth. to with me having two audio sources (Win7 sound + Microphone).

    The VLC Media information of the raw footage shows the information shown below (29.97fps, 24 Bits RGB, Stereo channels, Bits per sample: 16) - which as far as I can tell complies with out Virtual Dub settings...
    raw_video_properties.png
     
  4. raffriff

    raffriff Moderator Staff Member Site Contributor

    > 192000 Hz
    Aha! Try with your default sample rate set to 48000.

    If that does not work, please get FRAFS Avi Info and post the report.
     
    Thalmor Wizard likes this.
  5. Bull's eye - changing the sampling rate to 48kHz did the trick. Now Virtual Dub converts the raw footage with your "default" fraps.vdprof from the tutorial post!

    Awesome - Thanks again for your time and effort!
     
    raffriff likes this.
  6. raffriff

    raffriff Moderator Staff Member Site Contributor

    You're very welcome! I wish there had been a useful error message, but hey, that's life.
     
  7. I am having trouble grasping this encoding process. Does saving as .avi with your h264 settings fix the quality issues experienced with youtube uploads?
     
    Last edited by a moderator: Mar 2, 2014
  8. raffriff

    raffriff Moderator Staff Member Site Contributor

  9. Guys.

    I found this thread through a series of desperate measures to improve the quality of my YT videos. Big thanks to raffriff for this effort and some others I read including the .avi to mp4 one using VDub.

    I have a couple of questions that hopefully somebody can answer.

    1) is there an updated version of this? I'm really happy with the quality on my last video howerver YT seems to take a long time to process them. That is probably the only drawback.

    I'm mostly wondering if the codecs used are still valid, ie is this particular x264 one still the best choice? I noticed in an earlier thread by the same author that he was advising on x264VFW yet the thread on changing from AVI to MP4 changed that to Xvid? The audio codec choice seems different too.

    2) I'm sort of willing to accept longer rendering times if it means better quality and lower file sizes. How is this best done using the processes discussed here? Would a switch from veryfast to fast help with that?

    Thanks for the help or if anyone can point me to a relevant updated thread I'd be much obliged.
     
  10. ETAdmin

    ETAdmin Administrator Staff Member

  11. Right, thanks for the response.

    I guess I was sort of looking for confirmation either way. I did read that YT can sometimes take a long time depending on load and I have seen this before.

    I'm the owner of AdoredTV gaming and tech channel and up until recently I was happy enough with 30fps and really bad Vegas rendering quality. On my quest to improve video quality I finally ended up here and this amazing thread by raffriff. It's helped me by a huge amount.

    Since I moved up to 60fps the waiting times have increased dramatically though, obviously when waiting on the 60fps (720p and 1080p).

    I would say that the average wait is over 2 hrs though, for a 30 minute 1080p60 video. Possibly closer to 3 hrs.

    I'm not seeing any YT grumbling messages or anything like that, just wondered if their was a "perfect" method to get YT moving asap.

    I guess being at least a day ahead and scheduling is the key to it. ;)
     

Share This Page