Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 11th May 2024, 21:14   #101  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,102
Quote:
Originally Posted by GMJCZP View Post
Thank you Reino for your contributions. Excuse my ignorance but how, with an example, can I use Ffmpeg with libfdkaac to convert an audio file? Since both are separated.
Hi GMJCZP,

there are several ways to use libfdk_aac. First of all I suggest to have a look at the documentation here:
https://trac.ffmpeg.org/wiki/Encode/AAC

The commandline parameters are a little different than for the built-in AAC encoder, so you might want to have a look.


Your next decision will be if you want to use the software using the command line interface, or if you prefer a GUI.

For a CLI I made a simple template you can alter depending on your needs:

Quote:
"Full Path\ffmpeg.exe" -y -i "Source file name with full path" -crf 19.0 -preset medium -tune film -vcodec libx264 -acodec libfdk_aac -ac 2 -ar 48000 -b:a 160k "Output file name with full path"
Just edit the script according to your needs and run it.


As an alternative you can use an ffmpeg GUI which may be easier and also more powerful. My favorite is dmMediaConverter by Marius Dalacu. Marius was nice enough to integrate libfdk seamlessly into his software, so it is easy to use and still very powerful.

You can find all the necessary info and download links here:
https://forum.doom9.org/showthread.p...37#post1979037

You should also read the following posts for some additional info and recommendations...

If you got questions, please don't hesitate to ask.


Cheers
manolito

Last edited by manolito; 11th May 2024 at 21:24.
manolito is offline   Reply With Quote
Old 11th May 2024, 22:14   #102  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 754
Thank you Manolito for your response. I have used libfdkaac but I have never used it with ffmpeg outside of their compilation. In the first post Reino explains how to do it (map?) but I would like an example to understand what it is like to use both separately. Anyway, I'll check your information.
__________________
By law and justice!

GMJCZP's Arsenal
GMJCZP is offline   Reply With Quote
Old 12th May 2024, 01:10   #103  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,102
Looks like I do not really understand what you mean...
Quote:
I have used libfdkaac but I have never used it with ffmpeg outside of their compilation
The libfdk file which can be downloaded from Reino's link does not do anything by itself, it depends on a compatible FFmpeg version which can use it just like it was incorporated in the FFmpeg binary itself. So it makes no sense to me when you say that you have used libfdk-aac-2.dll before, but never used it with FFmpeg.


Are you talking about some very different libfdkaac file? Please clarify...


Cheers
manolito
manolito is offline   Reply With Quote
Old 12th May 2024, 14:11   #104  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 705
Quote:
Originally Posted by GMJCZP View Post
Excuse my ignorance but how, with an example, can I use Ffmpeg with libfdkaac to convert an audio file? Since both are separated.
As I explained in post #1, put the dll-file in the same map as 'ffmpeg.exe', or in any map listed in the %PATH%-variable. Next, please consult https://trac.ffmpeg.org/wiki/Encode/AAC.

Quote:
Originally Posted by StvG View Post
1. Against what AviSynth+ version you build ffms2?
The latest (headers only).
Quote:
Originally Posted by StvG View Post
2. What's the used AviSynth+ version when you try to run the script?
Uh... v2.6.0.
While reading your question, immediately my gut feeling was, this could be the root cause. Somehow it never crossed my mind to try to use a more up-to-date Avisynth install. I feel so dumb!
I've uploaded a new ffms2_cplugin build, which uses the latest revision (from https://github.com/qyot27/ffms2_cplugin.git) and is linked against ffmpeg-6.2-609-238f9de (my previous FFmpeg build from begin this year).
I've installed AviSynthPlus_3.7.3_20230715_xp.exe and did some tests. This new ffms2_cplugin build works perfectly now. No more errors. So it was my mistake afterall, not using an up-to-date Avisynth install.
__________________
My hobby website
Reino is offline   Reply With Quote
Old 13th May 2024, 09:38   #105  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,040
Oh, that's very good to know!
But... to avoid having a blob in the plugins+ folder, would you mind uploading ffms2 as static rather than shared? Pretty pretty please?
FranceBB is offline   Reply With Quote
Old 13th May 2024, 23:54   #106  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 705
I think you misunderstand. You always have to compile ffms2 with --enable-shared, in order to get 'ffms3.dll'. Hence "shared" in the archive name.
But I can see where the confusion is coming from. Especially because I don't put "shared" in the archive name of libfdk-aac, frei0r, or openssl either. So I've renamed the content or the entire ffms2 dir. I think it's more clear now. Also the filesize would be an indication whether FFmpeg was linked statically, or not.
__________________
My hobby website
Reino is offline   Reply With Quote
Old 14th May 2024, 07:46   #107  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,040
Ahhhhh it was just the name hahahahahahaha gotcha.
Yep, it's indeed static and it works like a charm, I've just put it in my plugins+ folder and I used FFMpegSource2("test.mp4", atrack=-1). Nice!
FranceBB is offline   Reply With Quote
Old 15th May 2024, 21:12   #108  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,102
After reading some FFmpeg docs I am a bit scared about version 7.1 backward compatibility. Here is the important part from the 7.0 documentation:

Quote:
This release is not backwards compatible, removing APIs deprecated before 6.0. The biggest change for most
library callers will be the removal of the old bitmask-based channel layout API, replaced by the AVChannelLayout API
allowing such features as custom channel ordering, or Ambisonics. Certain deprecated ffmpeg CLI options were also
removed, and a C11-compliant compiler is now required to build the code.
I wonder if this is relevant for me, since I do use some fairly old software under FFmpeg. So far I did not encounter any crashes or even warnings, so Reino may well have taken care of possible incompatibilities. Can I lean back, or would it be safer to revert back to the older version 5.2 ?


Cheers
manolito

Last edited by manolito; 15th May 2024 at 21:28.
manolito is offline   Reply With Quote
Old 15th May 2024, 22:39   #109  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 3,040
Good point, manolito.
For me the big blow was around -map_channels.
I use it all the time and it no longer works now.
In FFMpeg 7.x this code fails:

Quote:
#Extract DolbyE track 1
ffmpeg -i "DolbyE.mov" -map 0:1 -acodec copy -f u8 -y "stream1.u8"
#Extract each channel of DolbyE 5.1
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y "FL.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y "FR.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y "CC.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y "LFE.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y "SL.wav"
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y "SR.wav"
#Extract each channel of DolbyE 2.0
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y $jobOutputFolder:Left.wav
ffmpeg -i "stream1.u8" -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.0 -y $jobOutputFolder:Right.wav
#Audio 5.1
ffmpeg -i "FL.wav" -i "FR.wav" -i "CC.wav" -i "LFE.wav" -i "SL.wav" -i "SR.wav" -filter_complex "[0:a][1:a][2:a][3:a][4:a][5:a]join=inputs=6:channel_layout=5.1:map=0.0-FL|1.0-FR|2.0-FC|3.0-LFE|4.0-BL|5.0-BR[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f wav -y "Track1_51.wav"
#Audio 2.0
ffmpeg -i "Left.wav" -i "Right.wav" -filter_complex "[0:a][1:a]join=inputs=2:channel_layout=stereo[a]" -map "[a]" -c:a pcm_s24le -ar 48000 -f wav -y "Track2_20.wav"

I still have to see how to change it...
I guess I'm gonna stick to 6.1.1 for a little bit longer...
FranceBB is offline   Reply With Quote
Old 17th May 2024, 23:08   #110  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 754
Sorry for the delay in the response.

Are you talking about some very different libfdkaac file? Please clarify...
Manolito: Reino in post #104 has explained it for me. The idea of using both files as Reino suggests

As I explained in post #1, put the dll-file in the same map as 'ffmpeg.exe', or in any map listed in the %PATH%-variable. Next, please consult https://trac.ffmpeg.org/wiki/Encode/AAC.
Reino: I don't know how to place libfdkaac in the same ffmpeg map, if someone can explain it to me with an example I would greatly appreciate it, like in the link above.

Edit: Manolito, with dmMediaconverter you can use libfdkaac with ffmpeg but I don't know how to integrate them...
__________________
By law and justice!

GMJCZP's Arsenal

Last edited by GMJCZP; 17th May 2024 at 23:37.
GMJCZP is offline   Reply With Quote
Old 18th May 2024, 19:16   #111  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 705
Have you actually downloaded the latest archive, 'libfdk-aac-2.0.3-win32-xpmod-sse.7z'? That's where you'll find 'libfdk-aac-2.dll'.
__________________
My hobby website
Reino is offline   Reply With Quote
Old 18th May 2024, 23:24   #112  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,102
Looks like GMJCZP is mixing up fdkaac.exe which is a standalone audio encoder with lidfdk-aac-xxx.dll which is an FFmpeg plugin. Those two programs serve a completely different purpose and must not be mixed up.


Cheers
manolito

Last edited by manolito; 18th May 2024 at 23:32.
manolito is offline   Reply With Quote
Old 19th May 2024, 22:27   #113  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 754
I explain: I have the two files that Reino has uploaded, but I don't know how to use them as he says in his first post. I use fdkaac.exe in BeHappy but I want to learn how to use libfdkaac with ffmpeg like Reino says but I don't know about mapping
__________________
By law and justice!

GMJCZP's Arsenal
GMJCZP is offline   Reply With Quote
Old 19th May 2024, 22:59   #114  |  Link
lvqcl
Registered User
 
Join Date: Aug 2015
Posts: 309
Quote:
Originally Posted by GMJCZP View Post
but I want to learn how to use libfdkaac with ffmpeg like Reino says but I don't know about mapping
Quote:
Originally Posted by Reino View Post
As I explained in post #1, put the dll-file in the same map as 'ffmpeg.exe', or in any map listed in the %PATH%-variable.
I suppose that in this quote the word 'map' means folder (directory):

put the dll-file in the same folder as 'ffmpeg.exe', or in any folder listed in the %PATH%-variable
lvqcl is offline   Reply With Quote
Old 19th May 2024, 23:17   #115  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,102
Yes, that's exactly it. In this context the word "Folder" should be used. Nothing gets "mapped" in this context.
manolito is offline   Reply With Quote
Old 20th May 2024, 19:32   #116  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,102
@ GMJCZP

Quote:
Edit: Manolito, with dmMediaconverter you can use libfdkaac with ffmpeg but I don't know how to integrate them...

You can find all the relevant information starting at this post. Make sure to also read the following couple of posts up to #195 :

https://forum.doom9.org/showthread.p...37#post1979037


Good luck...
manolito

Last edited by manolito; 20th May 2024 at 19:37.
manolito is offline   Reply With Quote
Old 20th May 2024, 23:26   #117  |  Link
GMJCZP
Registered User
 
GMJCZP's Avatar
 
Join Date: Apr 2010
Location: I have a statue in Hakodate, Japan
Posts: 754
Thank you all, I will read all the information. So if I put libfdkaac in the same folder as ffmpeg it would be the same as if the library had been compiled inside ffmpeg, right?

Edit: About dmMediaConverter here Can I with that activate libfdkaac?
__________________
By law and justice!

GMJCZP's Arsenal

Last edited by GMJCZP; 20th May 2024 at 23:31.
GMJCZP is offline   Reply With Quote
Old 21st May 2024, 02:07   #118  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,102
Quote:
Originally Posted by GMJCZP View Post
Thank you all, I will read all the information. So if I put libfdkaac in the same folder as ffmpeg it would be the same as if the library had been compiled inside ffmpeg, right?
Yes, but only if your FFmpeg version supports it. At the moment there are only the versions by Reino and by Sherpya which can do that. Sherpya's version can be found here:
https://oss.netfarm.it/mplayer/

Quote:
Edit: About dmMediaConverter here Can I with that activate libfdkaac?
Yes, if you follow the procedure outlined in this post then libfdkaac will appear in the audio configuration tab and can be configured from there.


Cheers
manolito
manolito is offline   Reply With Quote
Old 21st May 2024, 08:25   #119  |  Link
richardpl
Guest
 
Posts: n/a
This thread is for research for museums.
  Reply With Quote
Old 21st May 2024, 17:04   #120  |  Link
manolito
Registered User
 
manolito's Avatar
 
Join Date: Sep 2003
Location: Berlin, Germany
Posts: 3,102
We love museums...
manolito is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 23:05.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.