Update cast_file incantations.
This commit is contained in:
parent
e38bee4c0f
commit
6d0bc958a9
@ -12,12 +12,14 @@ function main {
|
|||||||
shift
|
shift
|
||||||
if [ "$cmd" = "copy" ]; then
|
if [ "$cmd" = "copy" ]; then
|
||||||
copy "${@}"
|
copy "${@}"
|
||||||
elif [ "$cmd" = "h264" ]; then
|
elif [ "$cmd" = "stream_software_h264" ]; then
|
||||||
h264 "${@}"
|
stream_software_h264 "${@}"
|
||||||
|
elif [ "$cmd" = "stream_hardware_h264" ]; then
|
||||||
|
stream_hardware_h264 "${@}"
|
||||||
|
elif [ "$cmd" = "preprocess_software_h264" ]; then
|
||||||
|
preprocess_software_h264 "${@}"
|
||||||
elif [ "$cmd" = "preprocess_hardware_h264" ]; then
|
elif [ "$cmd" = "preprocess_hardware_h264" ]; then
|
||||||
preprocess_hardware_h264 "${@}"
|
preprocess_hardware_h264 "${@}"
|
||||||
elif [ "$cmd" = "software_h264" ]; then
|
|
||||||
software_h264 "${@}"
|
|
||||||
elif [ "$cmd" = "vp9" ]; then
|
elif [ "$cmd" = "vp9" ]; then
|
||||||
vp9 "${@}"
|
vp9 "${@}"
|
||||||
elif [ "$cmd" = "preprocess_hardware_vp9" ]; then
|
elif [ "$cmd" = "preprocess_hardware_vp9" ]; then
|
||||||
@ -60,7 +62,7 @@ function copy {
|
|||||||
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
|
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
|
||||||
}
|
}
|
||||||
|
|
||||||
function h264 {
|
function stream_software_h264 {
|
||||||
local file_to_cast
|
local file_to_cast
|
||||||
file_to_cast="$3"
|
file_to_cast="$3"
|
||||||
|
|
||||||
@ -72,24 +74,74 @@ function h264 {
|
|||||||
|
|
||||||
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
|
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
|
||||||
</dev/null exec ffmpeg \
|
</dev/null exec ffmpeg \
|
||||||
-re \
|
-re \
|
||||||
-stream_loop -1 \
|
-stream_loop -1 \
|
||||||
-init_hw_device vaapi=foo:/dev/dri/renderD128 \
|
-i "$file_to_cast" \
|
||||||
-hwaccel vaapi \
|
-c:v h264 \
|
||||||
-hwaccel_output_format vaapi \
|
-b:v 2M \
|
||||||
-hwaccel_device foo \
|
-profile:v high \
|
||||||
-i "$file_to_cast" \
|
-bf 0 \
|
||||||
-filter_hw_device foo \
|
-strict -2 \
|
||||||
-vf 'format=nv12|vaapi,hwupload' \
|
-c:a opus \
|
||||||
-c:v h264_vaapi \
|
-ac 2 \
|
||||||
-bf 0 \
|
-b:a 320k \
|
||||||
-strict -2 \
|
-ar 48000 \
|
||||||
-c:a opus \
|
-f rtsp \
|
||||||
-b:a 320k \
|
-rtsp_transport tcp \
|
||||||
-ar 48000 \
|
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
|
||||||
-f rtsp \
|
}
|
||||||
-rtsp_transport tcp \
|
|
||||||
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
|
function stream_hardware_h264 {
|
||||||
|
local file_to_cast
|
||||||
|
file_to_cast="$3"
|
||||||
|
|
||||||
|
local USERNAME PASSWORD
|
||||||
|
USERNAME="$1"
|
||||||
|
PASSWORD="$2"
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
|
||||||
|
</dev/null exec ffmpeg \
|
||||||
|
-re \
|
||||||
|
-stream_loop -1 \
|
||||||
|
-vaapi_device /dev/dri/renderD128 \
|
||||||
|
-i "$file_to_cast" \
|
||||||
|
-vf 'format=nv12|vaapi,hwupload' \
|
||||||
|
-c:v h264_vaapi \
|
||||||
|
-b:v 2M \
|
||||||
|
-profile:v high \
|
||||||
|
-bf 0 \
|
||||||
|
-strict -2 \
|
||||||
|
-c:a opus \
|
||||||
|
-ac 2 \
|
||||||
|
-b:a 320k \
|
||||||
|
-ar 48000 \
|
||||||
|
-f rtsp \
|
||||||
|
-rtsp_transport tcp \
|
||||||
|
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
|
||||||
|
}
|
||||||
|
|
||||||
|
function preprocess_software_h264 {
|
||||||
|
local file_to_cast file_to_save
|
||||||
|
file_to_cast="$1"
|
||||||
|
file_to_save="$2"
|
||||||
|
|
||||||
|
set -x
|
||||||
|
|
||||||
|
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
|
||||||
|
</dev/null exec ffmpeg \
|
||||||
|
-i "$file_to_cast" \
|
||||||
|
-c:v h264 \
|
||||||
|
-b:v 2M \
|
||||||
|
-profile:v high \
|
||||||
|
-bf 0 \
|
||||||
|
-strict -2 \
|
||||||
|
-c:a opus \
|
||||||
|
-ac 2 \
|
||||||
|
-b:a 320k \
|
||||||
|
-ar 48000 \
|
||||||
|
"$file_to_save"
|
||||||
}
|
}
|
||||||
|
|
||||||
function preprocess_hardware_h264 {
|
function preprocess_hardware_h264 {
|
||||||
@ -101,66 +153,19 @@ function preprocess_hardware_h264 {
|
|||||||
|
|
||||||
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
|
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
|
||||||
</dev/null exec ffmpeg \
|
</dev/null exec ffmpeg \
|
||||||
-init_hw_device vaapi=foo:/dev/dri/renderD128 \
|
-vaapi_device /dev/dri/renderD128 \
|
||||||
-hwaccel vaapi \
|
-i "$file_to_cast" \
|
||||||
-hwaccel_output_format vaapi \
|
-vf 'format=nv12,hwupload' \
|
||||||
-hwaccel_device foo \
|
-c:v h264_vaapi \
|
||||||
-i "$file_to_cast" \
|
-b:v 2M \
|
||||||
-filter_hw_device foo \
|
-profile:v high \
|
||||||
-vf 'format=nv12|vaapi,hwupload' \
|
-bf 0 \
|
||||||
-c:v h264_vaapi \
|
-strict -2 \
|
||||||
-b:v 2M \
|
-c:a opus \
|
||||||
-profile:v high \
|
-ac 2 \
|
||||||
-bf 0 \
|
-b:a 320k \
|
||||||
-strict -2 \
|
-ar 48000 \
|
||||||
-c:a opus \
|
"$file_to_save"
|
||||||
-ac 2 \
|
|
||||||
-b:a 320k \
|
|
||||||
-ar 48000 \
|
|
||||||
"$file_to_save"
|
|
||||||
}
|
|
||||||
|
|
||||||
function software_h264 {
|
|
||||||
local file_to_cast
|
|
||||||
file_to_cast="$3"
|
|
||||||
|
|
||||||
local USERNAME PASSWORD
|
|
||||||
USERNAME="$1"
|
|
||||||
PASSWORD="$2"
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
|
|
||||||
</dev/null exec ffmpeg \
|
|
||||||
-re \
|
|
||||||
-stream_loop -1 \
|
|
||||||
-i "$file_to_cast" \
|
|
||||||
-c:v h264 \
|
|
||||||
-bf 0 \
|
|
||||||
-c:a opus \
|
|
||||||
-b:a 320k \
|
|
||||||
-ar 48000 \
|
|
||||||
-f rtsp \
|
|
||||||
-rtsp_transport tcp \
|
|
||||||
"rtsp://$USERNAME:$PASSWORD@172.16.16.251:8554/fetch"
|
|
||||||
}
|
|
||||||
|
|
||||||
function preprocess_h264 {
|
|
||||||
local file_to_cast file_to_save
|
|
||||||
file_to_cast="$1"
|
|
||||||
file_to_save="$2"
|
|
||||||
|
|
||||||
set -x
|
|
||||||
|
|
||||||
# -bf 0 :: Disable b-frames because webrtc doesn't support h264 streams with b-frames.
|
|
||||||
</dev/null exec ffmpeg \
|
|
||||||
-i "$file_to_cast" \
|
|
||||||
-c:v h264 \
|
|
||||||
-bf 0 \
|
|
||||||
-c:a opus \
|
|
||||||
-b:a 320k \
|
|
||||||
-ar 48000 \
|
|
||||||
"$file_to_save"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function vp9 {
|
function vp9 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user