Skip to content

Commit

Permalink
Select audio stream when getting duration.
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxPower15 committed Feb 11, 2024
1 parent c33dfaf commit 197749c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
input_file = "out/#{SINE_WAVE_FILE_NAME}"
end

duration_cmd = "ffprobe -hide_banner -loglevel error -select_streams v:0 -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 #{input_file}"
duration_cmd = "ffprobe -hide_banner -loglevel error -select_streams a:0 -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 #{input_file}"
puts duration_cmd
duration = `#{duration_cmd}`.to_f
puts "Input file duration: #{duration}"
Expand Down

0 comments on commit 197749c

Please sign in to comment.