ensure that I-frames have valid data

With the current ffprobe [1], time or frame numbers for an I-frame may be
output that are invalid (N/A).

[1] ffprobe version 3.4.8-0ubuntu0.2 Copyright (c) 2007-2020 the FFmpeg developers
This commit is contained in:
Leo Butler 2021-01-07 20:24:10 -06:00
parent ea76a163a8
commit 61dc6756d6
1 changed files with 2 additions and 2 deletions

View File

@ -138,13 +138,13 @@
(map (lambda(x) (drop x 2)) (mythconverg-select* "recordedmarkup" chanid starttime)))
(define (ffprobe-video-packets file filter-rule)
(let ((frame-info (ffprobe-out-parser
(shell-command-to-string (simple-format #f "~a -v error -select_streams v:0 -show_entries frame=pkt_pts_time,pkt_pos,pict_type,coded_picture_number,interlaced_frame:side_data=nil -print_format csv=nokey=1:print_section=0:s='~a' -i '~a'" ffprobe-bin ffprobe-separator file)))))
(read-from-string (filter filter-rule frame-info))))
(define (ffprobe-i-frames file)
(ffprobe-video-packets file (lambda(l) (string=? "I" (third l)))))
;; filter out bad I-frames with N/A data in either the time (1) or frame number slot (2)
(ffprobe-video-packets file (lambda(l) (and (string=? "I" (third l)) (not (string=? "N/A" (first l))) (not (string=? "N/A" (second l)))))))
(define (ffprobe-stream-info file)
(let* ((stream-info (shell-command-to-string (simple-format #f "~a -v error -show_streams -print_format csv=nokey=0:s='~a' -i '~a'" ffprobe-bin ffprobe-separator file))))