README 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. UberZach Video Tools
  2. Copyright 2009-2014, Zach Kotlarek <zach@kotlarek.com>
  3. ======================================================
  4. The following readme applies primarily to the encode.pl script, formerly released as the Handbrake CLI Helper project.
  5. Additional documentation may follow as I have time/interest.
  6. ======================================================
  7. Encode.pl is a fairly simple script intended to assist in automation of HandBrake-based encoding workflows.
  8. It is designed to automatically select appropriate HandBrake settings to produce output that:
  9. Copies all English (or unspecified) audio tracks unmodified
  10. Downmixes the "best" audio track to AAC-2.0 w/Dolby Pro Logic II encoding
  11. Copies all subtitle tracks, except languages that are explicitly excluded
  12. Includes external SRT files in the same folder and with the same name
  13. Autocrops video, but overrides autocrop when it makes obviously wrong choices
  14. Invokes the detelecine and decomb filters in the default mode (i.e. auto-detect)
  15. The script can handle both single-title and multi-title video sources, and for multi-title sources can encode all
  16. titles or a specific, selected title.
  17. Both MKV and M4V wrapper formats are supported. M4V is prefered unless DTS audio is selected, in which case only
  18. MKV can be used. Use of MKV can be forced by invoking the script with an output file name ending in .mkv
  19. Many of the options above can be selected at runtime via enviromental variables. Read the source for usage --
  20. they are all defined at the top of the script.
  21. #==========================
  22. # Usage
  23. #==========================
  24. Usage is simple:
  25. encode.pl input_file [output_file] [title_number]
  26. The input file path is obviously required.
  27. The output file path can be provided, but a default based on the input file path will be automatically selected if
  28. necessary.
  29. The title number is only useful for multi-title sources, like TS_VIDEO folders or DVD ISOs. If provided the title
  30. number should match whatever number HandBrake shows for the title you want to encode. You can also use the title
  31. number "main" to select the longest title in the source.
  32. If you want to see what's actually happening, set the DEBUG enviornmental variable to something non-zero, like this:
  33. DEBUG=1 encode.pl <input_file>
  34. The script will then provide details about its decisions, and will also copy all output from HandBrake so you can
  35. see what it is doing. By default the script suppresses most HandBrake output to support use in automation systems.
  36. #==========================
  37. # Configuration
  38. #==========================
  39. You will need to tell the script where the HandBrakeCLI binary lives. Do that by adjusting the HB_EXEC parameter
  40. at the top of the script. The default is:
  41. ~/bin/video/HandBrakeCLI
  42. You can adjust a number of other parameters, including the default parameter string for HandBrake, the video
  43. encoding quality for both HD and SD sources, the cutoff point for what is considered an HD source, the prefered
  44. output format, and a of other more technical parameters. If you don't know what they mean you probably don't need
  45. to change them.