Forums

Solved problem:how to player a h264 file generated by a gst pipeline?you must package h264 into a container file

  • hi,

    as i known,2011Q2RRSDK can support mt9p031,however,

    my Leopard board could register mt9p031 and could not capture video from mt9p031 in 2011Q2RRSDK.

    i search in web and find there are some similar post in using mt9p031,i think i am not alone.

    when i run gstreamer pipeline ,it show these error :

    / # gst-launch v4l2src chain-ipipe=true always-copy=false ! "video/x-raw-yuv,for

    mat=(fourcc)NV12, width=1280,height=720,framerate=(fraction)23/1" ! dmaiaccel !

    TIDmaiVideoSink videoStd=PRGB sync=false enable-last-buffer=false

    Setting pipeline to PAUSED ...

    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124

    vpfe-capture vpfe-capture: IPIPE Chained

    vpfe-capture vpfe-capture: Resizer present

    vpfe-capture vpfe-capture: standard not supported

    Pipeline is live and does not need PREROLL ...

    WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to set norm for device '/dev/video0'.

    Additional debug info:

    ../../../src/sys/v4l2/v4l2_calls.c(743): gst_v4l2_set_norm (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

    system error: Invalid argument

    WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Video input device did not accept new frame rate setting.

    Additional debug info:

    ../../../src/sys/v4l2/v4l2src_calls.c(342): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

    sydavinci_v4l2 davinci_v4l2.1: Before finishing with S_FMT:

    layer.pix_fmt.bytesperline = 1280,

    layer.pix_fmt.width = 1280,

    layer.pix_fmt.height = 720,

    layer.pix_fmt.sizeimage =1382400

    stem error: Invadavinci_v4l2 davinci_v4l2.1: pixfmt->width = 1280,

    layer->layer_info.config.line_length= 1280

    lid argument

    Setting pipeline to PLAYING ...

    New clock: GstSystemClock

    ^CCaught interrupt -- handling interrupt.

    Interrupt: Stopping pipeline ...

    Execution ended after 24010683462 ns.

    Setting pipeline to PAUSED ...

    Setting pipeline to READY ...

    Setting pipeline to NULL ...

    Freeing pipeline ...

    mt9p031 could not setnorm and accept frame rate argument.why could not mt9p031 do it.it is error of gstreamer ,or error from kernel driver of mt9p031?could anyone give a light.

    thanks

    whose mt9p031 could capture video sucessfully by gstreamer pipeline in 2011Q2RRSDK?Could anyone post the message of uart output when runing a gst pipeline?

     

  • The only problem with your pipe is that the kernel is showing some messages that it shouldn't, but your pipe is working fine.

    It finished because you ctrl+c it. Those messages are show by the kernel because the v4l2 plugin is trying to run some commands for setting standards that doesn't apply to sensors, just to devices like tcp that capture television standards.

    Why do you say you can't capture? Looks like you should be seeing something on the screen...

    Diego

  • hi Diego

    i appreciated for your answer.and i say mt9p031 can't capture because i use a pipeline to get a h264 file.But i can't play the file by 2011 Mplayer in windows.later,i use another gst pipeline to capture a jpg by mt9p031, the jpg is black.I think mt9p031 could not be driven correctly.so i say that.

    the first gst pipeline is

    gst-launch v4l2src chain-ipipe=true always-copy=false ! "video/x-raw-yuv,for

    mat=(fourcc)NV12, width=1280,height=720,framerate=(fraction)23/1" ! dmaiaccel !d

    maienc_h264! filesink location=a.264

    Setting pipeline to PAUSED ...

    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124

    vpfe-capture vpfe-capture: IPIPE Chained

    vpfe-capture vpfe-capture: Resizer present

    vpfe-capture vpfe-capture: standard not supported

    Pipeline is live and does not need PREROLL ...

    WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to set norm for device '/dev/video0'.

    Additional debug info:

    ../../../src/sys/v4l2/v4l2_calls.c(743): gst_v4l2_set_norm (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

    system error: Invalid argument

    WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Video input device did not accept new frame rate setting.

    Additional debug info:

    ../../../src/sys/v4l2/v4l2src_calls.c(342): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

    system error: Invalid argument

    Setting pipeline to PLAYING ...

    New clock: GstSystemClock

    ^CCaught interrupt -- handling interrupt.

    Interrupt: Stopping pipeline ...

    Execution ended after 16503533790 ns.

    Setting pipeline to PAUSED ...

    Setting pipeline to READY ...

    Setting pipeline to NULL ...

    Freeing pipeline ...

    and i get a.h264,i play a.h264 in 2011 Mplayer in windowsxp.Mplayer shows

    command line:
    "C:\Program Files\MPlayer for Windows\mplayer.exe" -slave -identify
    -noquiet -wid 2426228 -colorkey 0x101010 -nokeepaspect -framedrop
    -autosync 100 -vf screenshot -font C:\WINDOWS\Fonts\Arial.ttf -priority
    abovenormal -ao dsound:device=0 -sws 9 -af volnorm=2
    C:\TDDOWNLOAD\tftpd32.400\tftpd32.400\a.264

    MPlayer Sherpya-SVN-r33488-4.2.5 (C) 2000-2011 MPlayer Team
    Setting process priority: abovenormal


    Playing C:\TDDOWNLOAD\tftpd32.400\tftpd32.400\a.264.
    H264-ES file format detected.
    ID_VIDEO_ID=0
    parse_es: could not sync video stream!
    Video: Cannot read properties.
    No stream found.


    Exiting... (End of file)
    ID_EXIT=EOF

    So ,i say i can't capture.

    and i also use another gst pipeline to capture a jpg file by mt9p031.i can get a jpg file but jpg is black.

    / # gst-launch v4l2src chain-ipipe=true always-copy=false ! "video/x-raw-yuv,for

    mat=(fourcc)UYVY, width=1280,height=720" ! ffmpegcolorspace ! dmaienc_jpeg ! fil

    esink location=720P_jpeg_file.jpg

    Setting pipeline to PAUSED ...

    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124

    vpfe-capture vpfe-capture: IPIPE Chained

    vpfe-capture vpfe-capture: Resizer present

    vpfe-capture vpfe-capture: standard not supported

    Pipeline is live and does not need PREROLL ...

    WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to set norm for device '/dev/video0'.

    Additional debug info:

    ../../../src/sys/v4l2/v4l2_calls.c(743): gst_v4l2_set_norm (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

    system error: Invalid argument

    WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Video input device did not accept new frame rate setting.

    Additional debug info:

    ../../../src/sys/v4l2/v4l2src_calls.c(342): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

    system error: Invalid argument

    Setting pipeline to PLAYING ...

    New clock: GstSystemClock

    ^CCaught interrupt -- handling interrupt.

    Interrupt: Stopping pipeline ...

    Execution ended after 19091818212 ns.

    Setting pipeline to PAUSED ...

    Setting pipeline to READY ...

    Setting pipeline to NULL ...

    Freeing pipeline ...

    So ,i want to know what is wrong with me.what player would i use could play a h264 file from dm365?

    Thank you very much again.

    best regards

  • Well please try to be specific in your posts. "I can't capture"  is not the same as "I can't reproduce a file that I recorded", or "I see a black jpeg when I encoded".

    About the video files: you need a container format. RAW h264 files are only playable by a handful of players like VLC, but only if they are in NAL unit format.

    You need to put a video mixer after the encoder, try with qtmux, and add the -e flag, and use the .mov extension:

     gst-launch -e v4l2src chain-ipipe=true always-copy=false ! "video/x-raw-yuv,format=(fourcc)NV12, width=1280,height=720,framerate=(fraction)23/1" ! dmaiaccel ! dmaienc_h264 ! qtmux ! filesink location=a.mov

    About the problem with the jpeg: that's strange, seems like your pipe is fine. Maybe your sensor has some problem. Are your running the AEW demo library? (check the documentation)

    Diego

  • hi Diego

    i appreciated for your answer.I have changed my post title.thank you very much.your gst pipeline is very helpful for me.you give me more clear idea about h264 pipeline.

    i have found the image captured by mt9p031 is slightly blacker in normal light condition.i would like test RR SDK AEW (demo version).

    thank you again.

    best regards

     

    jonny

     

  • dear diego

    i m using composite video input using li-vi365

    for test as specified in the wiki page i m giving command

    FILE_NAME=a.mp4

    gst-launch -e v4l2src input-src=composite always-copy=false num-buffers=1000

    ! 'video/x-raw-yuv,format=(fourcc)NV12, width=640, height=480,pitch=736' ! queu

    e ! dmaiaccel ! dmaienc_h264 encodingpreset=2 ratecontrol=4 ! qtmux ! filesink l

    ocation=$FILE_NAME

    and i m getting output

    Setting pipeline to PAUSED ...                                                                                                                                                                

    davinci_resizer davinci_resizer.2: RSZ_G_CONFIG:0:1:124                                                                                                                                        

    vpfe-capture vpfe-capture: IPIPE Chained                                                                                                                                                      

    vpfe-capture vpfe-capture: Resizer present                                                                                                                                                    

    Pipeline is live and does not need PREROLL ...                                                                                                                                                

    WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Video input device did not accept new frame rate setting.                                                                    

    Additional debug info:                                                                                                                                                                        

    ../../../src/sys/v4l2/v4l2src_calls.c(342): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:                                                                            

    system error: Invalid argument                                                                                                                                                                

    Setting pipeline to PLAYING ...                                                                                                                                                                

    New clock: GstSystemClock  

    there is a file created a.mp4 but its showing 434 kb and not playing anywhere

    after New clock: GstSystemClock  

    the pipeline shows nothing and never stopped

    till i apply ctrl+c

    please sort it out

    kailash