diff --git a/encoder/firmware.php b/encoder/firmware.php index 54b475a..553c09e 100755 --- a/encoder/firmware.php +++ b/encoder/firmware.php @@ -9,7 +9,7 @@ https://github.com/shreebhattji/Urmi/blob/main/licence.md */ exec("sudo chmod 444 /sys/class/dmi/id/product_uuid"); -$version = "11.20"; +$version = "11.21"; function fail(string $msg): never { diff --git a/encoder/input.php b/encoder/input.php index 9abaf38..6111cba 100755 --- a/encoder/input.php +++ b/encoder/input.php @@ -283,7 +283,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
- +
diff --git a/encoder/static.php b/encoder/static.php index 6fe71fc..3e0ae8a 100755 --- a/encoder/static.php +++ b/encoder/static.php @@ -384,17 +384,17 @@ function update_service($which_service) case "copy_input": switch ($input_source) { case "hdmi": - $input .= "ffmpeg -hide_banner -init_hw_device qsv=hw -filter_hw_device hw -fflags +genpts -use_wallclock_as_timestamps 1 -f v4l2 -thread_queue_size 512 -input_format yuyv422 " + $input .= "ffmpeg -hide_banner -init_hw_device qsv=hw -filter_hw_device hw -hwaccel qsv -hwaccel_output_format qsv -c:v mjpeg_qsv -fflags +genpts -use_wallclock_as_timestamps 1 -f v4l2 -thread_queue_size 512 -input_format mjpeg " . " -video_size " . $data['hdmi']['resolution'] . " -framerate " . $data['hdmi']['framerate'] . " -i /dev/video0" - . " -f alsa -thread_queue_size 1024 -i " . $data['hdmi']['audio_source'] + . " -f alsa -thread_queue_size 2048 -i " . $data['hdmi']['audio_source'] . " -c:v h264_qsv -profile:v high -level:v 4.2 -b:v 6M -maxrate 6M -bufsize 12M " . " -c:a aac -b:a 265k -ar 48000 -muxrate 0 -pat_period 0.1 -pkt_size 1316 "; if ($hdmi_delay_video != "") - $input .= ' -vf "format=nv12,hwupload=extra_hw_frames=64,scale_qsv=' . $common_backend_resolution . ',' . setptsFromMs($hdmi_delay_video) . '"'; + $input .= ' -vf "vpp_qsv=format=nv12:in_range=full:out_range=full,scale_qsv=' . $common_backend_resolution . ',' . setptsFromMs($hdmi_delay_video) . '"'; else - $input .= ' -vf "format=nv12,hwupload=extra_hw_frames=64,scale_qsv=' . $common_backend_resolution . '"'; + $input .= ' -vf "vpp_qsv=format=nv12:in_range=full:out_range=full,scale_qsv=' . $common_backend_resolution . '"'; if ($hdmi_delay_audio != "") $input .= adelayFromMs($hdmi_delay_audio, 2); @@ -417,20 +417,20 @@ function update_service($which_service) case "use_common_backend": switch ($input_source) { case "hdmi": - $input .= "ffmpeg -hide_banner -init_hw_device qsv=hw -filter_hw_device hw -fflags +genpts -use_wallclock_as_timestamps 1 -f v4l2 -thread_queue_size 512 -input_format yuyv422 -video_size " - . $data['hdmi']['resolution'] - . " -framerate " . $data['hdmi']['framerate'] . " -i /dev/video0 -f alsa -thread_queue_size 512 -i " . $data['hdmi']['audio_source']; + $input .= "ffmpeg -hide_banner -init_hw_device qsv=hw -filter_hw_device hw -hwaccel qsv -hwaccel_output_format qsv -c:v mjpeg_qsv -fflags +genpts -use_wallclock_as_timestamps 1 -f v4l2 -thread_queue_size 512 -input_format mjpeg " + . " -video_size ". $data['hdmi']['resolution'] + . " -framerate " . $data['hdmi']['framerate'] . " -i /dev/video0 -f alsa -thread_queue_size 2048 -i " . $data['hdmi']['audio_source']; if ($data['hdmi']['resolution'] == $data['common_backend']['resolution']) { if ($hdmi_delay_video != "") - $input .= ' -vf "format=nv12,hwupload=extra_hw_frames=64,' . setptsFromMs($hdmi_delay_video) . '"'; + $input .= ' -vf "vpp_qsv=format=nv12:in_range=full:out_range=full,' . setptsFromMs($hdmi_delay_video) . '"'; else - $input .= ' -vf "format=nv12,hwupload=extra_hw_frames=64"'; + $input .= ' -vf "vpp_qsv=format=nv12:in_range=full:out_range=full"'; } else { if ($hdmi_delay_video != "") - $input .= ' -vf "format=nv12,hwupload=extra_hw_frames=64,scale_qsv=' . $common_backend_resolution . ',' . setptsFromMs($hdmi_delay_video) . '"'; + $input .= ' -vf "vpp_qsv=format=nv12:in_range=full:out_range=full,scale_qsv=' . $common_backend_resolution . ',' . setptsFromMs($hdmi_delay_video) . '"'; else - $input .= ' -vf "format=nv12,hwupload=extra_hw_frames=64,scale_qsv=' . $common_backend_resolution . '"'; + $input .= ' -vf "vpp_qsv=format=nv12:in_range=full:out_range=full,scale_qsv=' . $common_backend_resolution . '"'; } $input .= " -c:v h264_qsv -profile:v high -level:v 4.2 " . " -b:v " . $common_backend_data_rate