Preserve input time base in concatenate_video_files function#2160
Closed
irisTa56 wants to merge 2 commits intohuggingface:mainfrom
Closed
Preserve input time base in concatenate_video_files function#2160irisTa56 wants to merge 2 commits intohuggingface:mainfrom
irisTa56 wants to merge 2 commits intohuggingface:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a video concatenation issue where the time base was not being preserved when concatenating video files, causing invalid DTS (decode timestamp) errors. The fix explicitly sets the time_base parameter when adding streams and updates the minimum PyAV version requirement to 15.0.0.
- Preserves input time base in video concatenation to prevent timestamp conflicts
- Updates minimum PyAV version requirement from 14.2.0 to 15.0.0 to support the time_base parameter
- Adds detailed comments explaining the time base handling logic
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/lerobot/datasets/video_utils.py | Added explicit time_base parameter and explanatory comments to preserve input stream time base during concatenation |
| pyproject.toml | Updated minimum PyAV version from 14.2.0 to 15.0.0 to support the time_base parameter |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Author
|
Closing as this change has been included in #2100. |
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.
What this does
Fixes the second error of #2158.
Effectively reverts #2133.
We cannot set
time_baseto the created stream without PyAV-Org/PyAV#1934, so I updated the minimum version of PyAV.I believe the updated requirement will not cause problems since
requirements-*.txtalready specifiesav==15.0.0, but there might be use cases requiring PyAV<15 that I am not aware of.How it was tested
With the following script (and some video file named
test.mp4):I got:
I appreciate any advice about writing unit tests if needed.
I could not find existing tests for
video_utilsmodule.How to checkout & try?
Same as the above.
Code at bf3c874 reproduces the problem as follows: