diff --git a/lib/screen-recorder/common.rb b/lib/screen-recorder/common.rb index 5e10475..8d215dd 100644 --- a/lib/screen-recorder/common.rb +++ b/lib/screen-recorder/common.rb @@ -61,7 +61,10 @@ def start_ffmpeg process = execute_command(ffmpeg_command, options.log) sleep(1.5) # Takes ~1.5s to initialize ffmpeg # Check if it exited unexpectedly - raise FFMPEG::Error, "Failed to start ffmpeg. Reason: #{lines_from_log(:last, 2)}" if process.exited? + if process.exited? + raise FFMPEG::Error, + "Failed to start command: #{ffmpeg_command}.\nReason: #{lines_from_log(:last, 10)}" + end process end