vh131ffmpeg for VisualHub FAQ

How do I install vh131ffmpeg?

Download the binary located under Resources on the main page to your desktop. Then extract the zip file. After the extraction you will be left with a folder called Techspansion. Drag it into the /Library/Application Support folder. Make sure to create a backup of your original Techspansion folder.

What are the system requirements for vh131ffmpeg?

vh131ffmpeg is compiled to run on Mac OS X 10.6 or greater. You will also need a copy of VisualHub. The source code changes and a build script have been provided for those who wish to compile the program.

Does VisualHub work with OS X 10.7 "Lion" or OS X 10.8 "Mountain Lion"?

VisualHub works with both OS X 10.7 and OS X 10.8 but you need to use the updater on the Techspansion website. Tyler was kind enough to provide it. Pretty good for an outdated/EOL product. According to Tyler this will be the last update so enjoy Visualhub for a little while longer. Also grab the updated tools (tccat and avimerge). The original tools that came with VisualHub are PowerPC only builds and will not work with OS X 10.7 or OS X 10.8.

How do I install the updated tools?

Download the individual tools located under Resources on the main page to your desktop. Extract the files and then copy the extracted files to the application bundle VisualHub.app/Contents/Resources.

How can I compile vh131ffmpeg?

To compile vh131ffmpeg, you will need a couple of items first. Install the Mac OS X Developer tools for your version of Mac OS X. Then download, compile and install YASM. Once completed, download the build script tarball located under Resources on the main page. Extract the tarball to install the scripts. Open Terminal and change the directory to the extracted folder. Run ./jam. This will download, compile and install the needed 3rd party libraries and create the final vh131ffmpeg binary. The Jamfile can be configured for multiple architectures (i386, x86_64, ppc). See the HOWTO in the tarball for further instructions. The build script was adapted from the contrib Jamfile included with the Handbrake source code.

How do I use ffmpeg presets with VisualHub?

ffmpeg now has the ability to use preset files for storing commonly used encoding parameters. It comes with several x264 and VPX standard presets. I have provided a few xvid presets and additional x264 presets that I adapted from internet posting (see table below). There are two types of presets: standard and tuning. The tuning presets are used in conjuntion with a standard preset. To use the presets, open the Advanced Settings window and type them in the Video "Extra FFmpeg Flags" box:

Using a standard preset:
Example (x264): -vcodec libx264 -vpre medium
Example (Xvid): -vcodec libxvid -vpre fast

Using a tuning preset with a standard preset:
Example (x264): -vcodec libx264 -vpre medium -vpre film
Example (Xvid): -vcodec libxvid -vpre medium -vpre cartoon

Standard Presets

Encoder Preset Example Usage Command Options Used
libxvid slow -vcodec libxvid -vpre slow -me_method full -mbd 2 -trellis 1 -flags +cgop+mv4+aic
libxvid medium -vcodec libxvid -vpre medium -me_method epzs -mbd 2 -flags +cgop+mv4
libxvid fast -vcodec libxvid -vpre fast -bf 0 -me_method log -mbd 0 -flags +cgop
libx264 universal -vcodec libx264 -vpre universal -level 30 -qmin 4 -qmax 69 -g 250 -coder 0 -cmp +chroma -bf 0 -refs 2 -directpred 1 -trellis 0 -me_method umh -subq 6 -me_range 16 -partitions +parti4x4+partp8x8+partb8x8 -flags +loop -keyint_min 25 -qcomp 0.6 -qdiff 4 -flags2 -wpred+mbtree-dct8x8+mixed_refs+fastpskip -sc_threshold 40 -i_qfactor 0.71 -rc_lookahead 40 -wpredp 0 -maxrate 10000000 -bufsize 10000000
libx264 divxplushd -vcodec libx264 -vpre divxplushd -level 40 -qmin 4 -qmax 69 -g 250 -coder 1 -cmp +chroma -bf 2 -refs 2 -directpred 3 -trellis 0 -me_method umh -subq 7 -me_range 16 -partitions +parti4x4+partp8x8+partb8x8 -flags +loop -keyint_min 25 -qcomp 0.6 -qdiff 4 -flags2 +bpyramid+mixed_refs-wpred-dct8x8+fastpskip+mbtree -sc_threshold 40 -i_qfactor 0.71 -rc_lookahead 40 -wpredp 0 -maxrate 25000000 -bufsize 20000000
libx264 highprofile -vcodec libx264 -vpre highprofile -level 41 -qmin 4 -qmax 69 -g 250 -coder 1 -cmp +chroma -bf 3 -refs 3 -directpred 3 -trellis 1 -me_method umh -subq 7 -me_range 16 -partitions +parti8x8+parti4x4+partp8x8+partb8x8 -flags +loop -keyint_min 25 -qcomp 0.6 -qdiff 4 -flags2 +bpyramid+mixed_refs-wpred+dct8x8+fastpskip+mbtree -sc_threshold 40 -i_qfactor 0.71 -rc_lookahead 50 -wpredp 1 -maxrate 40000000 -bufsize 30000000

Tuning Presets

Encoder Preset Example Usage Command Options Used
libxvid film -vcodec libxvid -vpre film -mpeg_quant 1
libxvid cartoon -vcodec libxvid -vpre cartoon -mpeg_quant 0 -flags2 +cartoon
libx264 animation -vcodec libx264 -vpre animation -deblockalpha 1 -deblockbeta 1 -psy_rd 0.4 -aq_strength 0.6
libx264 fastdecode -vcodec libx264 -vpre fastdecode -coder 0 -flags2 -wpred -wpredp 0 -x264opts no-deblock=1
libx264 film -vcodec libx264 -vpre film -deblockalpha -1 -deblockbeta -1 -psy_trellis 0.15
libx264 grain -vcodec libx264 -vpre grain -deblockbeta -2 -psy_trellis 0.25 -aq_strength 0.5 -b_qfactor 1.1 -x264opts no-dct-decimate=1:deadzone-inter=6:deadzone-intra=6 -i_qfactor 1.1 -qcomp 0.8
libx264 psnr -vcodec libx264 -vpre psnr -flags2 -psy -aq_mode 0
libx264 ssim -vcodec libx264 -vpre ssim -flags2 -psy -aq_mode 2
libx264 touhou -vcodec libx264 -vpre touhou -deblockalpha -1 -deblockbeta -1 -aq_strength 1.3 -psy_trellis 0.2 -partitions +partp4x4
libx264 zerolatency -vcodec libx264 -vpre zerolatency -bf 0 -flags2 -mbtree -rc_lookahead 0 -x264opts sync-lookahead=0:sliced-threads=1

In what order are the presets searched?

Presets are searched in the following order:

  1. ~/.visualhub (home folder)
  2. environment variable VISUALHUB_DATA
  3. /Library/Application Support/Techspansion/vhpresets
The standard presets are located in the folder /Library/Application Support/Techspansion/vhpresets.

Do you have a setting that you use to create MP4 videos?

I have included a x264 ffpreset called universal. I adapted this preset from Handbrake's "Apple Universal" preset. This ffpreset is designed to allow videos to run on a bunch of devices.

Example: -vcodec libx264 -crf 20 -vpre universal -vpre film

How do I encode videos that have variable frame rate?

By default, variable frame rate detection is turned off because the play_title command used to play DVD VIDEO_TS folders can cause ffmpeg to incorrectly determine the frame rate during the encoding process. To enable, open the Advanced Settings window and type the following command in the Video "Extra FFmpeg Flags" box:

Example: -vsync 2
Note: If you are using MKV files generated by MakeMKV from VIDEO_TS folders you will want to enable this setting, otherwise videos will use 29.97 as the frame rate.

Can I use tccat instead of play_title to read DVD/VIDEO_TS folders?

VisualHub comes with two different programs that can be used to read DVD/VIDEO_TS folders: play_title (default) and tccat. To change the program used to read DVDs, open the terminal application and use the following command:

defaults write com.techspansion.visualhub dvdpipe tccat
To restore the default back to play_title:
defaults write com.techspansion.visualhub dvdpipe play_title

Can I use variable bit rate encoding with x264 and Xvid?

Variable bit rate encoding can be enabled for both encoders. For x264, use -crf and for Xvid, use -qscale. Open the Advanced Settings window and type the command in the Video "Extra FFmpeg Flags" box:

Example (x264): -vcodec libx264 -crf 20
Example (Xvid): -vcodec libxvid -qscale 5

Does the Xvid encoder support more than one thread?

The Xvid encoder supports both threads and slices as of version 1.3. By default VisualHub only tells ffmpeg to use one thread. Open the Advanced Settings window and type the following command into the Video "Extra FFmpeg Flags" box:

Example (dual core mac): -threads 2 -vcodec libxvid -vpre medium
Example (quad core mac): -threads 4 -vcodec libxvid -vpre slow
Example (two proc/quad): -threads 8 -vcodec libxvid -vpre fast

How can I brighten up my x264 encodes?

There are a few topics on the internet that describe the problem. Basically videos encoded with the x264 encoder look washed out when played on a Mac using QuickTime Player. The fix is to either add a color space tag or write the color space information direcly to the video stream. I have added a new ffmpeg option -colr that does both. This option allows you to specify the color space for a encoded video: none (do not write tag), bt601 (standard video) or bt701 (high definition video). It will only work for videos using the MP4 format or videos encoded with libx264. To use the option, type the following command in the Video "Extra FFmpeg Flags" box:

Example (for most DVDs): -colr bt601
Exmaple (for most Blu-Rays): -colr bt709

How can I use the VisualOn AAC encoder instead of FAAC?

The AAC encoder is based on a codec implementation by VisualOn as part of the Stagefright framework from the Google Android project. The encoder can encode audio at a higher bit rate than FAAC which is limited to 160kb. To use it, open the Advanced Settings window and type the following command in the Audio "Extra FFmpeg Flags" box:

Example: -acodec libvo_aacenc
NOTE: Due to the way ffmpeg scans encoder codecs, the output log will show the wrong AAC encoder (libfaac) selected. This a design bug in ffmpeg and it does not affect the actual encoder used.

Is there a way to increase the sound volume for a encoded video?

Use the command -vol to increase the volume on an encode. The default value is set to 256. I suggest that you increase the value by 128 each time to see what volume works best for the encoded material. Open the Advanced Settings window and type the following command into the Audio "Extra FFmpeg Flags" box:

Example: -vol 384

Why am I getting strange block artifacts when converting DVDs?

VisualHub does not include DVD decryption software. Use a DVD ripper to rip the DVD to a local folder or to a MKV file on your computer. There are several Mac DVD rippers available: Mac The Ripper, DVDFab HD Decrypter, MakeMKV, RipIt and Fairmount.

Why do some MV4/MOV videos fail to convert?

The problem occurs with MV4/MOV videos that are processed by QuickTime using the movtoy4m and ffmpeg's yuv4mpegpipe commands. During the conversion, VisualHub will immediately display an error message such as "Stream #1.0 -> #0.1" and the log will not show any conversion activity. This is due to ffmpeg terminating with a SEGFAULT error. The issue seems to only affect videos that are cropped incorrectly by VisualHub. There are a few work-arounds that can be used:

  1. Change the crop settings manually in the Advanced Settings window
  2. Change the "Start at" time in the preview window to select another frame to crop
  3. Choose a different "Optimize for" setting
  4. Check "Force:" and select "FFmpeg Decoding" in the Advance Settings window.

When converting a video file to DVD, why do I get the error "too many threads"?

VisualHub incorrectly determine the number of threads needed on certain Macs. To fix the error, open the Advanced Settings window and type in the number of threads explicitly in the Video "Extra FFmpeg Flags" box. You may have to experiment with the number. Start with the total amount of cores and then work your way back to the total number of physical processors:

Example (4 proc/6 core): -threads 24
Example (4 proc/6 core): -threads 6
Example (4 proc/6 core): -threads 4
Example (worst case): -threads 1

When I encode a video file to DVD, why is the aspect ratio wrong?

VisualHub computes the aspect ratio for widescreen videos as 2.22 (720x384). If you would like an aspect ratio closer to the original video, this can be fixed manually through the Advanced Settings window. First you will need the aspect ratio of the video that you are encoding. Second, use the following table as a guideline for configuring the proper Video settings. If the video does not have any black bars or you want to keep them, I suggest setting the crop to (0, 0, 0, 0).

Why can't I burn my DVD directly from VisualHub?

The "Burn When Done" option does not work under Mac OS X 10.6 or greater due to an AppleScript change in the OS. Uncheck the option and burn the DVD ISO image created by VisualHub using Disk Utility.

Why doesn't the Info window show information for DVDs and VIDEO_TS folders?

This error is most likely due to an AppleScript change in Mac OS X. In Mac OS X 10.5 the Info panel will show garbled output and in Mac OS X 10.6 there is no output.