Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable MPEG4 GPU decoding #4327

Merged
merged 2 commits into from
Oct 25, 2022
Merged

Enable MPEG4 GPU decoding #4327

merged 2 commits into from
Oct 25, 2022

Conversation

JanuszL
Copy link
Contributor

@JanuszL JanuszL commented Oct 10, 2022

  • enables MPEG4 support in the GPU frame decoder
    without index

Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com

Category:

New feature (non-breaking change which adds functionality)

Description:

  • enables MPEG4 support in the GPU frame decoder
    without index

Additional information:

Affected modules and functionalities:

  • frames decoder for the GPU

Key points relevant for the review:

  • NA

Tests:

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
      • CfrFrameRateMpeg4NoIndex
      • VfrFrameRateMpeg4NoIndex
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: DALI-3038

@JanuszL JanuszL marked this pull request as draft October 10, 2022 14:26
@JanuszL JanuszL force-pushed the enable_mpeg4 branch 4 times, most recently from a4c13c5 to f31a9ca Compare October 11, 2022 16:48
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6150118]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6150118]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6156570]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6156570]: BUILD FAILED

@JanuszL JanuszL force-pushed the enable_mpeg4 branch 2 times, most recently from 1593e69 to 0637df9 Compare October 12, 2022 11:31
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6158066]: BUILD FAILED

@JanuszL JanuszL marked this pull request as ready for review October 13, 2022 08:13
@JanuszL JanuszL changed the title Enable mpeg4 Enable MPEG4 GPU decoding Oct 13, 2022
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6168512]: BUILD STARTED

@JanuszL
Copy link
Contributor Author

JanuszL commented Oct 13, 2022

Needs NVIDIA/DALI_extra#108

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6168512]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6168587]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6168587]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6171107]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6171107]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6173380]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6173380]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6180038]: BUILD STARTED

if (init_codecs) {
for (size_t i = 0; i < av_state_->ctx_->nb_streams; ++i) {
av_state_->codec_params_ = av_state_->ctx_->streams[i]->codecpar;
av_state_->codec_ = avcodec_find_decoder(av_state_->codec_params_->codec_id);
Copy link
Contributor

@awolant awolant Oct 14, 2022

Choose a reason for hiding this comment

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

I know that this new code path with init_codecs is needed here, because this call fails for AV_CODEC_ID_MPEG4. Do you know why it does?
We compile FFMPEG without libxvid because it is GPL but there is this other native mpeg4 thing. Our build of FFMPEG does not include it but maybe it should? We could avoid this new code path and we would be able to have this working in other scenarios as well (like CPU, indexed).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Our build configuration doesn't list anything with mpeg in the name in the Enabled decoders: list. I guess we would need to use "--enable-gpl" or "--enable-nonfree" but we can't due to the license.
If we move to a solution where we can use the libaviutils the user may have installed separately we can lose that limitation.
Still, this code path should be better as we avoid unnecessary codec initialization on the CPU.

Copy link
Contributor

Choose a reason for hiding this comment

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

I will investigate, if we need "--enable-gpl" or "--enable-nonfree". We need it for libxvid but I am not 100% that we need it for native mpeg4 decoder. Is that fine?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest to merge this PR and enable mpeg4 support for CPU separately as the GPU support is more important for us.

Copy link
Contributor

Choose a reason for hiding this comment

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

#4361 should cover both CPU and GPU MPEG-4 Part2 decoding.

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6180038]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6181414]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6181414]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6181609]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6181609]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6183020]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6183020]: BUILD PASSED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6184428]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6184428]: BUILD PASSED

@awolant awolant mentioned this pull request Oct 15, 2022
18 tasks
- enables MPEG4 support in the GPU frame decoder
  without index

Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
@JanuszL
Copy link
Contributor Author

JanuszL commented Oct 19, 2022

!build

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6230031]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6230031]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [6230031]: BUILD PASSED

@JanuszL JanuszL merged commit 3b9139d into NVIDIA:main Oct 25, 2022
@JanuszL JanuszL deleted the enable_mpeg4 branch October 25, 2022 15:07
@JanuszL JanuszL mentioned this pull request Jan 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants