Skip to content

Commit

Permalink
Environment variable to specify the folder where the video is recorded (
Browse files Browse the repository at this point in the history
#1869)

* Environment variable to specify the folder where the video is recorded

#1868

* Environment variable to specify the folder where the video is recorded

Fix env name

Fixes #1868

[deploy]

---------

Co-authored-by: Diego Molina <[email protected]>
  • Loading branch information
alb3ric and diemol authored Jun 14, 2023
1 parent 8b3652d commit ffab15f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Video/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ ENV SE_FRAME_RATE 15
ENV SE_CODEC libx264
ENV SE_PRESET "-preset ultrafast"
ENV FILE_NAME video.mp4
ENV SE_VIDEO_FOLDER /videos

EXPOSE 9000
EXPOSE 9000
3 changes: 2 additions & 1 deletion Video/video.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ FILE_NAME=${FILE_NAME}
FRAME_RATE=${FRAME_RATE:-$SE_FRAME_RATE}
CODEC=${CODEC:-$SE_CODEC}
PRESET=${PRESET:-$SE_PRESET}
VIDEO_FOLDER=${SE_VIDEO_FOLDER}

return_code=1
max_attempts=50
Expand All @@ -23,5 +24,5 @@ until [ $return_code -eq 0 -o $attempts -eq $max_attempts ]; do
done

# exec replaces the video.sh process with ffmpeg, this makes easier to pass the process termination signal
exec ffmpeg -y -f x11grab -video_size ${VIDEO_SIZE} -r ${FRAME_RATE} -i ${DISPLAY_CONTAINER_NAME}:${DISPLAY_NUM}.0 -codec:v ${CODEC} ${PRESET} -pix_fmt yuv420p "/videos/$FILE_NAME"
exec ffmpeg -y -f x11grab -video_size ${VIDEO_SIZE} -r ${FRAME_RATE} -i ${DISPLAY_CONTAINER_NAME}:${DISPLAY_NUM}.0 -codec:v ${CODEC} ${PRESET} -pix_fmt yuv420p "$VIDEO_FOLDER/$FILE_NAME"

0 comments on commit ffab15f

Please sign in to comment.