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.

DM368: vertical black lines on the video output

I've succeed in recording analogical video (Component ) in 720p60, 1080p30 and 1080i60.

The video files created ( only H264ES frame ) are displayed with Linux Player without any error: the picture is full displayed. This test demonstrate the video is good recorded.

When I play back these files, the output video displays a vertical black lines: 24 blanking pixels at each beginning of line and so not the full picture is displaedy. Lost of 25 pixels at end of each line ( shift ). In the program I've just noticed that the black pixel are issued from H264 decoder ( vdec2_process() function ) .

Has somebody an idea to solve this problem ?

  • Hi,

    There will be padded lines at boundaries of the frame. These padded pixels required for decoder to decode the stream. So while displaying the stream you should considering this.

    And decoder returns the correct ptr of buffer to be display, you shuld use codec returned buffer pointer(from outargs) to display. It will be something like outArgs->displayBufs[display_marker].bufDesc[0].buf

    And also please have a look at testapp provided with decoder codec package.

    Thanks,

    Veeranna

  • Hi Veeranna 

    Thank you for your quick answer ... but I need more details ...

    I use :

    ret = Vdec2_process(g_hVd2, hBuffFrameH264in, hBuffFullHDPictureOUT);

    I do EITHER :

    hBufVideoForDisplay = Vdec2_getDisplayBuf( g_hVd2 );

    Display_put( hDisplay, hBufVideoForDisplay) ;

    OR:

    Display_put( hDisplay, hBuffFullHDPictureOUT) ;


    I use Display_create() to create my ouptut display ...

    I don't kow where is the parameter : outArgs->displayBufs[display_marker].bufDesc[0].buf ?


  • Hi

    Are you using DMAI framework?. I suggest you to run file IO based testapp provided with decoder. It will give more idea which frame is going for display and when.

    Thanks,

    Veeranna

  • Hi,

    I use DMAI framework and the demos programs : encode and decode softwares, supplied in TI DVSDK.

    I down't know what is  IO based testapp provided with decoder ?


    thanks,

    Delphine

  • Hi,

    You can find test application at /dvsdk_x_xx_xx_xx/dm365_codecs_xx_xx_xx/packages/ti/sdo/codecs/h264dec/apps

    It uses file read/write do show the decoder functionality.


    Thanks,

    Veeranna

  • Hi,

    I use DMAI framework and the demos programs : encode and decode softwares, supplied in TI DVSDK.

    I succeed to delete vertical black line by modifying the buffer returned by vdec2_process() :

    UInt8 *ptrVidOut;

    int VideoLine=0;

    BufferGfx_resetDimensions(hBufVideoForDisplay);

    Vdec2_process(g_hVd2, hBufVideoH264_1080, hBufVideoForDisplay);

    ptrVidOut = Buffer_getUserPtr( hBufVideoForDisplay );

    for(VideoLine=0; VideoLine<1080*2; VideoLine++)
            memcpy( &ptrVidOut[VideoLine*1984], &ptrVidOut[VideoLine*1984+24], 1920 );

    Display_put(g_HandleDisplay, hBufVideoForDisplay);

    But this memcpy take a lot of time !!!!

    Has somebody better solution to display directly the good region of interrest of the buffer retrun by Vdec2_process ?

  • GARRO,

    You can avoid this by inserting an offset in the display driver (OSD driver). Also you might have to adjust the line offset as well.

  • Hello,

    Thanks you for these information: do you speak about davinci_osd.c driver ?

    I have already call this function in davinci_plateform.c driver, this is call for 1080i30 output display:

    dispc_reg_out(OSD_VIDWIN0XP, 0);
    dispc_reg_out(OSD_VIDWIN0YP, 0);


    osd_write_left_margin(200);//  if 175 , there are 25 white pixels at end of each line, if >200: no output display
    osd_write_upper_margin(30);// 30 = OK

    //Synchro image / Synchro trame ...
    dispc_reg_out(VENC_HSDLY, 0);
    dispc_reg_out(VENC_VSDLY, 0);

    dispc_reg_out(VENC_HSTART, 200);// 200 = OK

    dispc_reg_out(VENC_HSPLS, 63);// 63 ou 76 = OK, 79 = full white picture
    dispc_reg_out(VENC_HINT, 2200-1); //2200-1

    I already look this driver and i haven't found where modify this offset: could you give me more indormatinos, please ?

  • Garro,

    You can start with BASEX, BASEY, and you can try video window offsets etc.. There are many registers, I'm not sure which one exactly is going to solve this. But I believe BASEX should do.

  • Hello,

    I could'nt give negative offset to delete 24 pixels from H264 frame. And 24 pixels aren't modulo 32 as asked in plenty value of register.

    Because 24 pixels are issued from Vdec2_process() funcrion : why ? Why does this function not return good picture, X position aligned from offset  0 ?

  • Garro,

    As Veranna mentioned in his previous post the decoder needs some padding for every line as its storing some information in those bytes.

    Have you tried modifying BASEX register?

  • Hello,

    I modiify  OSD_BASEPX register thanks to osd_write_left_margin() function . If offset is 175, 24 white appears at end of each line, and if offset is 200 , there are 24 blacks pixels at beginning of the line, and if offset is greather than 200, there is no more display: no video at output ...


    Perhaps I need to modify the number of useful pixel per line for OSD interface (not for synchro line) : not 1920 pixels , but 1944 pixels?

  • Garro,

    You'll have to try changing line offset of the video window.

  • Hello,

    I've modified line offset thanks to OSD_VIDWIN0OFST register.

    DEFAULT VALUES:  ( 24 blacks pixels at the beginning of line )

                OSD_VIDWIN0OFST = 62

                OSD_VIDWIN0XP = 0

                OSD_VIDWIN0XL = 1920          ( line length = 1984 pixels) 

    VALUES MODIFIED:

                OSD_VIDWIN0OFST = 61   or OSD_VIDWIN0OFST=63

    This register add an offsfet modulo 32 pixels. And all line at screen are no more aligned: line shift, more and more from the beginning of the picture.

    When I modified the position of the Windows, there are more blacks pixels ( 48 pixels per line instead of 24)

                OSD_VIDWIN0OFST = 62

                OSD_VIDWIN0XP = 24

    Have I modify the good registers ? Have you an other idea ?

  • Garro,

    I need to spend some time in reading to identify the exact registers. But if you try different values in the following registers it should improve.

    VIDWIN0XP
    VIDWIN0YP
    VIDWIN0XL
    VIDWIN0YL

    VIDWIN0OFST

    BASEPX
    BASEPY

  • Dear Thomas,

    All this parameters move the entire picture coded in H264 frame: they doesn't define the usefull pixel in the H264 frame. Theses registers define usefull windows compared with synchro signals . I have already all intiate to display the good area at screen.

    When I generate colors bars, the video is well displayed, without any black pixels ...

                                                 dispc_reg_out(VENC_VDPRO,  0x0100); // Normal mode, et colorbars

    How to avoid blank pixels derived  from H264 decoder ?

  • Garro,

    After starting from a given pixel it OSD goes to next line by incrementing the start address + line offset. In your case line offset will be (XRES + PADDING) x bytes per pixel. 

    Can you set that value to the line offset register? And then try moving around other offsets.