The script to automate the conversion of SD video AVI (which is usually well under 2 Mbps) to MKV (uses less space than MP4).
You have control in the script whether or not to remove (or move) the āInputā avi file.
[chuck@lizum tmp.2031]$ cat convert-avi
#!/bin/bash
# Convert given AVI file (arg 1) to MKV
# SD preset will be 2 Mbps (more than enough for most AVI - interlaced of the xvid era)
Input="$1"
if [ ! -r "$Input" ]; then
echo ERROR: Cannot read \"$Input\". Abort.
exit 1
fi
Output="${Input%.*}.mkv"
if [ ! -w "$Output" ]; then
echo ERROR: Cannot write to new file \"$Output\". Skipping.
else
# Process file
ffmpeg -i "$Input" -c:v h264 -b:v 2000k -c:a copy "$Output"
# Check exit code
if [ $? -eq 0 ]; then
echo Wrote: \"$Output\" successfully.
# Uncomment this line to remove the now-obsolete AVI
# rm -f "$Output"
fi
fi
[chuck@lizum tmp.2032]$
To use the script, put it somewhere like ~/bin and have ~/bin in $PATH.
@ChuckPa Thank you a lot! I am total noob with media processing and apart from sorting library in folders I havenāt do anything with them therefore they are in format in which I got them. Will look into that. That script looks very handy
2000k = 2Mbps (the output video bitrate) ā I always tend to go a little higher to preserve any possible quality when converting. The MKV container will provide savings by itself.
If you opt to use the rm -f option, it will take out the file itself. OTHERWISE, you get to delete them manually (not a bad idea so you can gain confidence).
I showed one example how to use the find command. By changing the director(ies) you give it⦠you control how much itās going to go slamming through at a clip.
BE ADVISED. I have an i7-8809 (like an i7-7700) and it screams through them at max network bandwidth between my workstation and NAS (10 GbE).
Use this to learn with.
I recommend copying some files into a test area⦠Play with them⦠BEFORE you go into your main library
Hello, Iām struggling to understand how this thread went from a problem with unwanted video transcoding with h.264 as an example, to xvid problemsā¦
The problem Rick reported is still there. I have an LG oled55A1 with latest webOS and latest Plex client versions. Running latest version of Plex server on Windows 10.
This tv does not support DTS or trueHD so audio needs transcoding.
H.264 + DTS : video direct plays, audio transcoded to AAC, All good.
H.264 + AC3 + srt subs : video direct plays, audio direct plays, subs rendered by app. All good.
H.264 + DTS + srt subs: video transcodes, audio transcodes, subs rendered by server. Container goes from mkv to mpegts. Problem right there.
Same thing happens with HEVC x265, DTS-HD, trueHD or whatever codecs are used.
As soon as audio is transcoded and subs are activated, video transcode is triggered and streams are remuxed.
I tried every solution possible and I still have the problem.
Why are subtitles burned in video if the only thing that was needed is audio transcoding? Doesnāt make any senseā¦
It is a limitation of the streaming protocol used between the TV and the Plex server.
When direct streaming, such as when audio is transcoded, Plex has to burn in the subtitles. If they did not, the subtitles, audio, and video would lose sync with each other.
The issue is well known. It has existed at least since I purchased my LG TV 4+ years ago. Other Plex SmartTV apps have the same issue (Samsung, maybe others).
This doesnāt happen in my samsung, sony (android tv) or appletv. Only an LG problem, it is particularly bad because burn subs completely destroys hw transcoding advantage on 4k HDR files.
I fail to see why is not possible for Plex to transcode to a compatible format the tv accepts without the need to burn the subtitles like other platforms