zombie_transcoding_scripts/README.md

63 lines
2.9 KiB
Markdown
Raw Normal View History

2023-01-02 01:26:03 -05:00
zombie_transcoding_scripts
==========================
2023-01-02 00:10:13 -05:00
2023-01-02 00:14:03 -05:00
scripts that i might need later for transcoding
2023-01-02 01:26:03 -05:00
Common Transcoding commands
---------------------------
2023-01-02 00:14:03 -05:00
```
penis
```
2023-01-02 01:26:03 -05:00
### Transcode input to av1 and transcode the audio aswell (used for teen titans)
```
#!/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
```
2023-01-02 03:43:20 -05:00
For the file in question, all audio tracks will be transcoded. It may be useful to delete unnecessary tracks before transcoding. For example, in the case of Teen Titans, there was a lossless and a lossy track. I wanted to keep just the lossless track so i did:
2023-01-02 01:26:03 -05:00
```
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
#### this one doesnt transcode the audio
```
#!/bin/bash
#script written by logan but typed by zombie
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" --chunk-order random -m lsmash -r
done
```
2023-01-02 03:43:20 -05:00
the only difference between the one that does the audio and the one that doesnt is `-a "-c:a libopus -b:a:0 128k -af aformat=channel_layouts='7.1|5.1|stereo'"`
2023-01-02 01:26:03 -05:00
### Transcode input to h264 and not audio (classic zombie crap version for playing on phone)
```
# create the h264 directory if it doesn't already exist
mkdir -p h264
# loop through all .mkv files in the current directory
for file in *.mkv; do
# run the ffmpeg command on the current file
ffmpeg -i "$file" -s 960x540 -c:v libx264 -preset veryslow -crf 30 -c:a copy "h264/${file%.*}.mkv"
done
```
#### single file version
```
ffmpeg -i Teen\ Titans\ S04E11.mkv -s 960x540 -c:v libx264 -preset veryslow -crf 30 -c:a copy output540pveryslow30ep11kleiner.mkv
```
2023-01-02 20:06:15 -05:00
Common info commands
--------------------
### this gets the info of all the audio of the videos in the current dir and displays it neatly (is useful for finding problems with the audio)
```
for i in *.mkv; do mediainfo "$i" | grep -e "Complete name" -e "Video" -e "Audio" -e "channels" -e "Bit rate"; echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-="; done
```