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.

OSD blending difference when using v4l2sink vs omx_ctrl/omx_videosink

We have to support custom HDMI output rates for a video decoder application on our 814x/816x app.  The gstreamer lines which use the omx_ctrl/omx_videosink combination all have a fixed display-mode=OMX_DC_MODE_*, which seem unflexable. So I changed the the rc5.d symlink to load the v4l2 firmware, by pointing to ../init.d/load-hd-v4l2-firmware.sh. Then, I can get any scaling that I need by using a capsfilter, to any custom rate that I set up with /sys/devices/platform/vpss/display0/timings.

However, I noticed a big OSD difference between gst-launch with omx_ctrl/omx_videosink and v4l2sink. For example:

1. Boot up, using load-hd-v4l2-firmware.sh.
2. kill the matrix app, so that the matrix icons stay on-screen (ARM, DSP, 2D Graphics, etc.)
3. Run the gst-launch line from the demo:

    gst-launch -v filesrc location=/usr/share/ti/data/videos/dm816x_1080p_demo.264 \
    ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! omx_scaler \
    ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink sync=false

4. Notice that the black content is transparent; the matrix icons are floating on top of video. It is as if the TIFB blend type were TI81XXFB_BLENDING_PIXEL. But it is not. In fact, I tried going back and forth between TI81XXFB_BLENDING_PIXEL and TI81XXFB_BLENDING_NO during playback - they have no effect.

Now, reboot, and try to decode a .mov file with v4lsink. (For some reason, I cannot see dm816x_1080p_demo.264 when I use v4l2sink, but an actual .mp4 or .mov file seems okay.)

0. Reboot
1. Boot up, using load-hd-v4l2-firmware.sh.
2. kill the matrix app, so that the matrix icons stay on-screen (ARM, DSP, 2D Graphics, etc.)
3. Run a v4l2sink gst-launch line:

    gst-launch -v filesrc location="/media/sda1/big_buck_bunny_1080p_h264.mov" \
    ! qtdemux ! h264parse access-unit=true ! omx_h264dec ! omx_scaler \
    ! 'video/x-raw-yuv,width=(int)1920,height=(int)1080' ! v4l2sink

4. Notice that the black content is opaque; video cannot be seen without disabling graphics0.


I noticed also that if you first play something with omx_ctrl/omx_videosink pipeline, and then switch to a v4l2sink pipeline, then the black content continues to be transparent. So I think this may mean:
- omx_ctrl/omx_videosink changes some blending setting, and does not change it back when pipeline ends.
- the v4l2sink does not undo the setting.

What magic is being done by omx_ctrl/omx_videosink to make pixel-blended OSD without changing TIFB blendtype property?

FYI, I attached the little program that I used to peek and poke the blendtype to this post.

Thanks,

Dan -

  • (For some reason, I cannot see dm816x_1080p_demo.264 when I use v4l2sink, but an actual .mp4 or .mov file seems okay.)

    I figured this out ... I neglected the sync=false.  So this issue can be reproduced without .mov file.  I.e., the second gst-launch can be:

        gst-launch -v filesrc location=/usr/share/ti/data/videos/dm816x_1080p_demo.264 \
        ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec ! omx_scaler \
        ! 'video/x-raw-yuv,width=(int)1920,height=(int)1080' ! v4l2sink sync=false

  • I think I've tracked down the difference - it looks like the omx_ctrl/omx_videosink is enabling transparency color keying, with color key of 0x000000.  Something like this:

    struct ti81xxfb_region_params regp; if (ioctl(fd, TIFB_GET_PARAMS, &regp) < 0) { perror("TIFB_GET_PARAMS\n"); close(fd); exit(1); } regp.transen = TI81XXFB_FEATURE_ENABLE; regp.transtype = TI81XXFB_TRANSP_LSPMASK_NO; regp.transcolor = 0x000000; if (ioctl(fd, TIFB_SET_PARAMS, &regp) < 0) { perror("TIFB_SET_PARAMS\n"); close(fd); exit(1); }
    Changing the alpha blending to TI81XXFB_BLENDING_PIXEL had no effect because all the black content really is opaque - it has 255 in the fourth byte.
    So ... why is transen enabled?
  • Hello Daniel,

    Did you resolve this ?
    I also tried to use TI81XXFB_BLENDING_PIXEL and it has no effect at all....


    Thanks for any idea...
    Ran
  • I don't recall - we soon thereafter abandoned the v4l mode due to real time performance issues with 1080p display.