LabVIEW Automotive Ethernet

cancel
Showing results for 
Search instead for 
Did you mean: 

AVTP Compressed Video Format Example

This example demonstrates how to encode and decode AVTP Compressed Video Format (CVF) packets carrying MJPEG data.

 

The CVF MJPEG Encode VI mimics an AVTP CVF talker by packetizing a compressed video stream, encoding the image data into CVF MJPEG packets, and transmitting the packets over a network. The compressed video stream is created by reading an AVI file containing an MJPEG video stream. The video frame rate is communicated by the talker using timestamps; subsequent video frames have AVTP Timestamps that are (Frames Per Nanosecond)-1 apart. Note that the timestamps inserted into the packets for this example are not true IEEE 802.1AS timestamps but start arbitrarily from 0.

 

Similarly, the CVF MJPEG Decode VI mimics an AVTP CVF listener by defragmenting the CVF MJPEG packets, reconstructing the video frame in LabVIEW, and displaying the frame based on the difference between frame timestamps. The current implementation of decoding the video stream in LabVIEW is computationally-expensive and therefore most machines cannot keep up with standard video frame rates for HD video in real-time. A frame buffer must be used to maintain the proper frame rate. It is recommended to use the short sample video included in the Video Files folder for this example. Note that these examples are not intended to be a thorough representation of an AVTP CVF talker/listener as described in IEEE Std 1722-2016 but rather a proof-of-concept and to demonstrate the encode/decode VIs for this AVTP packet format.

 

This example is supported on Windows only, but the underlying encode/decode Vis for the CVF MJPEG format can be run on Linux RT targets.

 

Packet Format

The Compressed Video Format (CVF) specified in IEEE Std 1722-2016 provides an AVTP packet format for streaming video. The encapsulation style makes use of the payload format which is already defined in the Real-time Transport Protocol (RTP) for streaming video. This example uses the MJPEG format, but CVF also defines AVTP encapsulations for H.264 and JPEG 2000 formats. The Internet Engineering Task Force (IETF) specifies the payload definitions for MJPEG over RTP in RFC 2435. As shown below, MJPEG CVF Data Units are made of the CVF header (containing the AVTP timestamp) combined with the RTP/JPEG payload specified in RFC 2435 (from byte 24 onward).CVF .png

 

 

 

For more information about CVF, refer to IEEE Std 1722-2016, available for purchase at www.ieee.org.

The RFC 2435 standard is available at https://tools.ietf.org/html/rfc2435.

 

The contents of the ZIP are shown below:

cvfExampleZipContents.PNG

Download All
Message 1 of 6
(8,236 Views)

Hello MarcusB,

 

Thanks for sharing this examples, I just started to investigate this automotive ethernet stuff due do further requirements, the question I have is in regards to the hardware requirements (PhysicalL)

Is it possible to use these libraries to communicate with an actual DUT with AVTP using a ethernet board 100BASET(PXIe-8234) and a media converter 100BASE-T1 - BroadR Reach? Something similar to the image below:

 

Thanks for your support in advance

 

 

 

0 Kudos
Message 2 of 6
(7,992 Views)

Hi,

 

Yes, using a media converter, you should be able to communicate with a DUT with AVTP with the setup you describe. Note that these examples do not support Stream Reservation Protocol (SRP) nor some of the time-sensitive networking features of AVTP such as generalized Precision Time Protocol (gPTP). For transmitting and receiving AVTP packets outside of a time-sensitive application, these examples should provide enough capability.

0 Kudos
Message 3 of 6
(7,980 Views)

I will also add that NI has just released a 100BASE-T1 Media Converter, the IVN-8561, which can be used with these examples.

0 Kudos
Message 4 of 6
(7,974 Views)

Thank you Marcus, I am going to start evaluating the code, I hope I will be giving a feedback after that, thanks.

0 Kudos
Message 5 of 6
(7,958 Views)

Does anyone how to handle the video payload when it is H.264 encoded?

Using an ActiveX plugin of VLC mediaplayer I can play H.264 encoded video files, but how to connect the video playload of Marcus example to the plugin? Or is there some other alternative?

0 Kudos
Message 6 of 6
(6,297 Views)