zombie_transcoding_scripts/audiovideo.md
zombie c4559b07bf
added researchscripts.md
ball is a vim swp file i gotta fix it later
2023-07-23 04:43:14 -04:00

70 lines
1.5 KiB
Markdown
Executable file

This script transcodes the audio to opus and changes the bitrate according to how many channels the audio has
==========================
scripts that i might need later for transcoding
Common Transcoding commands
---------------------------
### Transcode input to av1 and transcode the audio to opus with bitrate correction (used for eureka)
```
#!/bin/bash
#script written by logan but typed by zombie
#optimezed for teentitans
for i in *mkv; do
av1an -i "$i" -o av1/"$(basename "$i")" -e aom -c mkvmerge --passes=2 -v "--threads=2 --cpu-used=5 --end-usage=q --cq-level=24 --enable-fwd-kf=1 --aq-mode=1 --lag-in-frames=48 --bit-depth=10 --kf-max-dist=240 --kf-min-dist=12 --enable-qm=1 --sb-size=64 --enable-keyframe-filtering=2 --arnr-strength=2 --arnr-maxframes=3 --sharpness=1 --enable-dnl-denoising=0 --denoise-noise-level=5" -a "-c:a libopus -b:a:0 128k -af aformat=channel_layouts='7.1|5.1|stereo'" --chunk-order random -m lsmash -r
done
```
For the file in question, all audio tracks will be transcoded to opus. It may be useful to delete unnecessary tracks before transcoding. For example, in the case of Eureka, there were multiple tracks with different channel layouts, one that opus doesnt really support so you might as well delete the one that opus doesnt support, but it still will transcode.
```
for i in *mkv; do mkvmerge -o "$(basename "$i").balls" --audio-tracks 1 "$i"; done
```
to delete the unwanted tracks
you can use the `mkvinfo` command to get the track you want to remove