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.

How to read and write the video input file from my system ?

Other Parts Discussed in Thread: TMS320DM6437, TVP5146

Hi,

I am very new to TMS329DM6437. I started working on this.

I would like to read the input video file which is in my system and need to get displayed on LCD .

I should use CIF format and YUV420.

Can you please someone help me how to implement this?

Your valuable information is more appreciable.

thanks in advance,

thupakula.

 

  • I believe there are demos (e.g. decode) included with the software provided that show you how to do this.

  • I am curious what format the input video file is (i.e. something compressed like h.264 or MPEG4, or a raw stream of frames)? The demo will play a compressed elementary stream, the transfer to the board in this case would be through Ethernet.

  • Dear Juan,

    I am sorry , i couldnt find how to implement the specific format in those examples... and the input file which i have is in .mpeg4 format .

    can u pls suggest how to convert this into frames.?

    thanks

     

  • @Bernie,

    I am using the input video file which is in .mpeg4. For this , i wanted to convert this into frames of YUV420 and should get displayed on the LCD and i should create an output file in my PC also.

    I am using TMS320DM6437 EVM and CCS3.3 version.

    Thanks in advance.,

    Thupakula

     

     

     

  • For just displaying a compressed file like .mpeg4 you could just use the demo application out of the box, have you tried playing your file with the demo application? Try loading the demo application by connecting to the board with CCS and loading C:\dvsdk_1_11_00_00\dm6437_demo_1_30_00\Debug\dm6437_demo.out which should provide some output on the CCS Stdout terminal including the IP address it obtains from the network. With the demo loaded and running execute C:\dvsdk_1_11_00_00\dm6437_demo_1_30_00\hostapp\run.bat to bring up the host control application for the demo, at which point you can discover and connect to the EVM board giving you control through the demo host GUI. If you then stop the board  from the demo GUI and select your particular file in the decode from file box while the board is in decode from file mode you should be able to play back the file, you can use a similar process to encode to a file to make new MPEG4 files.

    Note that if by LCD output you mean a directly connected LCD to the board (i.e. a daughter card) that you would likely have to modify the demo to work with your LCD driver instead of the default on board video output driver.

    For the output file on the PC this is something you would have to do a bit differently, the easiest way would probably be to use DVTB which is discussed in C:\dvsdk_1_11_00_00\dvtb_1_15_000\docs\dvtb-user-guide.pdf.

     

  • The Demo which is given is included the encoding and decoding. But I want to develop a pass through application which will just read the input video file from my PC and display on LCD and writes the same data in out file which will be created in my PC.

     

     

  • This would require some significant modification of the demo, unfortunately we do not have anything out of the box that will peform both operations (display on video output and save to network file) simultaneously, the demo is probably the closest we have to this so I would use that as a base to make modifications to to add the raw frame data writes to the PC.

  • Hi,

    I am developing this pass through application for just reading the input video from the camera and getting diplayed on the LCD. For this i wanted to read the input video from (J5 on the board) VIDEO IN and displaying on LCD through VIDEO OUT  on the board. could u pls let me know how to read the input video by using C code.. It would be great if i can get the c code .

     

    Thank u,

    Thupakula.

  • here I want to read the video from using memory but not the rawdata colr format

  • Thupakula said:
    I am developing this pass through application for just reading the input video from the camera and getting diplayed on the LCD. For this i wanted to read the input video from (J5 on the board) VIDEO IN and displaying on LCD through VIDEO OUT  on the board. could u pls let me know how to read the input video by using C code.. It would be great if i can get the c code .

    There are examples of this in the DVSDK, in particular you may be interested in C:\dvsdk_1_11_00_00\examples\video_preview\evmDM6437, this is about as simple as it gets for a video loopback that will take captured video from J5 and output it in analog on J2, J3, and J4, and it includes the C source as well.

    Note that if you mean a digital directly connected LCD through a daughtercard that you would have to modify the display driver to use this new hardware instead of the default analog output.

  • Thupakula said:
    here I want to read the video from using memory but not the rawdata colr format

    I am not sure what you mean by this, is this related to your prior question or is this something new? Do you mean that you have some video data already that you just want to playback as opposed to a loopback on the board?

  • In the Video_Preview eaxample,

    /* Set video display/capture driver params to defaults */
      PSP_VPFE_TVP5146_ConfigParams tvp5146Params =
           VID_PARAMS_TVP5146_DEFAULT;
      PSP_VPFECcdcConfigParams      vpfeCcdcConfigParams =
           VID_PARAMS_CCDC_DEFAULT_D1;

    Here,

     VID_PARAMS_CCDC_DEFAULT_D1 is having the color format enum defined as below

    \brief Enum for the color formats
      *
      */
    typedef enum _FVID_ColorFormat
    {
        FVID_YCbCr422_INTERLEAVED = 0,
        FVID_YCbCr422_PLANAR,
        FVID_YCrCb422_INTERLEAVED,
        FVID_RGB_888_INTERLEAVED,
        FVID_RGB565_INTERLEAVED,
        FVID_DVD_MODE,
        FVID_CLUT_INDEXED,
        FVID_ATTRIBUTE,
        FVID_CCDC_YCBCR_8,
        FVID_CCDC_RAW_FORMAT,
        FVID_COLORFORMAT_INVALID
    } FVID_ColorFormat;

     In this, I am unable to find  the color format YUV420. But i want to use this format only in my application.

  • Thupakula:

    here I want to read the video from using memory but not the rawdata colr format


    Means:  I should use the momery of DDR to allocate frames.. It was clarified by myself
  • Thupakula said:
     In this, I am unable to find  the color format YUV420. But i want to use this format only in my application.

    The display hardware only supports 4:2:2, so the drivers also only support 4:2:2, if you need to support 4:2:0 than you would need to do a software conversion from 4:2:0 to 4:2:2 before passing the frame buffer to the display.

    The frame buffers you use are allocated in DDR (as they do not typically fit elsewhere).

  • But in the above formats, is anything representing the YUV422 format ? Because iam not sure which one is  the YUV format.

  • When they say YCbCr they also mean YUV (often the terms are used interchangibly), this is sort of a terminology issue, but either way you have a luminance with subsampled chrominance in a 4:2:2 sampling pattern.

  • Thank you Bernie for the clarification..

    Do we have any examples for saving the captured frames into a file on PC?

    Thanks in advance,

    Thupakula.

     

  • I have a really old installation of DM6437 software, but there should be a video copy example

    C:\dvsdk_1_11_00_00\examples\video_copy

    This demo should read and write data to a file and will likely be a good starting point for you.

  • Thank  you  very much Juan for your information.

    Now I developed an application which will capture the video from camera and displaying the same on LCD and the oputput file is created in my PC and getting refreshed each time it gets the fresh frame.

    Now In my Application , The frames are in YUV422 format which are suuportable by the drivers. If  I want to convert them into YUV420 then should I go for Resizer or EDMA3.

    And Can you pls explain me how to implement this?

    Note:  Pls excuse me for this repeated question so many times.

    Thank u,

    Thupakula.

     

     

  • Resizer if probrably your best bet here; FYI, all VPBE and VPFE hardware blocks use a built-in video DMA engine.  I believe there are features within the resizer to let you output your data in such a way that you can input YCbCr 422 and output YCbCr 420 (by simply throwing away some of the video data) 

  • Just a quick comment here, the example Juan points out will write frames to a file on a PC and would be great to start for debugging, however it is using standard C i/o  (i.e. fopen, fwrite, etc) which operates over the JTAG emulation connection which has a couple of downsides, first that it is slow so you would not necessarily get frames in real time, and second that in an end application where you are shipping a product it is unlikely you would be shipping an emulator and CCS with the product which would be needed for the transfers. If you are looking for a higher speed and more end product shippable solution than setting up transfers over Ethernet like is done in the demo application is much more practical (though more complex to set up initially).