GStreamer Compositor Application¶
Introduction¶
The sample compositor program located at /opt/amd/ama/ma35/bin/gstreamer/
is a command line utility which implements the GStreamer video transcoding pipeline described in the diagram below. This application expects four input video files 60(mp4 with H.264/H.265 or H.264/H.265 elementary stream). The resolution of each input cannot exceed 1080p. The application creates an output stream by first composing the four inputs in a 2x2 grid, then by adding an optional logo and lastly by inserting a time stamp.
This application is installed through the amd-ama-gstreamer package. If this package is not present on your system, install it by following the steps described in the package feed page. The source code for this application is also available under, /opt/amd/ama/ma35/examples/gstreamer/ama_xcompositor
.
Host System Requirement¶
AMD AMA Video SDK
amd-ama-gstreamer package
Usage¶
Parameter |
Description |
---|---|
-f |
mp4/elementary-stream file path. Resolutions up to 1080p are supported.
Type: string
Range: NA
Default: NA
Option: Mandatory
|
-l |
png/jpg logo file path. No logo will be overlayed if this option is not specified.
Type: string
Range: NA
Default: Null
Option: Optional
|
-b |
Max bitrate for encoder in Kbps
Type: int
Range: 0 to 4294967295
Default: 5000
Option: Optional
|
-i |
device index
Type: int
Range: 0 to 31
Default: 0
Option: Optional
|
-h |
Horizontal offset of overlay logo in fractions of video image width, from top-left corner of video image (in relative positioning)
Type: double
Range: 0 to 1
Default: 0.9
Option: Optional
|
-v |
Vertical offset of overlay logo in fractions of video image height, from top-left corner of video image (in relative positioning)
Type: double
Range: 0 to 1
Default: 0
Option: Optional
|
-n |
Number of input buffers
Type: integer
Range: 20 to 2147483647
Default: 2000
Option: Optional
|
-o |
Output file name and path
Type: String
Range: NA
Default: ./result.mp4
Option: Optional
|
Examples¶
Composition along with logo on top right of video:
ama_xcompositor -f ./video1.mp4 -f ./video2.mp4 -f ./video3.h264 -f ./video4.h265 -l ./logo.png
Composition with logo on top left of video:
ama_xcompositor -f ./video1.mp4 -f ./video2.mp4 -f ./video3.h264 -f ./video4.h265 -l ./logo.png -h 0 -v 0
Composition with logo on center of video:
ama_xcompositor -f ./video1.mp4 -f ./video2.mp4 -f ./video3.h264 -f ./video4.h265 -l ./logo.png -h 0.5 -v 0.5
Composition without logo layer:
ama_xcompositor -f ./video1.mp4 -f ./video2.mp4 -f ./video3.h264 -f ./video4.h265
Composition on device with index 2:
ama_xcompositor -f ./video1.mp4 -f ./video2.mp4 -f ./video3.h264 -f ./video4.h265 -i 2
Composition on decoder soft kernel start index at 8:
ama_xcompositor -f ./video1.mp4 -f ./video2.mp4 -f ./video3.h264 -f ./video4.h265