question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Avoid processing of existing AAC audio?

See original GitHub issue

I got some content that already has an AAC audiotrack:

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : HE-AAC / LC
Codec ID                                 : A_AAC
Duration                                 : 1h 0mn
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz / 24.0 KHz
Compression mode                         : Lossy
Delay relative to video                 : 31ms
Title                                    : http://pahe.in
Language                                 : English
Default                                  : No
Forced                                   : No

But MP4 automator decides to convert it anyway to this:

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 1h 0mn
Bit rate mode                            : Constant
Bit rate                                 : 256 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Delay relative to video                  : -1s 335ms
Stream size                              : 110 MiB (20%)
Language                                 : English

Not only does this take time (and I’m fairly sure it’s not nessesary?) but it also increases the size of the video by almost 100 MB in this case (472MB -> 565MB). Can I avoid this?

This is my autoprocess.ini:

[MP4]
ffmpeg = /usr/local/bin/ffmpeg
ffprobe = /usr/local/bin/ffprobe
threads = 4
output_directory =
copy_to =
move_to =
output_extension = mp4
output_format = mp4
delete_original = True
relocate_moov = True
video-codec = h264,x264,hevc,h265,x265,HEVC,mpeg4,MPEG-4,MPEG-H,h.265,h.264
video-bitrate =
video-max-width =
h264-max-level =
use-qsv-decoder-with-encoder = True
ios-audio = libfdk_aac
ios-first-track-only = False
max-audio-channels =
audio-codec = ac3
audio-language = eng,dan
audio-default-language = eng
audio-channel-bitrate = 256
subtitle-codec = srt
subtitle-language = eng
subtitle-default-language = eng
subtitle-encoding =
fullpathguess = True
convert-mp4 = False
tagfile = True
tag-language = en
download-artwork = False
download-subs = False
embed-subs = True
sub-providers = addic7ed,podnapisi,thesubdb,opensubtitles
permissions = 0777
post-process = False
pix-fmt =

It works fine for creating two tracks, an AAC stereo and AC3 5.1 incase I download something with DTS or so, but for everything else, I’d love if it just left it alone.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:21 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mdhigginscommented, Jul 27, 2016

As far as the issue with the subtitles go, you can try playing around with the subtitle-encoding option in autoProcess.ini and see if that makes a difference See here: https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/subtitle_options#Set_Subtitles_Character_Encoding_Conversion

I’d recommend trying utf-8

For your next question: That behavior is exactly what you’d expect given your source file Your source file had 3 audio tracks, a stereo english AAC track, a mono english AC3 track (probably director commentary), and a mono french AC3 track

The french track was discarded, the stereo AAC track preserved and copied, and the AC3 track converted to AAC because it is less than or equal to 2 channels Nothing wrong there

1reaction
mdhigginscommented, Jul 23, 2016

This error looks like its coming from the fact that the iOS audio option is enabled but using a custom encoder other than just the plain AAC option

Your stereo audio channels with that option enabled fall under that algorithm and then when analyzing the codecs it thinks aac and libfdk_aac are different, so it converts again

I just pushed an update to address this and make the iOS-audio option behave like the other codec options to avoid the issue you’re having here

Update the script and update your auto process.ini to look like this:

ios-audio = libfdk_aac, aac

And you should be fixed

Now any codecs in that list will be white-listed and copy directly instead of converting, and anything thats not in that list will use the first codec (in this case libfdk_aac)

On Jul 23, 2016, at 1:40 PM, kocane notifications@github.com wrote:

I got some content that already has an AAC audiotrack:

Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : HE-AAC / LC Codec ID : A_AAC Duration : 1h 0mn Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz / 24.0 KHz Compression mode : Lossy Delay relative to video : 31ms Title : http://pahe.in Language : English Default : No Forced : No But MP4 automator decides to convert it anyway to this:

Audio ID : 2 Format : AAC Format/Info : Advanced Audio Codec Format profile : LC Codec ID : 40 Duration : 1h 0mn Bit rate mode : Constant Bit rate : 256 Kbps Channel(s) : 2 channels Channel positions : Front: L R Sampling rate : 48.0 KHz Compression mode : Lossy Delay relative to video : -1s 335ms Stream size : 110 MiB (20%) Language : English Not only does this take time (and I’m fairly sure it’s not nessesary?) but it also increases the size of the video by almost 100 MB in this case (472MB -> 565MB). Can I avoid this?

This is my autoprocess.ini:

[MP4] ffmpeg = /usr/local/bin/ffmpeg ffprobe = /usr/local/bin/ffprobe threads = 4 output_directory = copy_to = move_to = output_extension = mp4 output_format = mp4 delete_original = True relocate_moov = True video-codec = h264,x264,hevc,h265,x265,HEVC,mpeg4,MPEG-4,MPEG-H,h.265,h.264 video-bitrate = video-max-width = h264-max-level = use-qsv-decoder-with-encoder = True ios-audio = libfdk_aac ios-first-track-only = False max-audio-channels = audio-codec = ac3 audio-language = eng,dan audio-default-language = eng audio-channel-bitrate = 256 subtitle-codec = srt subtitle-language = eng subtitle-default-language = eng subtitle-encoding = fullpathguess = True convert-mp4 = False tagfile = True tag-language = en download-artwork = False download-subs = False embed-subs = True sub-providers = addic7ed,podnapisi,thesubdb,opensubtitles permissions = 0777 post-process = False pix-fmt = It works fine for creating two tracks, an AAC stereo and AC3 5.1 incase I download something with DTS or so, but for everything else, I’d love if it just left it alone.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mdhiggins/sickbeard_mp4_automator/issues/516, or mute the thread https://github.com/notifications/unsubscribe-auth/ADcO6rdW0W4ZSHLv5H4N_8Qf4MWBJ9Loks5qYlIjgaJpZM4JTZ5k.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Advanced Audio Coding - Wikipedia
Advanced Audio Coding (AAC) is an audio coding standard for lossy digital audio compression. Designed to be the successor of the MP3 format,...
Read more >
AAC Bluetooth codec only acceptable on Apple phones
The ultimate guide to Bluetooth headphones: AAC only acceptable on Apple phones ... AAC is one of the most commonly supported Bluetooth codecs...
Read more >
Container for existing raw aac files? - HydrogenAudio
Purpose: Configures mp4box to package raw aac audio into m4a file ... it messes with the audio in the process which I would...
Read more >
AAC Double Compression Audio Detection Algorithm Based ...
In this algorithm, the default AAC compressed audio has the following two types: (1) low-bit-rate transcoding to high-bit-rate AAC audio, which is often ......
Read more >
Does AAC Prevent Speech Development? [with research ...
The current research and our own clinical experience has suggested that AAC will not stop a person from speaking.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found