Skip to content

Instantly share code, notes, and snippets.

@BSoDium
Last active September 19, 2021 21:45
Show Gist options
  • Save BSoDium/ec9979cc7319d40f5a04120dc975e6bc to your computer and use it in GitHub Desktop.
Save BSoDium/ec9979cc7319d40f5a04120dc975e6bc to your computer and use it in GitHub Desktop.
A simple nextcloud flow script to convert ac3 audio codec to acc in .mkv files
# When [ File created ] and [ File name ] matches [ /[[:ascii:]]+\.mkv/i ] run following script (tested on nc 21.0.1)
ffmpeg -i /var/www/nextcloud/data/%n -vcodec copy -acodec aac -strict -2 -ab 320K /var/www/nextcloud/data/$(dirname %n)/$(basename %n .mkv)_temp.mkv;
rm /var/www/nextcloud/data/%n;
mv /var/www/nextcloud/data/$(dirname %n)/$(basename %n .mkv)_temp.mkv /var/www/nextcloud/data/%n;
/var/www/nextcloud/occ files:scan --path="$(dirname %n)";
chown www-data:www-data /var/www/nextcloud/data/%n;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment