Jellyfin Forum
Transcoding ffmpeg options - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: Transcoding ffmpeg options (/t-transcoding-ffmpeg-options)



Transcoding ffmpeg options - s7mon - 2024-01-04

trying to setup jellyfin for transcoding with hw acceleration (which seems not to be related i get it also with sw transcoding).
And it seems the autorotate option is not used correctly. I assume it should be not using 0 at all or using noautorotate

Manually removing the 0 or autorotate options help when i try it manually.
https://ffmpeg.org/ffmpeg.html#toc-Video-Options

ffmpeg -analyzeduration 200M -f mov,mp4,m4a,3gp,3g2,mj2 -autorotate 0 -i file:"/mnt/converted/test.mp4" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -preset veryfast -crf 23 -maxrate 444944 -bufsize 889888 -profile:v:0 main -level 40 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -sc_threshold:v:0 0 -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale=trunc(min(max(iw\,ih*a)\,640)/2)*2:trunc(ow/a/2)*2,format=yuv420p" -codec:a:0 aac -ac 2 -ab 256000 -ar 44100 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/var/lib/jellyfin/transcodes/4a916a9fc91f48a705bfeff873807f7d%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/var/lib/jellyfin/transcodes/4a916a9fc91f48a705bfeff873807f7d.m3u8"

..
  Stream #0:0[0x1](eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 10062 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
      Metadata:
        handler_name    : VideoHandler
        vendor_id      : [0][0][0][0]
        encoder        : Lavc59.37.100 h264_nvenc
  Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 275 kb/s (default)
      Metadata:
        handler_name    : SoundHandler
        vendor_id      : [0][0][0][0]
Option autorotate (automatically insert correct rotate filters) cannot be applied to output url 0 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for output file 0.
Error opening output files: Invalid argument

is this a known issue or am i missing sth? Can i configure things somewhere?

Version 10.8.13
ffmpeg git


RE: Transcoding ffmpeg options - s7mon - 2024-01-04

seems to be a change in ffmpeg
https://git.videolan.org/?p=ffmpeg.git;a=commit;h=25c98566e8a45b50415c80ca6450282f2ec0657a
cleaning options with arguments and it should be either -autorotate or -noautorotate but without argument now.
raised the ticket https://github.com/jellyfin/jellyfin/issues/10809


RE: Transcoding ffmpeg options - TheDreadPirate - 2024-01-04

Which version of ffmpeg are you using? Are you using vanilla ffmpeg or jellyfin-ffmpeg? Is this autorotate option causing any issues during transcoding?

Looking at your logs, you are not using jellyfin-ffmpeg. I strongly recommend using our customized ffmpeg. Looks like our resident ffmpeg expert agrees with me in the git issue.


RE: Transcoding ffmpeg options - s7mon - 2024-01-04

Hi, ffmpeg is plain ffmpeg from git, not the jellyfin-ffmpeg one. My distro does not bundle jellyfin-ffmpeg and i am using git version for testing and access to latest hw encoding support i also use outside of jellyfin.
But maybe if i find some time to try containerization i will switch.
Seems the issue is anyhow already being solved (pull request).

FYI: without that pull request the autorotate option blocks all transcodes with latest ffmpeg as it treats the parameter 0 as output and not as the value for the option autorotate anymore.

regards

P.S.: what is the exact difference of jellyfin-ffmpeg to vanilla ffmpeg? I am not sure i get what is missing from the plain ffmpeg