#!/bin/bash
#rm /storage/dockerCommands/jellyfin/config/data/tv/RCN-Television/RCN-HD2/*.ts
#ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -noautorotate -err_detect ignore_err -fflags +genpts+discardcorrupt+nobuffer -i rtp://10.1.1.1:6012 -vf hwupload -c:v h264_vaapi -f hls -b:v 8000k -hls_time 15 -hls_list_size 4 -hls_flags delete_segments /storage/dockerCommands/jellyfin/config/data/tv/RCN-Television/RCN-HD2/RCN-HD2.m3u8

#/storage/ffmpeg/ffmpeg-8.0/ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 -noautorotate -err_detect ignore_err -fflags +discardcorrupt -i rtp://10.1.1.1:6012 -vf hwupload -c:v h264_vaapi -map 0:a:0 -map 0:v:0 -f hls -b:v 8000k -b:a 128k -hls_time 30 -hls_list_size 3 -hls_flags delete_segments /storage/dockerCommands/jellyfin/config/data/tv/RCN-Television/RCN-HD2/RCN-HD2.m3u8

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -noautorotate -err_detect ignore_err -fflags +discardcorrupt \
-i rtp://10.1.1.1:6012 \
-vf yadif_cuda \
-map 0:a:0 -map 0:v:0 \
-c:v h264_nvenc \
-b:v 6000k \
-f hls -hls_time 6 -hls_list_size 4 -hls_flags +delete_segments \
/storage/dockerCommands/jellyfin/config/data/tv/RCN-Television/RCN-HD2/RCN-HD2.m3u8 \
2>&1 | stdbuf -oL sed 's/^/[Tv-RCN-Television-RCN-HD2] /'
