Fix ffprobe output parsing and unquoted paths in shell commands - #30
Open
pradeepreddycv wants to merge 1 commit into
Open
Fix ffprobe output parsing and unquoted paths in shell commands#30pradeepreddycv wants to merge 1 commit into
pradeepreddycv wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two robustness fixes for real-world inputs:
utils/probe.py — robust duration parsing. get_video_duration runs ffprobe
with stderr=subprocess.STDOUT, folding decoder warnings (e.g.
"[h264 @ ...] time_scale/num_units_in_tick invalid or unsupported") into
stdout, then calls float(result.stdout) — raising "could not convert string
to float" on files with noisy-but-valid metadata. Switched to
stderr=subprocess.PIPE + text=True and parse the numeric line via regex.
(Same fragility as ffprobe returns error on mpeg-ts inputs #29.)
utils/video_reader.py — quote paths in shell commands. load_video_1p0 and
load_video_1p5 build ffmpeg commands as f-strings run under shell=True with
the video path unquoted, so any path containing a space breaks with
"No such file or directory". Wrapped all interpolated paths in shlex.quote().
Test: ran inference on a clip with malformed timing metadata under a directory
containing a space — fails on main, succeeds with these changes.