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

Support SEI side_data parsing #723

Open
choice17 opened this issue Nov 19, 2020 · 0 comments
Open

Support SEI side_data parsing #723

choice17 opened this issue Nov 19, 2020 · 0 comments
Labels

Comments

@choice17
Copy link

@choice17 choice17 commented Nov 19, 2020

Overview

Thank you for developing/maintaining pyav!
I would like to make a feature request to support sei side data parsing for h264 hevc.

Existing FFmpeg API

FFmpeg is now support SEI type side_data for 4.3
https://github.com/FFmpeg/FFmpeg/blame/master/libavutil/frame.h#L187

However, there is no such enum / definition for SEI.

https://github.com/PyAV-Org/PyAV/blob/main/av/sidedata/sidedata.pyx#L18

Expected PyAV API

Example:
Refer to motion vector side data example in
https://github.com/PyAV-Org/PyAV/blob/main/tests/test_decode.py#L53
def frame_iter(video):
    #streams = [s for s in video.streams if s.type == b'video']
    #print(streams)
    streams = video.streams.video
    for packet in video.demux(streams):
        print(packet, packet.buffer_size, packet.buffer_ptr,dir(packet))
        for frame in packet.decode():
            yield frame


video = av.open(sys.argv[1])
print(video, video.streams.video)

frames = frame_iter(video)
for frame in frames:
	sei = frame.side_data.get(av.AV_FRAME_DATA_SEI_UNREGISTERED)
        print(sei.data)
  • FFmpeg:
version 4.3.X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant