Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add aac_at for aac codec selection #259

Closed
alpha-0 opened this issue Sep 12, 2021 · 8 comments
Closed

Add aac_at for aac codec selection #259

alpha-0 opened this issue Sep 12, 2021 · 8 comments

Comments

@alpha-0
Copy link

alpha-0 commented Sep 12, 2021

I found no way to change the audio conversion to aac_at instead of aac (vbr).
I had tried adding line(- aac_at) on sane_audio_selection section of the config file but it couldn't help.

I want to encode a quicktime compatible mp4 file and I already change the output file extension to mp4. But I found the default aac (vbr) is incompatible with quicktime player on mac, making that the quick look(preview) in finder.app couldn't play the video and only show an icon instead.

@alpha-0 alpha-0 changed the title Add aac_at, aac_fixed for aac codec selection Add aac_at for aac codec selection Sep 12, 2021
@cdgriffith
Copy link
Owner

Odd that adding it to the sane audio didn't work. You could try disabling it for now to see if it shows up in the full list (File > Settings > Uncheck "Use Sane Audio Selection") and see if it shows up.

If not, it probably doesn't appear when using the command ffmpeg -hide_banner -encoders try running:

ffmpeg -hide_banner -encoders | grep aac

And see if it's listed as an option.

@alpha-0
Copy link
Author

alpha-0 commented Sep 12, 2021

Thank you for your reply!

I had tried uncheck "Use Sane Audio Selection" but still no aac_at option there.

The below is the output of the command "ffmpeg -hide_banner -encoders | grep aac"
A..... aac AAC (Advanced Audio Coding)
A..... aac_at aac (AudioToolbox) (codec aac)
They both share the same name "aac".

@cdgriffith
Copy link
Owner

Thank you for the output. And that is so weird, the logic is encoders.append(line.strip().split(" ")[1]) aka it splits on the spaces and grabs the second object, which should be acc and acc_at in that example case.

Just making double sure, you don't happen to have multiple ffmpeg versions? aka make sure the full path in File > Settings is the same as what you get if you run which ffmpeg on the command line.

@alpha-0
Copy link
Author

alpha-0 commented Sep 12, 2021

I had retried using the full path of ffmpeg as the same one in the setting. And I got the same output.
I try to paste the output here again with space character replaced with   so the spaces wouldn't be trimmed.
 A..... aac                  AAC (Advanced Audio Coding)
 A..... aac_at               aac (AudioToolbox) (codec aac)

@alpha-0
Copy link
Author

alpha-0 commented Sep 13, 2021

Is leading space matter for the logic encoders.append(line.strip().split(" ")[1])?
I tried string.split(" ") in some python code with my output and got aac_at at element 2 instead of element 1.
Then I removed the separater argument, i.e. string.split() and got aac_at at element 1.
The leading space of line was skipped and multiple spaces were counted as single separator.

separator - Optional. Specifies the separator to use when splitting the string. By default any whitespace is a separator.

@alpha-0
Copy link
Author

alpha-0 commented Sep 13, 2021

I am sure the original logic encoders.append(line.strip().split(" ")[1]) works.

And then I found out a temporary solution by modifying
self.widgets.convert_to.addItems(sorted(set(self.available_audio_encoders) & set(codec_list)))
to
self.widgets.convert_to.addItems(sorted(set(self.available_audio_encoders) | set(codec_list)))
in widgets/panels/audio_panel.py.

But I don't know how to fix the problem along both list of encoders and list of codecs yet.

@cdgriffith
Copy link
Owner

Thank you for looking into this more. I completely forgot that each encoder has a list of audio codec formats it's known to support. i.e. https://github.com/cdgriffith/FastFlix/blob/master/fastflix/encoders/hevc_x265/main.py#L19

I will look at simply nixxing that, as the "sane" audio list has been added anyways, and if people want something else they should be able to try anything without this trying to keep track of new audio codecs being added / platform specific ones.

cdgriffith added a commit that referenced this issue Sep 24, 2021
cdgriffith added a commit that referenced this issue Sep 25, 2021
* Adding #237 zoom option for thumbnail (thanks to Lev Abashkin)
* Adding support for ENV variables - FF_CONFIG, FF_LANG, FF_HDR10PLUS, FF_WORKDIR
* Fixing FastFlix could not start if setting profile could not find x265 encoder
* Fixing that downloading latest FFmpeg can fail to extract files if previous ones exist (thanks to ProFire)
* Fixing that VCEEncC needs to use nnedi filter for deinterlacing (thanks to Onyx)
* Removing #259 audio limitations (thanks to alpha-0)
@cdgriffith
Copy link
Owner

In latest 4.4.0 should allow you to now use any audio encoder FFmpeg has available if you don't have "sane audio" selected :)

There will be cases where the container used (mp4 / mkv / webm) may not usually support the type of audio used and need to add -strict -2 to the custom ffmpeg options to squeeze it in. (Not usually a good idea as not much will play it, but possible.)

If this doesn't fix it for you, let me know and can re-open!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants