Skip to content

Conversation

@bjuncek
Copy link
Contributor

@bjuncek bjuncek commented Sep 16, 2022

Draft implementation for the VideoReader API.
This would allow the usage of the new API without the necessity to have own FFMPEG installation, but instead would only rely on having PyAV installed.

Copy link
Contributor

@jdsgomes jdsgomes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on it. In general looks good, so I just left a few comments

],
)
def test_metadata(self, video_file):
torchvision.set_video_backend("cuda")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we run this just once for all tests in this file since they all supposed to run with the cud backend?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. Let me try out :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason that failed (putting it in a class header) so I'll keep it as is, and then re-do the tests later.

device = torch.device("cuda")
self._c = torch.classes.torchvision.GPUDecoder(path, device)
return
if not _has_video_opt():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we still need this inside the elif self.backend == "video_reader" bellow right?

temp_str = self.container.streams.get(**self.pyav_stream)[0]
offset = int(round(time_s / temp_str.time_base))
if not keyframes_only:
warnings.warn("Accurate seek is not implemented for pyav backend")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR, but do you have plans to add accurate seek in PyAV?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but in a roundabout way.
(I need to do it manually)

@datumbox
Copy link
Contributor

FYI @YosuaMichael will be cutting the release branch on Monday. Is your intention to try to merge prior?

@bjuncek
Copy link
Contributor Author

bjuncek commented Sep 30, 2022

@datumbox let's not do it, it is missing accurate seek so it would make more sense to do it for the next one (and hopefully sort some other woes along the way).

@datumbox
Copy link
Contributor

@bjuncek Agreed. Makes sense to me to delay to avoid release issues.

@bjuncek bjuncek changed the title [draft] Pyav backend for VideoReader API Pyav backend for VideoReader API Oct 20, 2022
@bjuncek
Copy link
Contributor Author

bjuncek commented Oct 20, 2022

Hi @jdsgomes .

If this looks ok, let's try to merge it.
I'll add the precise seek in later PR to avoid the clutter

Copy link
Contributor

@jdsgomes jdsgomes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM I agree that precise seek can be added in a follow up PR

@jdsgomes
Copy link
Contributor

Checked the latest changes looks good to me.

@jdsgomes jdsgomes merged commit 2e83352 into pytorch:main Oct 31, 2022
@github-actions
Copy link

Hey @jdsgomes!

You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py

jdsgomes added a commit to jdsgomes/vision that referenced this pull request Nov 3, 2022
NicolasHug added a commit to NicolasHug/vision that referenced this pull request Nov 4, 2022
@NicolasHug NicolasHug added the revert(ed) For reverted PRs, and PRs that revert other PRs label Nov 4, 2022
NicolasHug added a commit that referenced this pull request Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed module: io module: video revert(ed) For reverted PRs, and PRs that revert other PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants