Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - Printable Version +- Jellyfin Forum (https://forum.jellyfin.org) +-- Forum: Off Topic (https://forum.jellyfin.org/f-off-topic) +--- Forum: General Discussion (https://forum.jellyfin.org/f-general-discussion) +--- Thread: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) (/t-encoding-discussion-megathread-ffmpeg-handbrake-av1-etc) |
RE: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - TheDreadPirate - 2023-08-27 I haven't had a chance to look into why the crop variable was always null. I was focused on chapters yesterday because my current batch of rips pending recompression are 4:3 DVDs (no cropping necessary), 1 MKV per disc of 4-5 episodes. I have a couple 21:9 blurays coming up so I will be looking into getting cropping working tomorrow. RE: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - bitmap - 2023-08-27 (2023-08-26, 07:36 PM)TheDreadPirate Wrote: Do note that I am using jellyfin-ffmpeg. I didn't want to install vanilla ffmpeg and risk breaking something. Just as a note (I missed this before), they can co-exist happily. I ran both for some testing I was running before I upgraded my server. Well... The version number went up. Encoding performance went the other direction... As for de-interlacing, I'm not sure that's something you can turn off server side unless you disable transcoding. So if the client supports it, not a big deal. But if it doesn't, you're looking at a transcode. As for the command, I'm pretty sure it's just another video filter. I'm away from my PC (on mobile) but if remember right it's something like -vf yadif=mode where mode is drop frame or double frame (recommend double frame). This is one of the de-interlacing options in the Jellyfin dashboard actually. I'll try to check today and revise. RE: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - bitmap - 2023-08-27 (2023-08-27, 05:17 AM)TheDreadPirate Wrote: All I did here was add de-interlacing with yadif; the recommended mode is 1, which is "send field" and will double the framerate for content. This can be problematic for films, so you can run mode 0 (which is one frame only and should preserve framerate). You can also try the auto leveling filter if you're interested, but I've never played with it before and my understanding is that what it does is just stretch luminance levels in the input media. Some folks also recommend decomb when ripping DVDs (which is how Handbrake generally recommends doing deinterlacing). RE: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - TheDreadPirate - 2023-08-27 (2023-08-27, 10:50 PM)bitmap Wrote: All I did here was add de-interlacing with yadif; the recommended mode is 1, which is "send field" and will double the framerate for content. This can be problematic for films, so you can run mode 0 (which is one frame only and should preserve framerate). You can also try the auto leveling filter if you're interested, but I've never played with it before and my understanding is that what it does is just stretch luminance levels in the input media. Some folks also recommend decomb when ripping DVDs (which is how Handbrake generally recommends doing deinterlacing). Thanks a bunch! I will probably add more options and rework it a bit. After tonight, I'm off the rest of the week so I'll have plenty of time. 1) Instead of reading the current directory from within the script, require the file name be passed in. Allows for something like a find command to work through a nested folder structure and to place the output within that nested folder structure. 2) Add logic to switch deinterlacing on and off. Probably based on the output from ffprobe. 3) Get dynamic cropping working. RE: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - bitmap - 2023-08-27 Reading more, handbrake uses decomb in place of yadif (which may call yadif, but may also use other de-interlacing filters). So I'd stick with yadif. Takes longer, but should do a better job. Good luck, definitely share what you get out of it. My bash skills are rough and refine over time but if you create something pretty and useful, it'd be great to share out. I feel like handbrake is great but not as flexible. RE: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - TheDreadPirate - 2023-08-30 @nyanmisaka What is the syntax for having both deinterlacing and crop filters? Right now whichever is last in the command gets run (currently crop). Quote:Multiple -filter, -af or -vf options specified for stream 0, only the last option '-filter:v crop=w=716:h=480:x=0:y=0' will be used. An example deinterlace parameter -vf yadif=1 My crop parameter -vf crop=w=1920:h=848:x=0:y=116" How would they look together, if possible? RE: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - bitmap - 2023-08-30 This might be where -filter_complex comes in? I'm dumb. You should just need to follow the syntax I had before... Code: -vf "filterA=option:value, filterB=option:value" You need quotes, you need to separate the filters with a comma. You shouldn't need anything else. Audio and video filters are invoked separately. EDIT: I'll just do what you asked instead of being abstract about it... Quote:An example deinterlace parameter Code: -vf "crop=w=1920:h=848:x=0:y=116, yadif=1" Order matters. I think you would want to crop first, then deinterlace, since it's less video to deinterlace, though since it's just black bars it's probably a wash. RE: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - TheDreadPirate - 2023-08-31 This worked. Also, yadif is waaaay better looking than decomb. There were a couple Animes where there was noticeable deinterlacing artifacts with decomb. I might go back and redo the encode with this script and yadif. RE: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - grunt - 2023-08-31 I am enjoying reading this discussion and if anyone is interested would like to share the scripts I use to convert files to 720/1080 HEVC for things I dont really care about (like wife's reality tv...) These two scripts will look for supported file types and then convert them to the following settings, I could make it more precise like OPs (look for mkv or mp4 or whatever only) but this works for me well enough. Also this is not using FFMPEG, but a custom packaged version of handbrake-CLI with intel gpu drivers built in (for *unix distro) Code: #!/bin/bash Code: #folder where files area located to be converted I also have a script where you can input whatever you want as values (for when I want to do anything custom) Code: #folder where files area located to be converted RE: Encoding Discussion Megathread (ffmpeg, Handbrake, AV1, etc...) - bitmap - 2023-08-31 Hahaha, "more precise like OP's"! I love that! I'm running my stuff in the background (a precious show to me that I have in 4K HDR that took me ages to hunt down) and the compression to visual quality I'm getting with AV1 is astouding. The only issue is I'm wondering what goddamn file is being converted because ab-av1 doesn't tell you anything. Well if I weren't a ding-dong, I'd use echo. Like you. And maybe suppress the output from ffmpeg because it's so flippin' noisy with "HEY DID YOU KNOW I WAS COMPILED WITH ALL THESE LIBS AND HEY DID YOU ALSO KNOW THAT I CAN TELL YOU ABOUT THE FILE THAT YOU MAPPED PRECISELY BEFORE UNDERTAKING THIS CONVERSION AND HEY DID YOU ALSO KNOW..." It's like I need a pillow and a flexible sense of morality... |