From Vegas to HandBrake


VidMus wrote on 8/27/2014, 6:41 PM

Thanks much for all the work you did! I do see great future possibilities for this workflow.

I removed the problem loop and put a 'timeout /t 420' in place of it. I had another switch in there to prevent a halt from keyboard actions but I forgot the wording of it while I am typing this. I am not on the editing system while I type this.

Takes approx. 6 minutes to render the *.AVI file from this BIG 2 hour plus project with 12 nested projects.

I did this as a test workaround.

Even if this did work, I am not fond of it writing to my C: SSD drive so I will stick to the old way for now.

Grazie wrote on 8/28/2014, 2:23 AM
@Marco: My responses.....

But what about if you needn't get that folder opened automatically while you still would use a fixed destination folder for your HandBrake renders?I don't understand. Please explain . . .

Then you could open that folder (with fixed path) inside Vegas Pro via scripting and here again via a clickable icon in the toobar.Another "clickable", sure, it would be some type of solution, but the process is starting to get a wee bit "lumpy", and run the risk of loosing the ease with which the original process has become.

How about within HB that its Destination Folder was displayed? This means I could rummage about in that Folder for the file I'd just processed?



Marco. wrote on 8/28/2014, 3:36 AM
"How about within HB that its Destination Folder was displayed?"

Do you mean displaying the name of the path or opening the folder?

The name actually is displayed. Once the video is scanned from HandBrake you will see the path mentioned in the Picture tab.

Opening the folder is that very thing I'd wish HandBrake would offer. As it doesn't – no chance to get this done via batching either.
Grazie wrote on 8/28/2014, 4:42 AM

There has to be a better solution. Sure, maybe not from you.


Marco. wrote on 8/28/2014, 6:08 AM
Let me be curious: Why is this such important for you? If you would render from within Vegas Pro (say to MainConcept AVC) you neither have a choice to let the destination folder opened automatically, do you? You first define your destination, then you know where to look for the file.

So you just look for a workflow different (and better) than that one we got used to over the years?
Grazie wrote on 8/28/2014, 6:17 AM

At the end of the Vegas Render, I get the opportunity to Open Folder. That's all.


Marco. wrote on 8/28/2014, 6:40 AM
You are right, I almost forgot this option. I fear it's up to the HandBrake developers to add such an option into HandBrake.

Or maybe somebody else knows about a way to automatically analyze the render path HandBrake uses and write this info into a buffer (like the clipboard) from where a simple CMD process could read and use the info?
VidMus wrote on 8/30/2014, 1:16 PM
I tried this using only spinner drives and it still does not work. I was using build 310. If I use the latest build it will work only if I use the ‘timeout /t 60’. The 60 part is changed according to how long it needs to wait.

Problem with the latest build is, if I render to mpeg-2 for DVD, DVDA 6 will not recognize the chapter markers. I do not know about the earlier versions of DVDA. This problem does not happen with build 310. A bug in the latest build?

If I convert my videos to another format and then try it, the Vegas to HandBrake will work fine. This method of Vegas to HandBrake is apparently not compatible with my video files.

I assume you are using the ‘pings’ to create short delays to correct for timing? I read somewhere that this does not always work. If not on my system then maybe that is part of the problem?
If so on the delays, how long do you expect each delay to be? Maybe I can replace those with the timeout instead?

But then if the frameserver is not compatible with my videos it may not matter.

So anyway, it looks like the old way for me for now.

This makes me sad because I really wanted this to work.

So now what?

Byron K wrote on 8/31/2014, 6:22 PM
Found another little quirk:
PC MUST have an active network connection. If the NIC is disconnected Framserver hangs at the CMD screen.

I shut down my router to save energy while rendering and couldn't get Frameserver / Handbrake to work. It was hung on the CMD screen, just flashing.
VidMus wrote on 8/31/2014, 6:37 PM
"PC MUST have an active network connection."

Like most NLE systems mine is not connected to a network or the internet. On one hand that might be why I have problems but then on the other hand, why only certain types of video files?

I wish those who can, would help with this including finding a way to get this off the c:\ drive.

Great possibilities here for online AND DVD workflows!

VidMus wrote on 8/31/2014, 9:21 PM
Well, I connected my NLE system to the internet and now it finally works. The 'ping' delays are also there.

My concerns is that this requires a connection to the network and thus the internet which might cause unwanted updates that can cause big problems on my system. There are plenty of threads on that subject.

Is there anyway to make this work without the internet/network connection?

A way to make it work with the network but with no internet?

While rendering is a bit slow, the results are fantastic!!!

VidMus wrote on 9/1/2014, 12:31 AM
I got rid of the pings for delay and can now run it just fine WITHOUT THE INTERNET OR NETWORK!!!

The following is the updated batch file that now works for me. The 'nobreak' prevents the keyboard from stopping it. The 'timeout' works much better than the 'ping' and does not have to mess with the network.


timeout /t 2 /nobreak
start "" "C:\frameserver\batch\enter.exe"
timeout /t 2 /nobreak
for /f %%i in ("C:\frameserver\source\vegas.avi") do if %%~zi gtr 160000 goto checkframeserver
timeout /t 2 /nobreak
goto vegasavi
for %%F in ("C:\frameserver\source\vegas.avi") do set filesize1=%%~zF
timeout /t 2 /nobreak
for %%F in ("C:\frameserver\source\vegas.avi") do set filesize2=%%~zF
if %filesize2% gtr %filesize1% goto checkframeserver
pfm register C:\frameserver\avfs.dll
timeout /t 2 /nobreak
pfm mount C:\frameserver\vegas.avs
timeout /t 2 /nobreak
for /f %%i in ("C:\frameserver\vegas.avs\vegas.avi") do if %%~zi gtr 160000 goto hbstart
timeout /t 2 /nobreak
goto handbrake
start handbrake "C:\frameserver\vegas.avs\vegas.avi"
timeout /t 2 /nobreak
tasklist | findstr /i "Handbrake.exe"
if %errorlevel%==0 goto stop
goto waitforhandbrake
start "" "C:\frameserver\batch\stop_render.exe"

Marco. wrote on 9/1/2014, 6:14 AM
With such kind of simplified batch workflow there is no way to give a choice to individually define installation, process and render pathes. This would need a completely different kind of coding (which I can't offer). So the only way is to use a path which is most likely existing on every Vegas Pro system: C:\.

Of course one could modify the files to any path desired but this would need to modify almost every file involved: startvegas2handbrake.bat, unmount.bat, vegas.avs, send2handbrake.js, unmount.js and stop_render.exe (you need AutoIt to modify the stop_render.exe file).
Don't know how much sense this makes. I'm aware the Vegas2HandBrake workflow is far from perfect. It's just a sharing of a personal handicraft work.

I wasn't aware certain network conditions could break the process. Here it works with or without a network connection (both WiFi turnded on or off). So I am very glad you found a way which makes it working even for the cases I couldn't repro on my systems. I'm pretty sure with my limited knowledge I would not have found this way. I will give the modified version some tries and will offer it via the website then (if you don't mind).
VidMus wrote on 9/1/2014, 8:33 AM
"I will give the modified version some tries and will offer it via the website then (if you don't mind)."

I don't mind at all.

Note: This is for a system with SSD to SSD. I have no idea if it will work on a spinner drive system especially with slow spinners. It might work great but if it does not then it is up to those who try it to maybe tweak the timer a bit if needed. It is currently set for 2 seconds.

Marco. wrote on 9/1/2014, 9:51 AM
I think I then would offer both versions.
Byron K wrote on 9/1/2014, 2:11 PM
I was curious what was edited so did a file compare using Notepad++ (must install the compare plugin)

-Lines on the left w/ the red minus (-) are what was removed from the original batch file.
-Lines on the right w/ the green plus (+) are what was added to VidMus' batch file.

Again thanks Marco for sharing this, It has saved me tons of time on my most recent project rendering six 10-15 minute videos which take about 2-3 hours each just for the proxy plus 10-15 minute Handbrake to final .mp4 now takes about 1.5 hours each... Huge time saver. And now w/ Vidmus' hack, I may be able to even save more electricity by literally cutting my render time in half and being able to turn off my router and internet modem during rendering! ((:
Marco. wrote on 9/2/2014, 7:54 AM
Vidmus, I now had the time to see what exactly your updated version of the batch file does better and if it works on my systems. And yes – it works pretty fine (tested with Vegas Pro 12 and 13 on Windows 7 and 8.1) and I see both modifications you made implied smart improvements. I also updated the "unmount.bat" file same way and will update the website's download file asap.

Thanks for your valuable input!
Rv6tc wrote on 9/11/2014, 2:02 PM
Sorry for revising this thread, but I just got around to doing this.

I"m able to frameserve ok, but I keep getting this error. I've checked that all the folders and files are where they should be, but I don't know where to troubleshoot further.

What am I missing?



Tom Pauncz wrote on 9/11/2014, 2:29 PM
Can you please tell us which files have been updated on your website?
Marco. wrote on 9/11/2014, 4:31 PM
None yet. Didn't have the time to do yet.
VidMus wrote on 9/15/2014, 11:12 PM
Marco. said, "Thanks for your valuable input!"

You are most welcome.

As a positive side affect, this works great with mixed videos from interlaced and progressive sources. It will de-interlace interlaced videos and leave the progressive ones alone. So there is no need to do extra steps de-interlacing the interlaced videos before use in the project and/or rendering.

I have made tests confirming this.

So I can use my old cx110 for minor videos and the other cams for the main videos and mix them without any problems.

I love it when a workflow such as this yields a helpful bonus!

Yep wrote on 9/28/2015, 7:13 PM
Hi Marco,

Just finished setting up your Vegas-2-Handbrake workflow and it works very nicely indeed. Many thanks for your hard work on this.

I'm just wondering if there is a way I could use other AviSynth scripts with your workflow. For instance I have a script that I use to create slow motion video using Debugmode Frameserver and VirtuaDub. While it produces excellent results the problems are that output is restricted to .avi and rendering times in VirtualDub are extremely slow. I'd like to try using that script in your workflow with Handbrake.

Advice or comments would be very much appreciated.
wwaag wrote on 9/28/2015, 10:08 PM

I'm not Marco, but the quick answer is "yes you can". In the C:\frameserver folder, there is an avisynth script entitled "vegas.avs". This can easily be modified to pretty much whatever you like. For example, I have one version to reduce fisheye for GoPro footage using the Avisynth defish filter. Works OK. In any case, give it a try.


AKA the HappyOtter at System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

Yep wrote on 9/29/2015, 1:03 AM

OK. Thanks for that. I'll play around with that and see what happens.