# Five H.264/AVC encoded streams with SHDR and LDC enabled

Source: [https://docs.qualcomm.com/doc/80-88500-3/topic/46_Five_H264_AVC_encoded_streams_with_sHDR_and_LDC_enabled.html](https://docs.qualcomm.com/doc/80-88500-3/topic/46_Five_H264_AVC_encoded_streams_with_sHDR_and_LDC_enabled.html)

**Prerequisites**: If `disableAFDStatsProcessing` is not present in the /etc/camera/camxoverridesettings.txt, run the following command to ensure that there is `cameraoverride` setting for SHDR.

    adb shell "echo disableAFDStatsProcessing=TRUE >> 
    /etc/camera/camxoverridesettings.txt" 
    adb shell pkill qmmf-server Copy to clipboard

The following `gst-launch` pipelines provide simultaneous 5-stream video record use cases with SHDR and LDC enabled.

## One 4K, two 720p, one 480p, and one 240p, with SHDR and LDC 

    gst-launch-1.0 -e qtiqmmfsrc video_2::source-index=1 video_3::source-index=1 video_4::source-index=1 name=qmmf shdr=TRUE ! video/x-h264,format=NV12,width=3840,height=2160,framerate=30/1 ! h264parse ! mp4mux ! queue ! filesink async=true location="/data/mux1.mp4" qmmf. ! video/x-h264,format=NV12,width=1280,height=720, framerate=15/1 ! h264parse ! mp4mux ! queue ! filesink async=true location="/data/mux2.mp4" qmmf. ! video/x-h264,format=NV12,width=1280,height=720, framerate=10/1 ! h264parse ! mp4mux ! queue ! filesink async=true location="/data/mux3.mp4" qmmf. ! video/x-h264,format=NV12,width=720, height=480, framerate=10/1 ! h264parse ! mp4mux ! queue ! filesink async=true location="/data/mux4.mp4" qmmf. ! video/x-h264,format=NV12,width=320, height=240, framerate=10/1 ! h264parse ! mp4mux ! queue ! filesink async=true location="/data/mux5.mp4"Copy to clipboard

1. The `qtiqmmfsrc` element captures and encodes one 4K resolution and two 720p resolution streams from the camera and generates the remaining 480p and 240p video streams from it.
2. The `h264parse`, `mp4mux` elements process the buffers and prepare them for storage.
3. The queue elements ensure that each path/track runs independently of the other.
4. The `filesink` elements store the buffers in the corresponding file.
5. Play the content on the device.
6. To stop the use case, press CTRL + C, pull
          the recorded content from the device using the following `adb pull`
          command, and then play the content on a host PC.

        adb pull /data/mux1.mp4 
        adb pull /data/mux2.mp4 
        adb pull /data/mux3.mp4 
        adb pull /data/mux4.mp4 
        adb pull /data/mux5.mp4 Copy to clipboard

## One 4K, two 720p, one 480p, and one 240p, with SHDR and LDC

    gst-launch-1.0 -e qtiqmmfsrc video_2::source-index=1 video_3::source-index=1 video_4::source-index=1 name=qmmf shdr=TRUE ! video/x-h264,format=NV12,width=1920,height=1080,framerate=30/1 ! h264parse ! mp4mux ! queue ! filesink async=true location="/data/mux1.mp4" qmmf. ! video/x-h264,format=NV12,width=1280,height=720, framerate=15/1 ! h264parse ! mp4mux ! queue ! filesink async=true location="/data/mux2.mp4" qmmf. ! video/x-h264,format=NV12,width=1280,height=720, framerate=10/1 ! h264parse ! mp4mux ! queue ! filesink async=true location="/data/mux3.mp4" qmmf. ! video/x-h264,format=NV12,width=720, height=480, framerate=10/1 ! h264parse ! mp4mux ! queue ! filesink async=true location="/data/mux4.mp4" qmmf. ! video/x-h264,format=NV12,width=320,height=240, framerate=10/1 ! h264parse ! mp4mux ! queue ! filesink async=true location="/data/mux5.mp4"Copy to clipboard

## gst-pipeline-app

The QTI `gst-pipeline-app` is a helper tool does the following:

- Exposes the same capability as the GStreamer gst-launch-1.0 tool.
- Provides an option to set runtime properties for any GST element in the pipeline that allows property change in the PLAYING state.

The syntax is `gst-pipeline-app [OPTION?] DESCRIPTION`.

- `[OPTION?]`: The supported options are `-e` or `--eos-on-exit`, which sends the EOS event before shutting down the pipeline.
- `DESCRIPTION`: A list of elements separated by exclamation marks (!). The properties can be appended to elements in the form property = value.

When a pipeline is run, the gst-pipeline-app lists all the elements in the pipeline. If an element name was specified, then the element appears with that name. Else, the element is displayed with the default name.

1. Run the video encode pipeline to list all the elements.

        gst-pipeline-app -e qtiqmmfsrc name=qmmf camera=0 ! video/x-raw\(memory:GBM\),format=NV12,width=1920,height=1080,framerate=30/1 ! queue ! qtic2venc ! queue ! h264parse ! mp4mux ! queue ! filesink location=/data/output/mux.mp4Copy to clipboard
2. Select the element for which the property should be modified.
          
    All the properties that can be updated are listed with description. For the mentioned example, if `qtic2venc-qtic2venc0` is selected, the options shown in the figure are listed.
3. To choose the property, type the option number and the current value.

**Parent Topic:** [Recorder: Five-stream concurrency use cases](https://docs.qualcomm.com/doc/80-88500-3/topic/44_Recorder__5_stream_concurrency_use_cases.html)

Last Published: Sep 26, 2023

[Previous Topic
Five H.264 (AVC) encoded streams with SHDR enabled](https://docs.qualcomm.com/bundle/publicresource/80-88500-3/topics/45_Five_H264_AVC_encoded_streams_with_sHDR_enabled.md) [Next Topic
Camera static parameter use case: LDC and SHDR](https://docs.qualcomm.com/bundle/publicresource/80-88500-3/topics/47_Camera_static_parameter.md)