GStreamer i.MX6 Encoding

cancel
Showing results for 
Search instead for 
Did you mean: 

GStreamer i.MX6 Encoding

GStreamer i.MX6 Encoding

Audio, from a filegst-launch filesrc location=test.wav ! wavparse ! mfw_mp3encoder ! filesink location=output.mp3
Audio Recording

gst-launch alsasrc num-buffers=$NUMBER blocksize=$SIZE ! mfw_mp3encoder ! filesink

location=output.mp3

# where

#     duration = $NUMBER*$SIZE*8 / (samplerate *channel *bitwidth)

# Example: 60 seconds recording

#

gst-launch alsasrc num-buffers=240 blocksize=44100 ! mfw_mp3encoder ! filesink location=output.mp3

#

# To verify that is correct, do a normal audio playback

gst-launch filesrc location=output.mp3 typefind=true ! beepdec ! audioconvert ! 'audio/x-raw-int,channels=2' ! alsasink

Video, from a test sourcegst-launch videotestsrc ! queue ! vpuenc ! matroskamux ! filesink location=./test.avi
Video, from a file

gst-launch filesrc location=sample.yuv blocksize=$BLOCK_SIZE ! 'video/x-raw-yuv,format=(fourcc)I420, width=$WIDTH, height=$HEIGHT, framerate=(fraction)30/1' ! vpuenc codec=$CODEC ! matroskamux ! filesink location=output.mkv sync=false

# where

#     BLOCK_SIZE = WIDTH * HEIGHT * 1.5

#     CODEC = 0(MPEG4), 5(H263), 6(H264) or 12(MJPG).

#

# For example, encoding a CIF raw file

gst-launch filesrc location=sample.yuv blocksize=152064 ! 'video/x-raw-yuv,format=(fourcc)I420, width=352, height=288, framerate=(fraction)30/1' ! vpuenc codec=0 ! matroskamux ! filesink location=sample.mkv sync=false

Video, from Web camera

# when the web cam is connected, the device node /dev/video0 should be present. In order to test the camera, without encoding

gst-launch v4l2src ! mfw_v4lsink

# in recording, run:

#
gst-launch v4l2src num-buffers=-1 ! queue max-size-buffers=2 ! vpuenc codec=0 ! matroskamux ! filesink location=output.mkv sync=false

#

# where sync=false indicates filesink to to use a clock sync

#

# In case a specific width/height is needed, just add the filter caps

gst-launch v4l2src num-buffers=-1  ! 'video/x-raw-yuv,format=(fourcc)I420, width=352, height=288, framerate=(fraction)30/1' ! queue ! vpuenc codec=0 ! matroskamux ! filesink location=output.mkv sync=false

#

# In case you want to see in the screen what the camera is capturing, add a tee element

#

gst-launch v4l2src num-buffers=-1 ! tee name=t ! queue ! mfw_v4lsink t. ! queue ! vpuenc codec=0 ! matroskamux ! filesink location=output.mkv sync=false

Video, from Parallel/MIPI camera

# The camera driver needs to be loaded before executing the pipeline, refer to the BSP document to see which driver to load

# MIPI (J5 port):

modprobe ov5640_camera_mipi

modprobe mxc_v4l2_capture

 

# Parallel (J9 port):

modprobe ov5642_camera

modprobe mxc_v4l2_capture

 

gst-launch mfw_v4lsrc ! queue ! vpuenc codec=0 ! matroskamux ! filesink location=output.mkv sync=false

 

# Do a 'gst-inspect mfw_v4lsrc' or 'gst-inspect vpuenc' to see other possible settings (resolution, fps, codec, etc.)

Labels (3)
Comments

Hi,

I'm using boundary device sabreLite and when trying to record video from ov5640 mipi,Its show some error.

command:

gst-launch mfw_v4lsrc ! queue ! vpuenc codec=0 ! matroskamux ! filesink location=output.mkv sync=false

output msg:

MFW_GST_V4LSRC_PLUGIN 3.0.8 build on Sep 23 2014 05:49:17.

Setting pipeline to PAUSED ...

[INFO] Product Info: i.MX6Q/D/S

vpuenc versions :smileyhappy:

  plugin: 3.0.8

  wrapper: 1.0.38(VPUWRAPPER_ARM_LINUX Build on Sep 23 2014 05:42:43)

  vpulib: 5.4.15

  firmware: 2.3.10.40778

Pipeline is live and does not need PREROLL ...

Setting pipeline to PLAYING ...

New clock: GstSystemClock

ERROR: from element /GstPipeline:pipeline0/MFWGstV4LSrc:mfwgstv4lsrc0: Internal data flow error.

Additional debug info:

gstbasesrc.c(2625): gst_base_src_loop (): /GstPipeline:pipeline0/MFWGstV4LSrc:mfwgstv4lsrc0:

streaming task paused, reason error (-5)

Execution ended after 9999770667 ns.

Setting pipeline to PAUSED ...

Setting pipeline to READY ...

Setting pipeline to NULL ...

Freeing pipeline ...

-----------------------------------------------------------------------------------------------------------------------------------

But when i include capture-mode

gst-launch mfw_v4lsrc  capture-mode=4 ! queue ! vpuenc codec=0 ! matroskamux ! filesink location=output.mkv sync=false

ls -al

-rwxr-xr-x  1 root root 10476028 Oct 13  2014 output.mkv

When i try to open in vlc, its showing like a image(photo) not a running video.

Please hep me out.

-Sridhar

Strange. Do you see the same behavior using gplay to reproduced the recorded video? gplay runs on target.

Is there command for Video/Audio recording? Thank you.

Version history
Revision #:
1 of 1
Last update:
‎09-28-2012 01:04 PM
Updated by: