Removed Sections
Supported Video Formats
The NDI Encode and Decode FPGA cores support a variety of standard and custom in-memory video formats for 4:2:2 and 4:2:0 YUV video. Planar alpha is also supported for 4:2:2 formats. For further details, see the generate_video() routine in src/cpp/ndi_encode/video_pattern.cpp.
UYVY
4:2:2 Packed 8-bit
Addr : Component
00 : U0
01 : Y0
02 : V0
03 : Y1
...YUYV
4:2:2 Packed 8-bit, Y first
Addr : Component
00 : Y0
01 : U0
02 : Y1
03 : V0
...NV16
4:2:2 Semi-planar 8-bit - luma then packed chroma
UYVW
4:2:2 Packed 16-bit (custom format) - 16-bit version of UYVY
Y216
4:2:2 Packed 16-bit, Y first - 16-bit version of YUYV
P216
4:2:2 Semi-planar 16-bit - luma then packed chroma
420
4:2:0 Packed 8-bit (custom format) - Macroblock interleaved, 16 pixels of Y followed by 8 pixels of U (even lines) or V (odd lines)
NV12
4:2:0 Semi-planar 8-bit - Luma then packed chroma
420W
4:2:0 Packed 16-bit (custom format) - Macroblock interleaved, 16 pixels of Y followed by 8 pixels of U (even lines) or V (odd lines)
P016
4:2:0 Semi-planar 16-bit - Luma then packed chroma
Video output process flow:
video_playback::pull_frames thread
Wait for vertical sync interrupt:
video_playback::pull_framesPull a frame from the NDI FrameSync Instance:
network_recv::get_video()Copy video frame to reserved memory region visible by hardware:
video_decode::add_frame()Push copied frame onto NDI Decode queue:
video_decode::add_frame()Free video frame acquired from the NDI FrameSync Instance
video_decode::decode_frames thread
Wait for new frame to decode
Setup hardware to decode NDI frame into raw video data:
video_decode::decode_frame()Start hardware decoding:
video_decode::post_frame()Wait for interrupt
Queue the raw frame for display:
video_playback::send_frame()The frame will display after the next vertical sync
Software Applications
ndi_encode
This is an example application illustrating the use of the FPGA based NDI encoder with the Advanced NDI SDK. For full details and a theory of operation covering the entire system (software, hardware, and OS), refer to the top-level README file.
Usage
The ndi_encode program is simply launched from the command line, eg:
Note that this will launch the version installed in /usr/local/bin/. Alternatively, the program can be run from the build directory. Note that root permissions are required so it is necessary to use sudo:
Run Time Commands
Once running, the program will listen for commands on stdin. These commands are intended to modify the running behavior of the program and illustrate how to integrate with a separate utility monitoring the physical video input source (eg: an HDMI or SDI input) as a signal is acquired, locked, or lost. The commands which change the raw video parameters (resolution, frame rate, format, alpha) only apply when running in pattern generator mode.
start | stop
Start or stop streaming video and audio. This would correspond with the acquisition (start) or loss (stop) of a stable signal.
720 | 1080 | 4k
Change the video resolution
24 | 25 | 30 | 50 | 60
Set the primary video frame rate
1000 | 1001
Set the secondary frame rate: 1000=exact (eg: 60.00), 1001=NTSC (eg: 59.94)
UYVY | YUYV | NV16 | UYVW | Y216 | P216 | 420 | NV12 | 420W | P016
Set the raw video format
Alpha+ | Alpha-
Enable / Disable alpha (4:2:2 modes only)
exit
Quit the program
Command Line Options
Various command line switches are available to control the program's behavior:
General Options
Set default video resolution
-1 1080p60 (default)
-7 720p60
-4 4Kp60
Video options
-P Pattern generator
Use the built-in pattern generator instead of live video input.
-v Increase verbosity
Output more detailed information. This switch may be provided multiple times to further increase the debugging output. The available levels are:
Fatal
Error (default)
Warning
Information
Debugging
-q Decrease verbosity (quiet)
Decrease the amount of output generated. This switch may be provided multiple times. See the discussion of -v (above) for details.
Audio Options
-h HDMI input
Use embedded audio from the HDMI stream.
-l Line input
Use analog audio input.
-p Pattern generator
The audio input hardware includes a simple saw-tooth pattern generator that can be used as an input source for testing.
Debugging and Advanced Options
-X Disable video capture
This disables the video capture thread. No video frames will be captured, compressed, or sent to the NDI stack. Only audio will be processed.
-x Disable audio capture
This disables the video capture thread. No audio samples will be captured, compressed, or sent to the NDI stack. Only video will be processed.
-F Full resolution capture only
This option disables the preview stream and only sends full resolution frames to the NDI stack.
-f fflush() after each log message
This is useful if the application is crashing to insure log error messages actually reach the terminal.
-A Use ACP
-B Bypass ACP
These options do nothing on the current Zynq development boards and only apply to Cyclone-V based platforms.
ndi_decode
This is an example application illustrating the use of the FPGA based NDI decoder with the Advanced NDI SDK. For full details and a theory of operation covering the entire system (software, hardware, and OS), refer to the top-level README file.
Usage
The ndi_decode program is simply launched from the command line, eg:
Note that this will launch the version installed in /usr/local/bin/. Alternatively, the program can be run from the build directory. Note that root permissions are required so it is necessary to use sudo:
sudo /path/to/workdir/ndi_receive
Command Line Options
Various command line switches are available to control the program's behavior:
General Options
-s
<NDI Source>Specify NDI source to stream. If this setting is not provided, ndi_receive will attempt to connect to the first NDI source it finds on the network.
Set output video resolution
-1 1080p (default)
-7 720p
-4 4Kp
Set output video framerate
-6 60 Hz (default)
-5 50 Hz
Select output video
-k Output key (alpha) data if available instead of image data
Select SDRAM burst mode
-b Disable SDRAM burst mode (e.g., 1 macroblock to SDRAM per burst transfer). Default behavior is to burst 4 macroblocks to SDRAM per burst transfer.
-o
<output format>Specifies the output video format, where
output formatis one of the enumeratedvideo_format_tvalues inhardware.hin decimal. The default is packed 4:2:2 (e.g., UYVY).
Debugging and Advanced Options
-v Increase verbosity
Output more detailed information. This switch may be provided multiple times to further increase the debugging output. The available levels are:
Fatal
Error (default)
Warning
Information
Debugging
-q Decrease verbosity (quiet)
Decrease the amount of output generated. This switch may be provided multiple times. See the discussion of -v (above) for details.
-f fflush() after each log message
This is useful if the application is crashing to insure log error messages actually reach the terminal.
-A Use ACP
-B Bypass ACP
These options do nothing on the current Zynq development boards and only apply to Cyclone-V based platforms.
-c
<capture file>
Allows for individual frames to be captured to the filesystem. This switch is intended for debugging purposes and assumes that the stride is equal to the length of a row of image data. The default is to capture frame number 25, but this can be modified using the -n argument to select a different value. No more than one frame can be captured at a time.
-n
<frame capture number>
If capturing video frames, indicates the frame number to capture (defaults to 25). Requires the use of the -c option to capture frames.
NDI Utilities
This directory contains utilities helpful for debugging or initial testing of the FPGA hardware. For full details and a theory of operation covering the entire system (software, hardware, and OS), refer to the top-level README file.
ndi_reg Utility
This utility allows reading and writing of the NDI hardware registers. To read an NDI register, provide the register address on the command line:
To write an NDI register, provide the register address and write data on the command line:
For details on register settings, refer to the corresponding software and hardware files (detailed in the top-level README file). Refer to the following table for the base addresses of the various hardware functions:
NDI Encoder Core 0
0x000
NDI Encoder Core 1
0x040
NDI Encoder Core 2
0x080
NDI Encoder Core 3
0x0c0
NDI Decoder Core 0
0x100
NDI Decoder Core 1
0x140
NDI Decoder Core 2
0x180
NDI Decoder Core 3
0x1c0
Video Input
0x200
Preview Input
0x210
Audio Input
0x220
Video Tracking
0x230
Video Output
0x280
Audio Output
0x290
Version (Date)
0x3fe
Version (Revision)
0x3ff
Last updated
Was this helpful?

