Script to change audio?

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
MartyIU13
Newbie
Newbie
Posts: 4
Joined: March 27th, 2019, 10:30 pm

Script to change audio?

Post by MartyIU13 » March 27th, 2019, 10:42 pm

I currently use ffmpeg to re-encode the audio on large 4K files to AC3 5.1 so Direct Play on Plex works and those large files don't have to be transcoded. Is there a way to add this process to run automatically in SAB as a post-processing script once a file is done downloading then send the file to the appropriate folder after?

I currently open up a cmd window and type:

ffmpeg -i originalfilename-map 0 -vcodec copy -scodec copy -acodec ac3 -b:a 640k newfilename

to keep the video as is and just change the audio to AC3 5.1. I was able to set it up and get that part working. Just hoping now I can make this automatic in SAB somehow. I am only doing this with huge 4K files as regular 1080 is fine with transcoding (or most are just encoded for direct play automatically anyways), but also wondering if on top of re-encoding the audio the script can also re-encode the video to H.264 if it is not already.

Just doing the audio part would be fine for now, but if one script, or multiple, can be run as a post processing script in SAB to get all files set with the right video and audio encoding for direct play purposes, that would be great. Any help would be appreciated!

User avatar
safihre
Administrator
Administrator
Posts: 3367
Joined: April 30th, 2015, 7:35 am
Location: Switzerland
Contact:

Re: Script to change audio?

Post by safihre » March 28th, 2019, 2:14 am

Have you taken a look at https://sabnzbd.org/wiki/scripts/post-p ... ng-scripts ?

You will need to create a script, either Python or shell/bash script, and in that script you should automatically detect the filename.
So maybe try to match on ".mkv"?
I did a quick Google and already found some other ffmpeg-SABnzbd scripts, so maybe you can also take those or part of those?

MartyIU13
Newbie
Newbie
Posts: 4
Joined: March 27th, 2019, 10:30 pm

Re: Script to change audio?

Post by MartyIU13 » March 28th, 2019, 4:41 pm

Thank you, but was more hoping for a little more step by step. I have no idea how to create a script and detect the filename. Was hoping it would be a simple setting somewhere based on what I already setup with ffmpeg.

User avatar
safihre
Administrator
Administrator
Posts: 3367
Joined: April 30th, 2015, 7:35 am
Location: Switzerland
Contact:

Re: Script to change audio?

Post by safihre » April 1st, 2019, 1:05 pm

Unfortunately I can't help much, I'm not too much of a Linux expert myself..

User avatar
OneCD
Sr. Member
Sr. Member
Posts: 296
Joined: March 4th, 2017, 3:47 pm

Re: Script to change audio?

Post by OneCD » April 1st, 2019, 2:23 pm

MartyIU13 wrote:
March 27th, 2019, 10:42 pm
I currently open up a cmd window and type:
Are you using Windows?
Stuff I like: Apache BASH CRON DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo S20 Python Raspberry Pi RAID SABnzbd+ SickChill Transmission Usenet VirtualBox Watcher3 WordPress XFCE

MartyIU13
Newbie
Newbie
Posts: 4
Joined: March 27th, 2019, 10:30 pm

Re: Script to change audio?

Post by MartyIU13 » April 2nd, 2019, 8:24 pm

OneCD wrote:
April 1st, 2019, 2:23 pm
MartyIU13 wrote:
March 27th, 2019, 10:42 pm
I currently open up a cmd window and type:
Are you using Windows?
Yes, Windows 10

MartyIU13
Newbie
Newbie
Posts: 4
Joined: March 27th, 2019, 10:30 pm

Re: Script to change audio?

Post by MartyIU13 » May 7th, 2019, 8:30 pm

Bump

User avatar
OneCD
Sr. Member
Sr. Member
Posts: 296
Joined: March 4th, 2017, 3:47 pm

Re: Script to change audio?

Post by OneCD » May 7th, 2019, 8:34 pm

Sorry Marty, I can help with scripting on Linux, but my Windows is a little rusty. Hopefully, someone can jump in and assist.
Stuff I like: Apache BASH CRON DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo S20 Python Raspberry Pi RAID SABnzbd+ SickChill Transmission Usenet VirtualBox Watcher3 WordPress XFCE

Post Reply