Behavior of audio fallback encoder param has changed in v1.0

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
neilfairall
Posts: 2
Joined: Tue Dec 27, 2016 3:59 pm

Behavior of audio fallback encoder param has changed in v1.0

Post by neilfairall »

The host is Windows Server 2012 R2.

In the last-but-one (before 1.0) version of handbrakecli, I used the following parameters in a batch file with the intent of:

a. Copying AC3 and/or AAC streams if they existed
b. Creating AC3 and/or AAC streams if they did not via fallback.

I used these parameters:

Code: Select all

-E copy:aac,copy:ac3 --audio-fallback av_aac,ac3
This appeared to work just fine. With version 1.0 of the CLI, the result is as follows:

Code: Select all

Input #0, matroska,webm, from 'sample.mkv':
  Duration: 00:23:34.62, start: 0.000000, bitrate: N/A
    Stream #0:0(eng): Video: h264 (High)
      yuv420p, 1280x720, PAR 1:1 DAR 16:9
      23.98 fps, 1k tbn
    Stream #0:1: Audio: ac3
      48000 Hz, 5.1, fltp, 448 kb/s (default)
[21:06:21] scan: decoding previews for title 1
[21:06:21] scan: audio 0x1: ac3, rate=48000Hz, bitrate=448000 Unknown (AC3) (5.1 ch)
Scanning title 1 of 1, preview 9, 90.00 %[21:06:22] scan: 10 previews, 1280x720, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[21:06:22] scan: supported video decoders: avcodec qsv
[21:06:22] libhb: scan thread found 1 valid title(s)
+ Using preset: CLI Default
+ title 1:
  + stream: sample.mkv
  + duration: 00:23:34
  + size: 1280x720, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 0/0/0/0
  + support opencl: no
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:23:34
  + audio tracks:
    + 1, Unknown (AC3) (5.1 ch) (iso639-2: und), 48000Hz, 448000bps
  + subtitle tracks:
ERROR: Invalid fallback audio codec (av_aac,ac3)
Failed to initialize job

HandBrake has exited.
What changed?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: Behavior of audio fallback encoder param has changed in v1.0

Post by JohnAStebbins »

neilfairall wrote:What changed?
Better error handling. Your command line is (and always has been) broken. --audio-fallback is meant to be used in conjunction with -E copy only. It has no effect with -E copy:aac etc. And it does not take a list of fallbacks, it is a single codec that will be used when "copy" is not possible.

When using -E copy:aac or copy:ac3, it automaticlly falls back to the "right" encoder for the type of audio you are attempting to copy. So if you asked it to copy:aac and the source track is not aac, it will transcode to aac. And if you ask it to copy:ac3 and the source track is not ac3, it will transcode to ac3.

To summarize
copy - passthrough the audio track if possible, use the (singluar) fallback encoder if not possible
copy:aac passthrough the audio track if the source audio is aac, transcode to aac if not
neilfairall
Posts: 2
Joined: Tue Dec 27, 2016 3:59 pm

Re: Behavior of audio fallback encoder param has changed in v1.0

Post by neilfairall »

That makes sense, thank you!
Post Reply