2023-08-23, 09:56 PM
(2023-08-23, 09:11 PM)TheDreadPirate Wrote: "Blurays" preset
MKV container
no filters
Automatically detect and trim black bars, otherwise don't change resolution
Variable frame rate, match source (always results in constant frame rate)
NVENC HEVC 8-bit, CQ26, slow preset, main profile, auto level
Direct copy all audio streams
Direct copy all subtitles
Direct copy chapters
The only hard part here is the cropping of black bars. I both understand and don't why folks do this -- if you wouldn't mind sharing your thoughts? I'll share what I have so far, need to get back to work, but the rest is just putting this together into a bash script, which is fairly easy.
This will output exactly what you need for the ffmpeg video filter to crop out the black bars -- keep in mind it's automated, so may over- or under-crop a bit. It also doesn't zoom so you're not getting a full resolution, you're getting whatever comes out. You can correct this, but it gets more complicated and you dilute your video quality if you mess with it any further.
Code:
ffmpeg -ss 10 -i 'input_media.mkv' -t 1 -vf cropdetect -f null - 2>&1 | awk '/crop=/ {a=$NF} END{print a}'
The explanation here is it skips the first 10 seconds (to get past a likely black intro card -- you can customize this to skip further if needed, uses the cropdetect filter, directs the output away from the console, and uses awk to only grab the final output of the command, which is the cropping information formatted exactly as the video filter needs it. Here it is in context, thrown into a bash variable to see if I could set it up that way so I could then use it inside of a script with ffmpeg:
Code:
bitmap@server:$ crop=$(ffmpeg -ss 10 -i 'input_media.mkv' -t 1 -vf cropdetect -f null - 2>&1 | awk '/crop=/ {a=$NF} END{print a}')
bitmap@server:$ echo $crop
crop=1904:800:10:0
Next is the ffmpeg command to actually crop it:
Code:
ffmpeg -i input_media.mkv -vf "${crop}" cropped_media.mkv
Obviously that needs the rest of the customization...I'll come back later when I have more time. The auto-cropping was the worst part of it, the rest is fairly simple and I don't think I'll need to look up as much to write it out...
Jellyfin 10.10.0 LSIO Docker | Ubuntu 24.04 LTS | i7-13700K | Arc A380 6 GB | 64 GB RAM | 79 TB Storage