# commands.log: obs-recording-file-size-per-hour, 2026-12-01 (server: Ubuntu 24.04, ffmpeg version 6.1.1-3ubuntu5, Python 3) # Each published command as run, its exit code and the edge inputs it was also tried on. Scripts sit next to this file. # recording.mkv = a-cbr6000-1080p30-1trk.mkv (60 s, 6000 kbps video + one 160 kbps AAC track). published: ffprobe -v error -show_entries format=duration,size -of default=nw=1 recording.mkv ran: ffprobe -v error -show_entries format=duration,size -of default=nw=1 "recording.mkv" exit=0 | duration=60.021000 | size=46236730 published: ffprobe -v error -show_entries format=duration,size -of default=nw=1 recording.mkv ran: ffprobe -v error -show_entries format=duration,size -of default=nw=1 "killed.mkv" exit=0 | duration=N/A | size=12845056 edge: recording killed after 20 s (no clean stop): the MKV has no duration field, size only published: ffprobe -v error -show_entries format=duration,size -of default=nw=1 recording.mkv ran: ffprobe -v error -show_entries format=duration,size -of default=nw=1 "killed.mp4" exit=1 | [mov,mp4,m4a,3gp,3g2,mj2 @ 0x5612d9202700] moov atom not found | killed.mp4: Invalid data found when processing input edge: plain MP4 killed after 20 s: ffprobe cannot open it (moov atom missing), exit 1 published: ffprobe -v error -show_entries format=duration,size -of default=nw=1 recording.mkv ran: ffprobe -v error -show_entries format=duration,size -of default=nw=1 "stream été 2.mkv" exit=0 | duration=60.021000 | size=46236730 edge: file name with a space and é published: ffprobe -v error -show_entries format=duration,size -of default=nw=1 recording.mkv ran: ffprobe -v error -show_entries format=duration,size -of default=nw=1 "nothere.mkv" exit=1 | nothere.mkv: No such file or directory edge: missing file: exit 1 published: ffprobe -v error -show_entries format=duration,size -of default=nw=1 recording.mkv ran: ffprobe -v error -show_entries format=duration,size -of default=nw=1 "truncated.mkv" exit=0 | [matroska,webm @ 0x64edad9bf700] File ended prematurely | duration=60.021000 | size=1000 edge: copy truncated to its first 1,000 bytes: exit 0, still prints the full duration from the header (size=1000 gives it away) published: ffprobe -v error -show_entries format=duration,size -of default=nw=1 recording.mkv ran: ffprobe -v error -show_entries format=duration,size -of default=nw=1 "recording.mp4" exit=0 | duration=60.031500 | size=46277906 edge: normal MP4 (OBS records .mp4 by default): works the same published: python3 gb-per-hour.py --free 250 recording.mkv ran: python3 gb-per-hour.py --free 250 "recording.mkv" exit=0 | recording.mkv: 46,236,730 bytes in 60.0 s (container) = 6,163 kbps, 46.2 MB/min, 2.77 GB/h (2.58 GiB/h), 90.1 h fit in 250 GB published: python3 gb-per-hour.py --free 250 recording.mkv ran: python3 gb-per-hour.py --free 250 "killed.mkv" exit=0 | killed.mkv: 12,845,056 bytes in 16.8 s (last packet) = 6,117 kbps, 45.9 MB/min, 2.75 GB/h (2.56 GiB/h), 90.8 h fit in 250 GB (warning: only 16.8 s; record at least 60 s, a very short test overstates GB per hour) edge: killed MKV: length taken from the last video packet instead of the missing duration published: python3 gb-per-hour.py --free 250 recording.mkv ran: python3 gb-per-hour.py --free 250 "six-tracks.mkv" exit=0 | six-tracks.mkv: 52,450,393 bytes in 60.0 s (container) = 6,991 kbps, 52.4 MB/min, 3.15 GB/h (2.93 GiB/h), 79.5 h fit in 250 GB edge: six audio tracks: the extra tracks show up in the GB per hour published: python3 gb-per-hour.py --free 250 recording.mkv ran: python3 gb-per-hour.py --free 250 "killed.mp4" exit=1 | killed.mp4: 8,912,944 bytes, length unknown (killed.mp4: Invalid data found when processing input) edge: killed plain MP4: reported as unreadable, exit 1 published: python3 gb-per-hour.py --free 250 recording.mkv ran: python3 gb-per-hour.py --free 250 "stream été 2.mkv" exit=0 | stream été 2.mkv: 46,236,730 bytes in 60.0 s (container) = 6,163 kbps, 46.2 MB/min, 2.77 GB/h (2.58 GiB/h), 90.1 h fit in 250 GB edge: file name with a space and é published: python3 gb-per-hour.py --free 250 recording.mkv ran: python3 gb-per-hour.py --free 250 "nothere.mkv" exit=1 | nothere.mkv: missing or empty edge: missing file: reported, exit 1 published: python3 gb-per-hour.py --free 250 recording.mkv ran: python3 gb-per-hour.py --free 250 "truncated.mkv" exit=1 | truncated.mkv: 1,000 bytes, length unknown (truncated: the header says 60.0 s but the data ends at 0.0 s; measure the original file) edge: copy truncated to its first 1,000 bytes: data ends far before the header length, reported, exit 1 published: python3 gb-per-hour.py --free 250 recording.mkv ran: python3 gb-per-hour.py --free 250 "short.mkv" exit=0 | short.mkv: 1,053,653 bytes in 1.2 s (container) = 7,101 kbps, 53.3 MB/min, 3.20 GB/h (2.98 GiB/h), 78.2 h fit in 250 GB (warning: only 1.2 s; record at least 60 s, a very short test overstates GB per hour) edge: very short (1.2 s) test: overstates GB per hour, the script warns published: python3 gb-per-hour.py --free 250 recording.mkv ran: python3 gb-per-hour.py --free 250 "recording.mp4" exit=0 | recording.mp4: 46,277,906 bytes in 60.0 s (container) = 6,167 kbps, 46.3 MB/min, 2.78 GB/h (2.58 GiB/h), 90.1 h fit in 250 GB edge: normal MP4 (OBS records .mp4 by default): works the same published: env PATH=/nonexistent /usr/bin/python3 gb-per-hour.py recording.mkv ran: env PATH=/nonexistent /usr/bin/python3 gb-per-hour.py "recording.mkv" exit=1 | ffprobe not found: install FFmpeg (it includes ffprobe) and make sure ffprobe is on your PATH edge: ffprobe not installed (not on PATH): clear message, exit 1 published: python3 gb-per-hour.py --free 0 recording.mkv ran: python3 gb-per-hour.py --free 0 "recording.mkv" exit=0 | recording.mkv: 46,236,730 bytes in 60.0 s (container) = 6,163 kbps, 46.2 MB/min, 2.77 GB/h (2.58 GiB/h), 0.0 h fit in 0 GB edge: --free 0: prints 0.0 h instead of dropping the hours part