Skip to content

Commit 30e2113

Browse files
committed
Fix live streaming RTSP/USB #1027
1 parent ab1043e commit 30e2113

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

hardware/webcam/rtsplive_webcam.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,19 @@ elif [[ "${ROTATION}" == "0" ]]; then
5858
elif [[ "${ROTATION}" == "90" ]]; then
5959
ROTATION_ACTION="transpose=1,"
6060
elif [[ "${ROTATION}" == "180" ]]; then
61-
ROTATION_ACTION="vflip,hflip"
61+
ROTATION_ACTION="vflip,hflip,"
6262
elif [[ "${ROTATION}" == "270" ]]; then
6363
ROTATION_ACTION="transpose=2,"
6464
fi
6565

6666

67+
S_TIMEOUT="-stimeout"
6768
CODEC="h264_omx"
6869
if [ "${OS}" == "bookworm" ]; then
6970
CODEC="h264"
71+
S_TIMEOUT="-timeout"
7072
fi
7173

7274
# Start streaming
73-
"${FFMPEG}" -hide_banner -y -nostdin -stimeout 10000000 -re -i "${DEVICE}" \
74-
-c:v ${CODEC} -profile:v 66 -flags:v +global_header -flags +cgop -g 6 -b:v 2000K -vf "${ROTATION_ACTION}format=yuv420p,drawtext=fontfile=/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf:box=1:boxcolor=black:text='${NAME} %{localtime\:%a %d %b %Y @ %H\\\\\:%M\\\\\:%S}':fontsize=14:fontcolor=white@1:x=3:y=3" -f hls -hls_time 2 -hls_list_size 3 -hls_flags delete_segments+split_by_time -hls_segment_filename "${DIR}/chunk_%03d.ts" "${DIR}/stream.m3u8"
75+
"${FFMPEG}" -hide_banner -y -nostdin ${S_TIMEOUT} 10000000 -re -i "${DEVICE}" \
76+
-c:v ${CODEC} -profile:v baseline -flags:v +global_header -flags +cgop -g 6 -b:v 2000K -vf "${ROTATION_ACTION}format=yuv420p,drawtext=fontfile=/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf:box=1:boxcolor=black:text='${NAME} %{localtime\:%a %d %b %Y @ %H\\\\\:%M\\\\\:%S}':fontsize=14:fontcolor=white@1:x=3:y=3" -f hls -hls_time 2 -hls_list_size 3 -hls_flags delete_segments+split_by_time -hls_segment_filename "${DIR}/chunk_%03d.ts" "${DIR}/stream.m3u8"

hardware/webcam/usblive_webcam.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ elif [[ "${ROTATION}" == "0" ]]; then
5858
elif [[ "${ROTATION}" == "90" ]]; then
5959
ROTATION_ACTION="transpose=1,"
6060
elif [[ "${ROTATION}" == "180" ]]; then
61-
ROTATION_ACTION="vflip,hflip"
61+
ROTATION_ACTION="vflip,hflip,"
6262
elif [[ "${ROTATION}" == "270" ]]; then
6363
ROTATION_ACTION="transpose=2,"
6464
fi

0 commit comments

Comments
 (0)