@@ -31,28 +31,22 @@ trap shutdown SIGTERM SIGINT SIGKILL
3131# https://www.ffmpeg.org/ffmpeg-codecs.html
3232# sudo avconv -an -y -f x11grab \
3333
34- for i in $( seq -f " %03g" 0 ${VIDEO_CHUNKS_MAX} ) ; do
35- video_name=" ${VIDEO_FILE_NAME} -$i "
36- if [ " $i " == " 000" ]; then
37- video_name=" ${VIDEO_FILE_NAME} "
38- fi
39- video_path=" ${VIDEOS_DIR} /${video_name} .${VIDEO_FILE_EXTENSION} "
40-
41- # Fix perms to be able to start ffmpeg without sudo
42- sudo touch " ${video_path} "
43- sudo chown seluser:seluser " ${video_path} "
44-
45- # avconv or ffmpeg
46- avconv -f x11grab \
47- -framerate ${FFMPEG_FRAME_RATE} \
48- -video_size ${FFMPEG_FRAME_SIZE} \
49- -i " ${DISPLAY} .0+0,0" \
50- ${FFMPEG_CODEC_ARGS} \
51- -t " ${VIDEO_CHUNK_SECS} " \
52- -segment_format_options movflags=+faststart \
53- -y -an " ${video_path} " 2>&1 &
54- LAST_FFMPEG_PID=$!
55-
56- # tells bash to wait until child processes have exited
57- wait
58- done
34+ video_path=" ${VIDEOS_DIR} /${VIDEO_FILE_NAME} .${VIDEO_FILE_EXTENSION} "
35+
36+ # Fix perms to be able to start ffmpeg without sudo
37+ sudo touch " ${video_path} "
38+ sudo chown seluser:seluser " ${video_path} "
39+
40+ # avconv or ffmpeg
41+ avconv -f x11grab \
42+ -framerate ${FFMPEG_FRAME_RATE} \
43+ -video_size ${FFMPEG_FRAME_SIZE} \
44+ -i " ${DISPLAY} .0+0,0" \
45+ ${FFMPEG_CODEC_ARGS} \
46+ -t " ${VIDEO_CHUNK_SECS} " \
47+ -segment_format_options movflags=+faststart \
48+ -y -an " ${video_path} " 2>&1 &
49+ LAST_FFMPEG_PID=$!
50+
51+ # tells bash to wait until child processes have exited
52+ wait
0 commit comments