Site Tools


linux:scripts:audiostreamconvert

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:scripts:audiostreamconvert [2023/05/28 23:23] lunetikklinux:scripts:audiostreamconvert [2023/06/05 22:49] (current) lunetikk
Line 1: Line 1:
 ====== Convert .mkv Audio ====== ====== Convert .mkv Audio ======
  
-Currently this script will convert any audiostream of a .mkv file to EAC3 764k with the same channels (via ffmpeg), then remux these audiostreams to a new .mkv (via mkvmerge)+Currently this script will convert any audiostream of a .mkv file to EAC3 768k with the same channels (via ffmpeg), then remux these audiostreams to a new .mkv (via mkvmerge)
  
 ===== Prerequisites ===== ===== Prerequisites =====
  
-mkvtoolnix - Matroska tools+mkvtoolnix - Matroska tools\\
 ffmpeg - Audio conversion tool ffmpeg - Audio conversion tool
  
Line 27: Line 27:
  
 # Set new bitrate\\ # Set new bitrate\\
-newbitrate="768k"\\+new_bitrate="768k"\\
  
 If you run the script, it will convert all files inside the "input_dir", the output file will have all audio streams converted to the set "new_codec" and "new_bitrate" but with the same channels as before. If the original audio stream had 7.1 channels it will be set to 5.1 because ffmpeg EAC3 only supports up to 5.1. If you run the script, it will convert all files inside the "input_dir", the output file will have all audio streams converted to the set "new_codec" and "new_bitrate" but with the same channels as before. If the original audio stream had 7.1 channels it will be set to 5.1 because ffmpeg EAC3 only supports up to 5.1.
Line 94: Line 94:
       echo "Language: $language"       echo "Language: $language"
  
-   # If channels equal 8, change it to 6 (7.1 EAC3 is currently not supported by ffmpeg)+      # If channels equal 8, change it to 6 (7.1 EAC3 is currently not supported by ffmpeg)
       if [ "$channels" -eq 8 ]; then       if [ "$channels" -eq 8 ]; then
             channels="6"             channels="6"
Line 129: Line 129:
   
     # Set language metadata for the new audio streams using mkvpropedit     # Set language metadata for the new audio streams using mkvpropedit
-    mkvpropedit "$output_filename"${languages[@]}"+    mkvpropedit "$output_filename" ${languages[@]}
  
     echo "Conversion complete for file: $filename"     echo "Conversion complete for file: $filename"
     echo "----------------------------------"     echo "----------------------------------"
 +    
 +    # Clean up temporary directory files
 +    rm $temp_dir/*
 +
   fi   fi
 done done
linux/scripts/audiostreamconvert.1685308993.txt.gz · Last modified: 2023/05/28 23:23 by lunetikk