Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: FFmpeg Decoder Wrapper Component (Read 1761 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

FFmpeg Decoder Wrapper Component

I’ve been using fb2k for a long time, but for stand-alone audio files only. Now, I’m trying to perform replay gain functions on audio files within mkv containers, rather than demuxing, applying replay gain and then remuxing.

Of course - oddly - fb2k treats audio within video containers as though chapters were important, breaking apart the single audio file in the video container and attaching audio segments to these chapters. The audio segments do not match the actual chapters and truncate the audio. So, in looking around for a solution, I stumbled upon the “FFmpeg Decoder Wrapper (foo input ffmpeg).” However, this technical guide seems to be written more for those well-experienced in software development and I have been unable to de-tangle, let alone apply, this feature.

I’d like to list my confusion points and questions, but am, basically, looking for a guide for dummies. My list:

1) The technical guide states: “After downloading and extracting FFmpeg package, use the bottom editbox of the preferences page to specify the folder containing your FFmpeg binaries - ffmpeg.exe and ffprobe.exe are required. If your FFmpeg binaries are present in %PATH%, there's no need to do so.”

I’ve downloaded the binaries folder, the FFmpeg Decoder Wrapper.fb2k-component dll,  and the ffmpeg and ffprobe executables, but am unsure where to place them. I decided to put them all in the components folder within the foobar2000 folder (I knew that, at least, the dll went there). I have no idea where the “%PATH%” (referenced in the instructions) location is.

I see no “editbox” at the bottom of the preferences page, at least nothing that would indicate a place to specify the folder containing the downloaded files, as the preferences page opens on the “Components” section (my fb2k is version 2.15).

2) I installed the dll, and “FFmpeg Decoder Wrapper” showed up in “Decoding” (under “Playback”). It appeared as an individual listing in the “Decoding” tree as well. I then followed the “Configuration” part of the technical guide and created a custom-named format. Whether any of the above things that I did are correct, I have no idea.

3) In any case, with what I did above, I tried to open an mkv container and utilize this custom-named format that I created, but the same chapter segmentation appeared and I can find no way to apply any of what I did in items 1 and 2, above ...or anything else that might have indicated the desired functionality.

Of course, the technical guide is far from intuitive and lengthy searches on the web have revealed nothing. So I am asking for a step-by-step hand-holding that would detail the process that is being attempted in the guide, then the steps to open the file correctly while applying the unchecked “support chapters” capability. If I achieve that, I assume that a single audio file will appear and the replay gain application will be as usual.

Thanks, in advance, to anyone willing to help.

Re: FFmpeg Decoder Wrapper Component

Reply #1
As far as placement and installation, the steps you could have followed are this:

1. Open Foobar, go to Preferences/Components, hit the "Install" button on the bottom, browse to the "FFmpeg Decoder Wrapper.fb2k-component" file, and hit Open.  Then hit "Apply" to restart Foobar.  Afterwards, the plugin name should appear in your Components list.

2.  Download ffmpeg.exe and ffprobe.exe.  To use the "PATH" method to avoid having to specify a location, just put both of them in C:Windows, which is an existing default entry in every System Variables path statement I know of.  Done!

If for some reason you'd rather not put ffmpeg and ffprobe in your Windows folder, place them in a folder of your choice like C:\ffmpeg, and then add that folder path to your System environmental variables.  In Windows 11, that means:

1.  Go to Settings->System->About, click "Advanced System Settings" in the Related links section, and in the lower right corner of the System Settings window click "Environment Variables."

2.  In the System Variables box, highlight "path" and click the "Edit" button.

3.  Use the Browse button to locate your ffmpeg folder, then hit OK to add it to your PATH list, and OK again.

Note:  there are faster ways than the above to get to the environment variables box but this is the "Windows 11 Approved" way, haha..

For the plugin's own settings go here .  Never used it myself.

Re: FFmpeg Decoder Wrapper Component

Reply #2
Thanks. That answered my list item #1. Your link is the page that I used and was referring to as the “technical guide” but, after following it (as best I could), I am not able to see how to apply this new custom decoder.

Now, if someone can answer items #2 and #3, I may be able to make this work.


Re: FFmpeg Decoder Wrapper Component

Reply #4
Thanks. That answered my final questions ...with one exception:

It is a little difficult to view the image as the YouTube video details are quite blurred. I can follow everything up to the point where you typed-in the “Additional arguments”, which is too blurry to read. Would you please post that text for the “Additional arguments”?

Re: FFmpeg Decoder Wrapper Component

Reply #5
Code: [Select]
-drc_scale 0
It is needed to disable dynamic range compression when decoding AC3 with ffmpeg. It doesn't affect any other formats, so it is safe to be always enabled.

Re: FFmpeg Decoder Wrapper Component

Reply #6
Ignore this message. I can't figure out how to delete a post, so it stays. I realized that ReplayGain cannot be used in video players, since it is not incorporated into them.

Well, I set everything up as indicated, above, but ReplayGain cannot be set on the resulting files. I have included images of the settings.

The single audio file does appear (not broken-out by chapters) and, when I scan the file for track gain, it progresses as expected and then returns the RPG value that should be applied (“ReplayGain Scan Results” image attached). However, when I hit “Update File Tags” the window closes, but RPG is not applied, as can be seen in the attached “RPG Info” image.

When I add an mkv file without using this decoder, i.e.; with the mkv file being separated by chapters, ReplayGain does work on those separated segments.

Re: FFmpeg Decoder Wrapper Component

Reply #7
I don't know if it's a bug, but for MKVs fb2k appears not to see any ReplayGain info when the ffmpeg Decoder Wrapper is decoding (for me if there's no chapters the ReplayGain info displays when it's first saved, but not after the file is re-loaded). If there's chapters, with the ffmpeg Decoder Wrapper disabled each chapter at least appears to have the same Track Gain.

I'm using fb2k v2.2 preview 2024-09-11, 32 bit, running in Wine on Linux. I tested it with both the 32 bit and 64 bit versions of ffmpeg and the result was the same.

Below are the two MKVs I used for testing. The first one has no chapters. Both contain a video stream.
The info displayed after scanning the two files and saving the replay gain data with the ffmpeg Decoder Wrapper enabled.



Refreshing the contents of the playlist after disabling the ffmpeg Decoder Wrapper.



Refreshing the contents of the playlist after re-enabling the ffmpeg Decoder Wrapper.