How can I pass the source file path as an argument to ffmpeg/HandbrakeCLI in a custom script?


Im trying to get Sonarr to automatically convert the audio of some TV shows. This is because of some ac3 audio playback issues on some of my devices. I’ve seen the mp4 automator script thing, but it seemed to complicated. But when i try to pass the file to ffmpeg the log says this:
17-5-8 17:39:08.6|Error|ffmpeg.exe|EpisodeFile_SourcePath: No such file or directory
So my question is; How do I tell FFMPEG via the Arguments what the source file is? Or is there another solution for automatically converting audio?
Guess this is also a feature request to have some ffmpeg processing capabilities built into sonarr.

From https://github.com/Sonarr/Sonarr/wiki/Custom-Post-Processing-Scripts

Parameters are passed to the script through environment variables (allowing for more flexibility in what we send to the script and not having to worry about a particular order)

You’ll need a script that takes the environment variables passed by Sonarr to the script and calls ffmpeg/HandbrakeCLI with the correct parameters.

The environment variables available are listed on the wiki page above.

We don’t have any plans to support ffmpeg directly from Sonarr at this time.

Thank you for your quick reply. I dont know anything about scripting and such, so I guess I will have to find another solution for post download re encoding.
Thanks anyway (:

It’d be quite simple to write a small batch file to do this:

Just a matter of accessing the environment variables:

and calling ffmpeg like you were doing in the arguments input.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.