Skip to main content

Tech

color_format for uncompressed SpeedHQ and compressed H264/H265/AAC/OPUS

color_format for uncompressed SpeedHQ and compressed H264/H265/AAC/OPUS

by keven ma - Number of replies: 3

Hi there,

I am an app developer working on a VR video player. Currently, my application supports NDI video playback, but I would like to add support for H.264/H.265 videos. However, I’ve noticed that all NDIlib_recv_color_format_compressed types require handling the SpeedHQ compression format.

Is there a way for me to receive only compressed H.264/H.265 streams while allowing the NDI SDK to manage the decoding of the SpeedHQ format?

I have attached my NDI test video

https://youtu.be/n3-sb6fGjtI

Best regards

In reply to keven ma

Re: color_format for uncompressed SpeedHQ and compressed H264/H265/AAC/OPUS

by keven ma -
I don't know how to decode SpeedHQ codec. I notice there is a SpeedHQ decoder in FFmpeg, but seems like the code is not actively maintained. I thought the best way to deal with this codec is to use the built-in decoder in NDI SDK.

The color_format need to be set before creating the receiver, which means I have to guess a format before getting the actual video frame. If I set NDIlib_recv_color_format_compressed_v5_with_audio, and the real format is compressed SpeedHQ I can only discard this frame and disconnect.

Is there any color_format option that allows NDI SDK to decode SpeedHQ and only send compressed data to the app when it is H264/265?
In reply to keven ma

Re: color_format for uncompressed SpeedHQ and compressed H264/H265/AAC/OPUS

by Elias Puurunen -
As a workaround, could you subscribe to the sender, determine what kind of frames you're receiving back (i.e. H264 or SpeedHQ), then:
- If SpeedHQ, disconnect and re-establish a connection using the typical basic SDK path, which would give you YUV frames (recv_fastest)
- If H264/H265, take the compressed frames and decompress it yourself?
In reply to Elias Puurunen

Re: color_format for uncompressed SpeedHQ and compressed H264/H265/AAC/OPUS

by keven ma -
I know this works but everytime I connect to none H264/H265 ndi source I will waste 1 to 2+ seconds of connection time on Android device. If I want to decode SpeedHQ codec where can i get the source code of this coder?