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

Support fdk-aac instead of faac #117

Open
Eonfge opened this issue May 30, 2020 · 7 comments
Open

Support fdk-aac instead of faac #117

Eonfge opened this issue May 30, 2020 · 7 comments
Labels

Comments

@Eonfge
Copy link
Contributor

Eonfge commented May 30, 2020

Currently, Flacon only supports faac. This is a shame since it's a really shitty implementation of the .m4a music format.

details:

I would therefore ask you to change the supported aac encoder from faac do fdk-aac. See also the details on the listening test listed above.

I already use it for ripping CD's in Asunder and it provides significant quality improvements. You could optionally support both, but I would recommend you to always pick fdk-aac if available.

Here the Asunder manifest that uses fdk-aac instead of faac:
https://github.com/flathub/ca.littlesvr.asunder/blob/master/ca.littlesvr.asunder.yaml

@SokoloffA
Copy link
Member

Unfortunately we can't completely give up faac, I haven't found the fdk-aac package in Debian and Ubuntu.

But I will add fdk-aac support. I would be very grateful if you could help me with settings and command line options for fdk-aac.

Now AAC preferences page has 3 controls:

  • CheckBox "Use quality setting (recommended)"
  • Slider "Quality"
  • Combobox "Bitrate"

If "Use quality" is checked, the user can change "Quality" slider between 10 (lowest) and 500 (highest).
If "Use quality" is unchecked, the user can choose the bitrate from (64, 80, 128, 160, 192, 224, 256, 288, 320) kbps.

I looked through the documentation, it looks like the faac preferences controls won't accept for fdk-aac. Does it? What settings we need?


Just for memory

@Eonfge
Copy link
Contributor Author

Eonfge commented May 31, 2020

You can check the availability of fdk-aac here:
https://pkgs.org/search/?q=fdk-aac

Long answer short, almost all distributions have support for fdk-aac and faac but they do not have it in the main repositories because of possible patents.


Your memory serves you well. There are two packages, a library package and a console package. Bit confusing but easy to compile once you know how.


As for how to implement it... I would just take a look at the code of Asunder.
http://littlesvr.ca/asunder/downloads.php

In the application, they provide a simple slider going from 32 to 320 kbps and everything goes from there. In the code itself, the rip-logic can be found in src/threads.c on line ~1108

if(doEncode)
{
    fdkaac(tracknum, trackartist, album_title, tracktitle, album_genre, album_year,
           wavfilename, aacfilename,
           global_prefs->fdkaac_bitrate,
           &aac_percent);
}

which then goes to src/wreapers.c line ~1348 where it build an argument list and then passes it on to the fdkaac library.

 fd = exec_with_output(args, STDERR_FILENO, &fdkaac_pid, NULL);

@SokoloffA
Copy link
Member

I will try to add this soon.

@SokoloffA
Copy link
Member

Patent licenses for necessary patent claims for the FDK AAC Codec (including those of Fraunhofer) may be obtained through Via Licensing (www.vialicensing.com) or through the respective patent owners individually for the purpose of encoding or decoding bit streams in products that are compliant with the ISO/IEC MPEG audio standards.

You probably shouldn't include it in the flatpack.

@Eonfge
Copy link
Contributor Author

Eonfge commented Jun 6, 2020

.m4a is indeed patented. But that doesn't seem to matter for Flathub because before I showed up, they already distributed tools with .m4a support.

In December 2018, they added Fre:ac. The first CD ripper tool on Flathub:
flathub/org.freac.freac@e3a1d4c

Since Fre:ac rips to .m4a, I see no patent related reason why other tools can't do so as well. I could test it with the admin mailing-list if you would like to?

@Eonfge
Copy link
Contributor Author

Eonfge commented Jun 6, 2020

Other example of why I think software patents are no issue for Flathub: VLC. VLC could never be legally distributed in the US because of the large amounts of patented code in the ffmpeg library.

Luckily, VLC is French.

Long story short: Software patents are an USA thing. I can't directly find the legal jurisdiction of Flathub, but if it's not US based, then patents are no issue.

@SokoloffA
Copy link
Member

In Russia, software is not patents too.

P.S.
Did you see my suggestion about metainfo.xml?
flathub/com.github.Flacon#7

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

No branches or pull requests

2 participants