This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[MCSDK Video] How to run multi instances of H264 encoder PCIe demo?

I would like to use MCSDK video PCIe demo(sv04) to encode multi video stream concurrently.
I have tried set one encoder to run on core 0,1 and the other one run on core 2,3.
The first encoding process can run correctly and then I start the second process but it can't work.
The two encoding tasks can work independently, but can't work simultaneously.
Does the demo application support multi instances?
How can I achieve this purpsoe?
Thanks a lot.

Test Environment:
OS: Ubuntu 12.04.1 LTS 64bit
DSP: DSPC-8681E
SDK: mcsdk_video_02_01_00_03, desktop-linux-sdk_01_00_00_04
Encoder: C66x_h264venc_01_24_01_01_ELF

Best Regards,
Harvey

  • Hi Harvey, latest MCSDK video release (mcsdk_video_02_01_00_08) provides multichannel capabilities. Please see instructions link below:

    http://processors.wiki.ti.com/index.php/MCSDK_VIDEO_2.1_PCIE_Demo_Guide#Multi-Channel_Support_for_Concurrent_Encoding.2FDecoding

    MCSDK video download page: http://software-dl.ti.com/sdoemb/sdoemb_public_sw/mcsdk_video/latest/index_FDS.html 

    SDK download page: http://software-dl.ti.com/sdoemb/sdoemb_public_sw/desktop_linux_sdk/latest/index_FDS.html

    Using a MCSDK video H.264 HP PCI demo on a DSPC-8681 you could have up to 4 concurrent channels. Each channel runs on a different DSP.

    Please let us know if you have further questions.

    Thank you,

    Paula

     

  • Hi Paula,

    Thank you for your reply.
    4-channel H264HP encoder can work after following the instructions.
    I have 2 futher questions:
    1. Each channel must run on different DSP. Is it a limitation or have any other way to run multi-channel on single DSP?
    2. According to the multi-channel demo instructions, multi-channel encoders are configured, created and start simultaneously.
       Can I run multiple encoder instances on different DSP independently and concurrently?

    Best Regards,
    Harvey

  • Hi Harvey,

    1. Each channel must run on different DSP. Is it a limitation or have any other way to run multi-channel on single DSP?

    -  SV04 is a single-channel DSP build. In order for it to support multiple channels, significant code changes are required.


    2. According to the multi-channel demo instructions, multi-channel encoders are configured, created and start simultaneously.
       Can I run multiple encoder instances on different DSP independently and concurrently?

    - Yes, multi-channel support  is actually independent and concurrent on each DSP

    thank you,

    Paula

  • Hi Paula,

    About question 2, Is it support running multiple demo applications that map to cores of different DSP respectively?
    I created 2 demo scripts "demoSave2File_DSP1.sh" mapping to core 0,1,2,3  and "demoSave2File_DSP2.sh" mapping to core 8,9,10,11.
    Then, ran "demoSave2File_DSP1.sh" and when the process was running I ran "demoSave2File_DSP2.sh".
    After starting "demoSave2File_DSP2.sh" ,the first process got hung.
    Please help to check my usage.
    Thank you.

    ==============================================================================
    multiClip.cfg
    ---------------
    ../testVecs/input/SF4_1280x720.yuv
    ../testVecs/output/SF4_1280x720.264
    2584

    ==============================================================================
    multiClip2.cfg
    ------------------
    ../testVecs/input/SF4_1280x720.yuv
    ../testVecs/output/SF4_1280x720_2.264
    2584

    ==============================================================================
    demoSave2File_DSP1.sh
    --------------------------------
    CLIP_CONFIG=multiClip.cfg
    CODEC_PARAMS=codecParams.cfg
    $MCSDK_VIDEO_HOSTBIN_DIR/demo_c667x -v -a H264HPENC -f $CLIP_CONFIG -c $CODEC_PARAMS -t "0 1 2 3" --width=1280 --height=720

    ==============================================================================
    demoSave2File_DSP2.sh
    --------------------------------
    CLIP_CONFIG=multiClip2.cfg
    CODEC_PARAMS=codecParams.cfg
    $MCSDK_VIDEO_HOSTBIN_DIR/demo_c667x -v -a H264HPENC -f $CLIP_CONFIG -c $CODEC_PARAMS -t "8 9 10 11" --width=1280 --height=720


    Best Regards,
    Harvey

  • Hi Harvey, you would have to build to demo_c667x  executables with separate subset of buffers. As a quick example I built demo_c667x_v2 (as-is, I just changed the output name in the makefile). Using demo_c667x and demo_c667x_v2 I could run demoSave2File_DSP1.sh and demoSave2File_DSP2.sh without any process hunging. For this test I used two different input YUVs, the output clips, as expected, are mixed images from both input . Anyhow, you would need to check I/O buffer distribution.

    Thank you,

    Paula

  • Hi Paula,

    In my case, even I built demo_c677x and demo_c677x2(without modified source code) and used different input YUVs and output clips, the first process was still hanging.
    As you mentioned, I need to make the processes use separate subset of buffers.
    Could you explain more detail about what buffers need to separate and how can I need to modify it.
    Should I modify createBufferPools() in demoBufferPools.c or any other function?
    If you can provide a sample patch that would be a great help.
    Thank you.

    Best Regards,
    Harvey

  • Hi Harvey, could you share what is printed in the console that hangs? also  did you use source setDemoEnv.sh for each console that you are using?

    thanks,

    Paula

  • Hi Paula,

    Yes, I have used "source setDemoEnv.sh" on each console.
    Please check  attached logs "DSP1.log" and "DSP2.log".
    When I start the second process, the first process got hung, the last log is
    "[DEBUG] FileReaderThread(1) : Iter = 0, Clip = ./SF4_1280x720.yuv, Frame = 205 / 500, Size = 1382400".
    I used Ctrl+C to terminate it.

    Best Regards,
    Harvey

    7167.DSP1.log
    7713.DSP2.log

  • Hi Harvey but from logs it looks like you should have output .264 files for both channels, is this correct?

    Thanks,

    Paula

  • Hi Paula,

    Yes, both channels have output .264 files.
    But the output file of first process is incomplete, because it stop output frame after second process starting.

    Best Regards,
    Harvey

  • Hi Harvey,

    I was discussing your request with the MCSDK video developers and the comments were that we cannot start two processes on X86 as the PCIe driver will be shared. There can be only one demo_c677x process on X86. Also, each channel will have its own fileReader, fileWriter threads and its own scheduler. And for each scheduler it should be a unique set of chips. For current Sv04 a single chip cannot be shared between two channels.

    I hope this clarify your query.

    Thank you,

    Paula