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

Parse FFMPEG streams with square brackets #1781

Merged
merged 3 commits into from
May 31, 2022
Merged

Parse FFMPEG streams with square brackets #1781

merged 3 commits into from
May 31, 2022

Conversation

B3QL
Copy link
Contributor

@B3QL B3QL commented May 30, 2022

Hikvisions CCTV recordings use custom codec which causes FFMPEG
to return stream "value" in square brackets.

Original FFMPEG issue:
https://trac.ffmpeg.org/ticket/3566

Sample files:
https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4182/

  • I have provided code that clearly demonstrates the bug and that only works correctly when applying this fix
  • I have added suitable tests demonstrating a fixed bug or new/changed feature to the test suite in tests/
  • I have properly documented new or changed features in the documentation or in the docstrings
  • I have properly explained unusual or unexpected code in the comments around it

Hikvisions CCTV recordings use custom codec which causes FFMPEG
to return stream "value" in square brackets.

Original FFMPEG issue:
https://trac.ffmpeg.org/ticket/3566

Sample files:
https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4182/
@coveralls
Copy link

coveralls commented May 30, 2022

Coverage Status

Coverage increased (+0.08%) to 84.865% when pulling 7b98b02 on TraseeHQ:b/handle-hikvision-codec into 025c3fe on Zulko:master.

@B3QL
Copy link
Contributor Author

B3QL commented May 31, 2022

@mondeja can you take a look? This should be a quick one ;) Thanks!

Copy link
Collaborator

@mondeja mondeja left a comment

Choose a reason for hiding this comment

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

Great, but in this case the language key of streams has no sense anymore:

{'audio_found': True,
 'bitrate': 266,
 'default_video_input_number': 0,
 'default_video_stream_number': 0,
 'duration': 135.0,
 'inputs': [{'input_number': 0,
             'streams': [{'bitrate': None,
                          'default': True,
                          'fps': 25.0,
                          'input_number': 0,
                          'language': '0x1e0',
                          'stream_number': 0,
                          'stream_type': 'video'},
                         {'bitrate': None,
                          'default': False,
                          'fps': 'unknown',
                          'input_number': 0,
                          'language': '0x1c0',
                          'stream_number': 1,
                          'stream_type': 'audio'}]}],
 'metadata': {},
 'start': 52874.498178,
 'video_bitrate': None,
 'video_duration': 135.0,
 'video_found': True,
 'video_fps': 25.0,
 'video_n_frames': 3375,
 'video_size': None}

Could you handle it, please? Also, would you mind to add a CHANGELOG entry? Thanks!


Attaching the sample just in case we need in the future:

Sample
Sample.mp4

@B3QL
Copy link
Contributor Author

B3QL commented May 31, 2022

Could you handle it, please? Also, would you mind to add a CHANGELOG entry? Thanks!

Done! Should I add an extra test for it or extend the test_stream_square_brackets will be sufficient?

@B3QL B3QL requested a review from mondeja May 31, 2022 09:24
Copy link
Collaborator

@mondeja mondeja left a comment

Choose a reason for hiding this comment

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

Awesome, thank you! 👍🏼

@mondeja mondeja merged commit df84762 into Zulko:master May 31, 2022
@B3QL B3QL deleted the b/handle-hikvision-codec branch May 31, 2022 10:11
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.

3 participants