HDR Workflow on Mac -- Please Help!

Started by Rick M, June 10, 2013, 03:48:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Rick M

Hello everyone,  I know most of you have moved on to solving a RAW workflow, but I'm back here on HDR trying to figure out how to get this to work on a Mac. I'm trying to use the "User-Friendly Script" here: http://wiki.magiclantern.fm/userguide#hdr_video

I'm an Adobe user, can't really afford GingerHDR, and tested out the Glogger Web Service. I had temporary access to a PC, and ran the user-friendly script on it; it gave awesome results, but unfortunately it was a very slow laptop and took nearly 8 hours to complete ONE shot. I compared the resulting frames to the .mp4 files produced by Glogger, and have found that the frames are of much higher quality and are closer to what I want.

So, I would like help setting up the User-Friendly Script on my Mac. The included PDF mentions setting it up in Wine, but gives no specifics, which really leaves me out in the wind! I Google searched and tried using this page (http://avisynth.org/mediawiki/HOWTO:_AviSynth_video_processing_with_WINE) to install AviSynth and VirtualDub. I had the VirtualDub program open on my computer.

From what I understand next, I took the text from the "main.sh" Shell script, and copied it into the Terminal. Below is what Terminal "said" back:

Richard-McClellands-MacBook-Pro:~ Rick$ #!/bin/bash
Richard-McClellands-MacBook-Pro:~ Rick$
Richard-McClellands-MacBook-Pro:~ Rick$ mkdir frames
mkdir: frames: File exists
Richard-McClellands-MacBook-Pro:~ Rick$ rm frames/*
rm: frames/*: No such file or directory
Richard-McClellands-MacBook-Pro:~ Rick$ rm RAW.MOV.ffindex
rm: RAW.MOV.ffindex: No such file or directory
Richard-McClellands-MacBook-Pro:~ Rick$ wine VirtualDub/VirtualDub.exe scripts\\hdr_split.avs
-bash: wine: command not found
Richard-McClellands-MacBook-Pro:~ Rick$ bash scripts/enfuse_all_frames.sh
bash: scripts/enfuse_all_frames.sh: No such file or directory
Richard-McClellands-MacBook-Pro:~ Rick$ wine VirtualDub/VirtualDub.exe /s scripts\\hdr_join.vcf
-bash: wine: command not found

So to be quite honest, at this point I'm at a loss. I don't quite understand the entire Wine process and how it all works. I've tried searching on here and on Google for more help on how to do this, but really figured it's about time to just ask the experts. If you guys could point me in the direction of a comprehensive resource, or give me some advice, I'd really appreciate it, as the footage looks quite good. I just don't feel like waiting 8 hours on one shot on the slow PC.

I'm willing to start my scratch if need be, whatever is best at this point.

Thank you in advance!

Rick M

Alright, I managed to solve this myself, so for anyone in the future who might be searching for a solution on this, I'll give you what instruction/advice I can.

First of all, read these two articles; they will be your guides:

Learning Command Line: http://www.davidbaumgold.com/tutorials/command-line/

This one will teach you the basics of the Terminal and what not. It's good background info and will help if you run into problems that need solved.

Installing Wine: http://www.davidbaumgold.com/tutorials/wine-mac/#uninstall

This is an article that guides you through installing Wine. Follow it step by step. When you get to the 4th and 5th steps where you need to install AviSynth, use your knowledge of Command Line and the guide to help you use wine to install AviSynth.

Now, here is the part where these written guides will no longer do you much good.

1. Make sure you move the download of the user-friendly version into your "House"; this is the place that's named after your user, with all your default picture, documents, downloads folders, etc. Move them out of the folder you downloaded them from and directly into the House.

2. Open the "main.sh" file in TextEdit. Copy and paste the contents into the Terminal.

3. Now just follow the instructions in the PDF that is included in the download. Play back the movie in VirtualDub, and it will extract and merge all the frames.

If you run into problems while installing the various applications in the Install Wine article, try restarting your computer. I did this when I started getting a lot of messages that said error. And while I wasn't sure what the errors were for, restarting the computer solved these issues.

At one point, I also had to uninstall and reinstall XQuartz. I don't know why I had to, but the program wasn't opening due to some sort of error, and without that program nothing else works. So even after initially downloading it, I had to uninstall it, download it again, and reinstall it.

So yeah, complete the steps above, and follow Luke Neumann's tutorial from my original post, just remember that you have to put everything into your "House" folder, and then press play when VirtualDub opens.

Hope anyone else with this issue is able to figure it out, either on their own or with this set of instructions.

jerrykil

Hey guys,
I really didn't like dealing with wine (why would anyone ever...) so I quickly wrote up this script to do HDR video.

Requirements:
MacPorts, Fink, or Brew (I use brew and recommend it)
You'll need Xcode and command line tools installed. I won't go into details on that since there are instructions included in the above packages.
You'll need to install enfuse and ffmpeg using the above tools. Should be a command like sudo port install enfuse ffmpeg or brew install enfuse ffmpeg or something similar for fink.

Then make a directory and put the script in there. Put your movie in there and rename it to RAW.MOV.
Run the script with bash script.sh or bash <whatever you named it> and sit back. The output will be AC3/x264 in an avi container file called "video.avi". The script overwrites that file so you'll want to move it before doing your next job.


#!/bin/bash
rm -rf audio.mp3
mv video.avi video.`date "+%d.%m.%y-%H.%M"`.avi
rm -rf png1/
rm -rf png2/
rm -rf output/
mkdir png1/
mkdir png2/
set -e
ffmpeg -i RAW.MOV -filter:v select="not(mod(n\,2))",setpts="N/(59.94*TB)" png2/%06d.png
ffmpeg -i RAW.MOV -filter:v select="not(mod(n-1\,2))",setpts="N/(59.94*TB)" png1/%06d.png
mkdir output/
cnt=0;
cd png1/
for f in $(ls *.png); do
    echo $f "(+)" ../png2/${f} "=>" ../merged${f}; 
    #wine ../enfuse/enfuse -o C${f:1} $f ${f:1};
    #enfuse -m 6000 -o ../merged${f} $f ../2/${f};   
      let cnt=cnt+1;
  if [ $cnt -eq 1 ];
    then echo One $f;
    enfuse -m 6000 -o ../output/merged${f} $f ../png2/${f}>>log1&                                 
  fi;
    if [ $cnt -eq 2 ];
    then echo Two $f;
    enfuse -m 6000 -o ../output/merged${f} $f ../png2/${f}>>log2&               
  fi;
    if [ $cnt -eq 3 ];
    then echo Three $f;
    enfuse -m 6000 -o ../output/merged${f} $f ../png2/${f}>>log3&                                   
  fi;
    if [ $cnt -eq 4 ];
    then echo Four $f;
    enfuse -m 6000 -o ../output/merged${f} $f ../png2/${f}>>log4&                                   
  fi;
    if [ $cnt -eq 5 ];
    then echo Five $f;
    enfuse -m 6000 -o ../output/merged${f} $f ../png2/${f}>>log5&                                   
  fi;
      if [ $cnt -eq 6 ];
    then echo Six $f;
    enfuse -m 6000 -o ../output/merged${f} $f ../png2/${f}>>log6&                                   
  fi;
    if [ $cnt -eq 7 ];
    then echo Seven $f;
     enfuse -m 6000 -o ../output/merged${f} $f ../png2/${f}>>log7             
    cnt=0;                         
  fi;
done
ffmpeg -i ../RAW.MOV -vn -ar 44100 -ac 2 -ab 192k -f mp3 ../audio.mp3
ffmpeg  -i ../audio.mp3 -r 29.97 -f image2 -i ../output/merged%06d.png -r 29.97 -acodec ac3 -vcodec mpeg4 -vb 80M  -qp 0 ../video.avi


Since enfuse takes a while to run, I put it into a loop to distribute the load across the "8" cores on my MacBook Pro. It works pretty fast!

The script is in no way complete, but it should give you less headaches than wine and it will definitely work faster. Tweaking is needed, but I don't have the time. As there is an abundance of talent here, I'd love to see what you guys do with it.

ssheridan

I am having trouble even finding a way to install "enfuse" on my Mac.  The command "brew install enfuse" returns "Error: No available formula for enfuse".

Any help here?

egc

Thanks jerrykil, the script works perfectly also under linux  :)

jerrykil

I've put a bit more work into his, if anyone is interested. The info is here: http://www.magiclantern.fm/forum/index.php?topic=8937.new#new
I'm gunna rewrite it after exams so that its more approachable, stay tuned.