diff --git a/ffmpeg-myth.scm b/ffmpeg-myth.scm index d502fea..04b2292 100755 --- a/ffmpeg-myth.scm +++ b/ffmpeg-myth.scm @@ -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))))