2024-03-28, 10:12 PM
(This post was last modified: 2024-03-29, 09:48 AM by ric. Edited 6 times in total.)
I can only talk from a PI perspective, but caching not just the transcoding files but also the var and usr cache files on the SDcard is going kill performance and the Card eventually . Ive already linked the directories to a separate drive. Ive also redirected the transcoding FFMPEG to a shell script which strips out the key options and I pipes them through to ffmpeg the way which works best for me and keeps it simple... its a shame its caches the whole file, better would be just buffer a few seconds in real time and let the client do any video caching. Kodi does this well for TVHeadend.
Im happy now!
server log file injecting my options into the stream:
0 -sn -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 23 -maxrate 800000 -bufsize 1600000 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames "expr:gte(t,n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync -1 -codec:a:0 ac3 -ac 6 -ab 256000 -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/7978c224d6d58f6e311a5c45759ac528/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528.m3u8" -y "/MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528%d.ts"
.................
ffmpeg version 4.9.10-1~deb9u1~bpo8+1 <-- FAKE V4 HEADER TO FOOL THE CHECKER
Extract useful info and reform to ffmpeg
Number of JF ffmpeg args: 60
extract only the useful ones
file112VIDEOS/--COMEDY--/VED/8-3 Front Page Story.mpg
800000
hls/7978c224d6d58f6e311a5c45759ac528/
/MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528.m3u8
/MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528%d.ts
Now Send out..> >...
/usr/bin/ffmpeg -i file112VIDEOS/--COMEDY--/VED/8-3 Front Page Story.mpg -f mpegts -c:a copy -c:v h264_omx -b:v 800000 ....hls/7978c224d6d58f6e311a5c45759ac528/ /MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528.m3u8 /MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528%d.ts
....................
[16:09:53] [WRN] HTTP Response 200 to 10
Im happy now!
server log file injecting my options into the stream:
0 -sn -codec:v:0 libx264 -pix_fmt yuv420p -preset veryfast -crf 23 -maxrate 800000 -bufsize 1600000 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -force_key_frames "expr:gte(t,n_forced*3)" -vf "scale=trunc(min(max(iw\,ih*dar)\,640)/2)*2:trunc(ow/dar/2)*2" -flags -global_header -vsync -1 -codec:a:0 ac3 -ac 6 -ab 256000 -f segment -max_delay 5000000 -avoid_negative_ts disabled -start_at_zero -segment_time 3 -individual_header_trailer 0 -segment_format mpegts -segment_list_entry_prefix "hls/7978c224d6d58f6e311a5c45759ac528/" -segment_list_type m3u8 -segment_start_number 0 -segment_list "/MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528.m3u8" -y "/MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528%d.ts"
.................
ffmpeg version 4.9.10-1~deb9u1~bpo8+1 <-- FAKE V4 HEADER TO FOOL THE CHECKER
Extract useful info and reform to ffmpeg
Number of JF ffmpeg args: 60
extract only the useful ones
file112VIDEOS/--COMEDY--/VED/8-3 Front Page Story.mpg
800000
hls/7978c224d6d58f6e311a5c45759ac528/
/MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528.m3u8
/MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528%d.ts
Now Send out..> >...
/usr/bin/ffmpeg -i file112VIDEOS/--COMEDY--/VED/8-3 Front Page Story.mpg -f mpegts -c:a copy -c:v h264_omx -b:v 800000 ....hls/7978c224d6d58f6e311a5c45759ac528/ /MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528.m3u8 /MEDIADRV/TEMP_DIR_FOR_JELLYFIN/transcodes/7978c224d6d58f6e311a5c45759ac528%d.ts
....................
[16:09:53] [WRN] HTTP Response 200 to 10