Skip to content

Commit

Permalink
Fix frame_rate for videos where ffprobe reports 0/0 (#26500)
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolaiSoeborg authored and ClearlyClaire committed Sep 19, 2023
1 parent ea83b6e commit 9c91379
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/lib/video_metadata_extractor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ def parse_metadata
@height = video_stream[:height]
@frame_rate = video_stream[:avg_frame_rate] == '0/0' ? nil : Rational(video_stream[:avg_frame_rate])
@r_frame_rate = video_stream[:r_frame_rate] == '0/0' ? nil : Rational(video_stream[:r_frame_rate])
# For some video streams the frame_rate reported by `ffprobe` will be 0/0, but for these streams we
# should use `r_frame_rate` instead. Video screencast generated by Gnome Screencast have this issue.
@frame_rate ||= @r_frame_rate
end

if (audio_stream = audio_streams.first)
Expand Down

0 comments on commit 9c91379

Please sign in to comment.