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.

Black screen from encoded video: v4l2 encoding/decoding using Gstreamer

Other Parts Discussed in Thread: TVP7002

Hi I am using DM816x-EVM, and boot with load-hd-v4l2-firmware.sh. I am using SD card boot built from SDK v5.04.

I am feeding video into Y Pr Pb port on the daughter board, and when I typed the following pipeline I got these messages. I am not sure if all the messages appeared before " perf0: frames: 63       current: 62.73   average: 62.73 arm-load: 27" are okay. Could you take a look?


PRCM Initialization completed
SysLink version : 2.10.03.20
SysLink module created on Date:Apr 29 2012 Time:20:45:11
FIRMWARE: I2cInit will be done by M3
FIRMWARE: Memory map bin file not passed
Usage : firmware_loader <Processor Id> <Location of Firmware> <start|stop> [-mmap <memory_map_file>] [-i2c <0|1>]
===Mandatory arguments===
<Processor Id>         0: DSP, 1: Video-M3, 2: Vpss-M3
<Location of Firmware> firmware binary file
<start|stop>           to start/stop the firmware
===Optional arguments===
-mmap                  input memory map bin file name
-i2c                   0: i2c init not done by M3, 1(default): i2c init done by M3
FIRMWARE: isI2cInitRequiredOnM3: 1
FIRMWARE: Default memory configuration is used
MemCfg: DCMM (Dynamically Configurable Memory Map) Version :  2.1.2.1
FIRMWARE: Memory Configuration status : In Progress
FIRMWARE: 1 start Successful
Loading HDVPSS (V4L2) Firmware
FIRMWARE: Memory map bin file not passed
Usage : firmware_loader <Processor Id> <Location of Firmware> <start|stop> [-mmap <memory_map_file>] [-i2c <0|1>]
===Mandatory arguments===
<Processor Id>         0: DSP, 1: Video-M3, 2: Vpss-M3
<Location of Firmware> firmware binary file
<start|stop>           to start/stop the firmware
===Optional arguments===
-mmap                  input memory map bin file name
-i2c                   0: i2c init not done by M3, 1(default): i2c init done by M3
FIRMWARE: isI2cInitRequiredOnM3: 0
FIRMWARE: Default memory configuration is used
MemCfg: DCMM (Dynamically Configurable Memory Map) Version :  2.1.2.1
FIRMWARE: Memory Configuration status : In Progress
FIRMWARE: 2 start Successful
tvp7002 2-005d: tvp7002 found @ 0x5d (OMAP I2C adapter)
tvp7002 2-005d: Rev. 02 detected.
ti81xxvin ti81xxvin: registered sub device tvp7002
ti81xxvin ti81xxvin: TI81xx HDVPSS Capture driver initialized
HDMI W1 rev 2.0
Starting system message bus: dbus.
Starting telnet daemon.
Starting syslogd/klogd: done
Starting thttpd.
Starting PVR
Starting Matrix GUI application.

 _____                    _____           _         _   
|  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_
|     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
|__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
              |___|                    |___|            

Arago Project http://arago-project.org dm816x-evm ttyO2

Arago 2011.09 dm816x-evm ttyO2

dm816x-evm login: root
root@dm816x-evm:~# echo 0 > /sys/devices/platform/vpss/graphics0/enabled
root@dm816x-evm:~# echo 0 > /sys/devices/platform/vpss/graphics1/enabled
root@dm816x-evm:~# lsmod
Module                  Size  Used by
bufferclass_ti          4950  0
omaplfb                10794  0
pvrsrvkm              155594  2 bufferclass_ti,omaplfb
ti81xxhdmi             16163  0
ti81xxvin              20388  0
tvp7002                 6405  1
ti81xxvo               21210  0
ti81xxfb               21979  3
vpss                   75009  5 omaplfb,ti81xxhdmi,ti81xxvin,ti81xxvo,ti81xxfb
syslink              1119122  0
ipv6                  209855  12
root@dm816x-evm:~# gst-launch -e v4l2src always-copy=false queue-size=12 num-buffers=3000 ! 'video/x-raw-yuv-strided,format=(fourcc)NV12,width=1280,height=720,framerate=(fraction)20/1' ! omxbufferalloc numBuffers=12 ! omx_h264enc bitrate=5000000 ! gstperf ! filesink location=v4l2cap.h264
Setting pipeline to PAUSED ...

 Mode set is 1080
allocating 12 buffers of size:1382400!!
allocated outbuf:0x43fd5080
allocated ------------[ cut here ]------------
WARNING: at kernel/softirq.c:159 local_bh_enable+0x54/0xc4()
Modules linked in: bufferclass_ti omaplfb pvrsrvkm ti81xxhdmi ti81xxvin tvp7002 ti81xxvo ti81xxfb vpss syslink ipv6
Backtrace:
[<c0049bb8>] (dump_backtrace+0x0/0x110) from [<c039b7d4>] (dump_stack+0x18/0x1c)
 r7:00000000 r6:c0072fb8 r5:c0465b10 r4:0000009f
[<c039b7bc>] (dump_stack+0x0/0x1c) from [<c006da3c>] (warn_slowpath_common+0x54/0x6c)
[<c006d9e8>] (warn_slowpath_common+0x0/0x6c) from [<c006da78>] (warn_slowpath_null+0x24/0x2c)
 r9:c0516d04 r8:d708c800 r7:0000000e r6:d3637c00 r5:c04f0590
r4:c0542040
[<c006da54>] (warn_slowpath_null+0x0/0x2c) from [<c0072fb8>] (local_bh_enable+0x54/0xc4)
[<c0072f64>] (local_bh_enable+0x0/0xc4) from [<c0067934>] (omap_mbox_msg_send+0xcc/0xdc)
 r5:c04f0590 r4:00000000
[<c0067868>] (omap_mbox_msg_send+0x0/0xdc) from [<c02dc724>] (notify_shm_drv_send_event+0x1c8/0x208)
 r5:00000001 r4:00000000
[<c02dc55c>] (notify_shm_drv_send_event+0x0/0x208) from [<c02d9eb4>] (notify_send_event+0x114/0x26c)
[<c02d9da0>] (notify_send_event+0x0/0x26c) from [<bf18fa08>] (vps_fvid2_queue+0xe4/0x21c [vpss])
[<bf18f924>] (vps_fvid2_queue+0x0/0x21c [vpss]) from [<bf198cfc>] (capture_queue+0x50/0x64 [vpss])
 r8:bf1d1414 r7:60000013 r6:d1cd6080 r5:00000000 r4:d1c6a400
[<bf198cac>] (capture_queue+0x0/0x64 [vpss]) from [<bf1d01d4>] (ti81xxvin_buffer_queue+0x9c/0xe8 [ti81xxvin])
 r5:d1c6f400 r4:d1c6a400
[<bf1d0138>] (ti81xxvin_buffer_queue+0x0/0xe8 [ti81xxvin]) from [<c02b3614>] (videobuf_streamon+0x80/0xd0)
 r7:60000013 r6:d1c6f5c4 r5:d1c6f504 r4:d1cd6080
[<c02b3594>] (videobuf_streamon+0x0/0xd0) from [<bf1cfc4c>] (vidioc_streamon+0x244/0x400 [ti81xxvin])
 r7:d1c7c400 r6:00000001 r5:d1c6f400 r4:d1c6f504
[<bf1cfa08>] (vidioc_streamon+0x0/0x400 [ti81xxvin]) from [<c02a8f1c>] (__video_do_ioctl+0x1618/0x3f34)
 r6:40045612 r5:00000000 r4:00000001
[<c02a7904>] (__video_do_ioctl+0x0/0x3f34) from [<c02a76f4>] (__video_usercopy+0x2e4/0x428)
[<c02a7410>] (__video_usercopy+0x0/0x428) from [<c02a7868>] (video_ioctl2+0x30/0x38)
[<c02a7838>] (video_ioctl2+0x0/0x38) from [<c02a68a8>] (v4l2_ioctl+0xe8/0x11c)
 r5:d1c7c400 r4:d1cd6f80
[<c02a67c0>] (v4l2_ioctl+0x0/0x11c) from [<c00d305c>] (vfs_ioctl+0x28/0x44)
 r9:cf110000 r8:00021268 r7:0000001c r6:0000001c r5:d1cd6f80
r4:00000000
[<c00d3034>] (vfs_ioctl+0x0/0x44) from [<c00d376c>] (do_vfs_ioctl+0x500/0x540)
[<c00d326c>] (do_vfs_ioctl+0x0/0x540) from [<c00d3804>] (sys_ioctl+0x58/0x7c)
[<c00d37ac>] (sys_ioctl+0x0/0x7c) from [<c0045e00>] (ret_fast_syscall+0x0/0x30)
 r8:c0045fa8 r7:00000036 r6:00021250 r5:00020500 r4:00203f60
---[ end trace 3bf35c8b9327a32a ]---
outbuf:0x44126880
allocated outbuf:0x44278080
allocated outbuf:0x443c9880
allocated outbuf:0x4451b080
allocated outbuf:0x4466c880
allocated outbuf:0x447be080
allocated outbuf:0x4490f880
allocated outbuf:0x44a61080
allocated outbuf:0x44bb2880
allocated outbuf:0x44d04080
allocated outbuf:0x44e55880
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
perf0: frames: 63       current: 62.73   average: 62.73 arm-load: 27
perf0: frames: 124      current: 60.23   average: 61.48 arm-load: 7
perf0: frames: 184      current: 59.72   average: 60.89 arm-load: 7
perf0: frames: 245      current: 60.23   average: 60.73 arm-load: 15
perf0: frames: 305      current: 59.72   average: 60.53 arm-load: 5
perf0: frames: 366      current: 60.23   average: 60.48 arm-load: 7
perf0: frames: 426      current: 59.72   average: 60.37 arm-load: 8
perf0: frames: 487      current: 60.23   average: 60.35 arm-load: 1
perf0: frames: 547      current: 59.73   average: 60.28 arm-load: 5
perf0: frames: 608      current: 60.23   average: 60.28 arm-load: 7
perf0: frames: 669      current: 59.75   average: 60.23 arm-load: 8
perf0: frames: 730      current: 60.23   average: 60.23 arm-load: 5
perf0: frames: 791      current: 59.76   average: 60.19 arm-load: 4
perf0: frames: 852      current: 60.23   average: 60.20 arm-load: 8
perf0: frames: 913      current: 60.23   average: 60.20 arm-load: 6
perf0: frames: 973      current: 59.72   average: 60.17 arm-load: 7
perf0: frames: 1034     current: 60.23   average: 60.17 arm-load: 3
perf0: frames: 1094     current: 59.73   average: 60.15 arm-load: 8
perf0: frames: 1155     current: 60.24   average: 60.15 arm-load: 4
perf0: frames: 1215     current: 59.72   average: 60.13 arm-load: 3
perf0: frames: 1276     current: 60.23   average: 60.14 arm-load: 6
perf0: frames: 1336     current: 59.72   average: 60.12 arm-load: 7
perf0: frames: 1397     current: 60.23   average: 60.12 arm-load: 6
perf0: frames: 1457     current: 59.72   average: 60.11 arm-load: 7
perf0: frames: 1518     current: 60.23   average: 60.11 arm-load: 5
perf0: frames: 1579     current: 59.75   average: 60.10 arm-load: 8
perf0: frames: 1640     current: 60.24   average: 60.10 arm-load: 4
perf0: frames: 1701     current: 59.75   average: 60.09 arm-load: 9
perf0: frames: 1762     current: 60.23   average: 60.09 arm-load: 6
perf0: frames: 1823     current: 60.23   average: 60.10 arm-load: 8
perf0: frames: 1883     current: 59.72   average: 60.09 arm-load: 5
perf0: frames: 1944     current: 60.23   average: 60.09 arm-load: 9
perf0: frames: 2004     current: 59.72   average: 60.08 arm-load: 6
perf0: frames: 2065     current: 60.23   average: 60.09 arm-load: 11
perf0: frames: 2125     current: 59.71   average: 60.07 arm-load: 7
perf0: frames: 2186     current: 60.25   average: 60.08 arm-load: 5
perf0: frames: 2246     current: 59.72   average: 60.07 arm-load: 9
perf0: frames: 2307     current: 60.23   average: 60.07 arm-load: 3
perf0: frames: 2367     current: 59.72   average: 60.07 arm-load: 6
perf0: frames: 2428     current: 60.23   average: 60.07 arm-load: 43
perf0: frames: 2489     current: 59.75   average: 60.06 arm-load: 6
perf0: frames: 2550     current: 60.23   average: 60.07 arm-load: 7
perf0: frames: 2611     current: 59.76   average: 60.06 arm-load: 6
perf0: frames: 2672     current: 60.21   average: 60.06 arm-load: 5
perf0: frames: 2733     current: 60.23   average: 60.07 arm-load: 6
perf0: frames: 2793     current: 59.74   average: 60.06 arm-load: 11
perf0: frames: 2854     current: 60.24   average: 60.06 arm-load: 2
perf0: frames: 2914     current: 59.72   average: 60.06 arm-load: 6
perf0: frames: 2975     current: 60.23   average: 60.06 arm-load: 5
Recieved EOS event, press <CTRL+C> to terminate pipeline.
Got EOS from element "pipeline0".
Execution ended after 50019783144 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
root@dm816x-evm:~#

After this, I tried to check the encoded file by using the following pipeline. But I could see the screen blinks once right after I typed Enter key, and shows nothing( black screen). I am not sure if this is because initial encoding process went wrong or my display pipleline code is wrong. I copied the encoded file into other PC and played it with VLC, and it also shows just black screen. It seems encoding process went wrong? Could anyone tell me how to fix this problem? Your reply would be much appreciated.

root@dm816x-evm:~# gst-launch -v filesrc location=v4l2cap.h264 ! 'video/x-h264' ! h264parse access-unit=true ! omx_h264dec !  omx_scaler ! omx_ctrl display-mode=OMX_DC_MODE_1080P_60 ! omx_videosink sync=false
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-h264, framed=(boolean)false
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, framed=(boolean)false
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, framed=(boolean)false, stream-format=(string)byte-s0
/GstPipeline:pipeline0/GstOmxH264Dec:omxh264dec0.GstPad:sink: caps = video/x-h264, framed=(boolean)false, stream-format=(string)byt0
/GstPipeline:pipeline0/GstOmxH264Dec:omxh264dec0.GstPad:sink: caps = video/x-h264, framed=(boolean)false, stream-format=(string)byt0
/GstPipeline:pipeline0/GstOmxH264Dec:omxh264dec0.GstPad:src: caps = video/x-raw-yuv-strided, width=(int)1280, height=(int)720, form1

(gst-launch-0.10:1394): GStreamer-CRITICAL **: _gst_util_uint64_scale_int: assertion `denom > 0' failed
/GstPipeline:pipeline0/GstOmxScaler:omxscaler0.GstPad:sink: caps = video/x-raw-yuv-strided, width=(int)1280, height=(int)720, forma1
/GstPipeline:pipeline0/GstOmxScaler:omxscaler0.GstPad:sink: caps = video/x-raw-yuv-strided, width=(int)1280, height=(int)720, forma1
/GstPipeline:pipeline0/GstOmxScaler:omxscaler0.GstPad:src: caps = video/x-raw-yuv, width=(int)1280, height=(int)720, format=(fourcce
/GstPipeline:pipeline0/GstOmxBaseCtrl:omxbasectrl0.GstPad:src: caps = video/x-raw-yuv, width=(int)1280, height=(int)720, format=(foe
/GstPipeline:pipeline0/GstOmxBaseCtrl:omxbasectrl0.GstPad:sink: caps = video/x-raw-yuv, width=(int)1280, height=(int)720, format=(fe
/GstPipeline:pipeline0/GstOmxVideoSink:omxvideosink0.GstPad:sink: caps = video/x-raw-yuv, width=(int)1280, height=(int)720, format=e
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Recieved EOS event, press <CTRL+C> to terminate pipeline.
Recieved EOS event, press <CTRL+C> to terminate pipeline.
Got EOS from element "pipeline0".
Execution ended after 49730582000 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
/GstPipeline:pipeline0/GstOmxVideoSink:omxvideosink0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstOmxBaseCtrl:omxbasectrl0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstOmxBaseCtrl:omxbasectrl0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstOmxScaler:omxscaler0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstOmxScaler:omxscaler0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstOmxH264Dec:omxh264dec0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstOmxH264Dec:omxh264dec0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = NULL
Setting pipeline to NULL ...
Freeing pipeline ...
root@dm816x-evm:~#

  • Hi,

    Kernel dumps are because of bug in V4L2 capture driver. You can ignore them for now.  Can you try playing encoded bit-stream on VLC media player and make sure that capture+encode is working properly.

    Regards,

    Hardik Shah

  • Thanks for your reply Hardik,

    I have tried to play the encoded file(.h264 extension) on VLC and i can see only black screen is played.  It seems that it is actually encoding black image although I m sure the Y Pr Pb video image is feed properly. ( I separately checked the video source image on my TV's Y Pr Pb port.) Can it be a improper cap filter(video/x-raw-yuv.....stuff) usage issue?

  • I am also womdering if there is any condition in video source resolution and frame rate that i should use for certain cap filters. Or can cap filters take any format of video source and is the filter only contributing output video format from the filter? 

    Does the cap filter for omx encoding have to be video/x-raw-yuv-strided,format=(fourcc)NV12 and framerate=(fraction)20/1? t

  • Hi Hardik.

    Now it is working!!! I found that I made a sily mistake. I plugged the ports beside Y Pr Pb port.. Anyway I can now see the video is displayed.

    Can I ask one more question Hardik?

    I actually want to feed higher resolution to the board (1920 x 1080p60). But if I want to do so, can I just change the pipeline like below?

    root@dm816x-evm:~# gst-launch -e v4l2src always-copy=false queue-size=12 num-buffers=3000 ! 'video/x-raw-yuv-strided,format=(fourcc)NV12,width=1920,height=1080,framerate=(fraction)20/1' ! omxbufferalloc numBuffers=12 ! omx_h264enc bitrate=5000000 ! gstperf ! filesink location=v4l2cap.h264

    If so, do I need to match the resolution of video source with the resolution in the pipeline code?

    Thanks a lot~!


  • It seems like I need to actually feed the same resolution. I tried and it works.

    Thanks~

  • Yes,

    Resolution feed in should match what is give to pipeline. Its tested upto 1920X1080P60 resolution.

    Regards,

    Hardik Shah