Skip to content

Commit b6677ac

Browse files
committed
fix display resolution (16:9)
1 parent 3800433 commit b6677ac

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

simulation_stream_recorder.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ simulation_duration=$3
1515
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
1616
output_directory="$script_dir/output"
1717

18-
# Create virtual display (:97) with screen resolution (1920x1080x24)
19-
Xvfb :97 -screen 0 600x400x24 &
18+
# Create virtual display (:97)
19+
Xvfb :97 -screen 0 640x360x24 &
2020

2121
# Export the display environment variable to point to the virtual display
2222
export DISPLAY=:97
@@ -34,7 +34,7 @@ case $mode in
3434
exit 1
3535
fi
3636
# Record video from the virtual display using ffmpeg and save it to a video file
37-
ffmpeg -f x11grab -video_size 1920x1080 -i :97 -t $simulation_duration -c:v libx265 -crf 28 -preset medium "$output_directory/$output_filename"
37+
ffmpeg -f x11grab -video_size 640x360 -i :97 -t $simulation_duration -c:v libx265 -crf 28 -preset medium "$output_directory/$output_filename"
3838
echo "Video recording completed and saved to $output_directory/$output_filename"
3939
;;
4040
stream)
@@ -43,7 +43,7 @@ case $mode in
4343
exit 1
4444
fi
4545
# Stream to HLS using ffmpeg (assuming output_filename is the base name for the HLS playlist)
46-
ffmpeg -f x11grab -s 600x400 -i :97 -c:v libx264 -preset ultrafast -f hls -hls_time 10 -hls_list_size 0 -hls_segment_filename "$output_directory/$output_filename.%03d.ts" "$output_directory/$output_filename.m3u8" &
46+
ffmpeg -f x11grab -s 640x360 -i :97 -c:v libx264 -preset ultrafast -f hls -hls_time 10 -hls_list_size 0 -hls_segment_filename "$output_directory/$output_filename.%03d.ts" "$output_directory/$output_filename.m3u8" &
4747

4848

4949
echo "Streaming started and available at $output_directory/$output_filename.m3u8"
@@ -54,5 +54,3 @@ case $mode in
5454
exit 1
5555
;;
5656
esac
57-
58-
# Exit the

0 commit comments

Comments
 (0)