[gst-devel] Grab video

Raseel Bhagat raseelbhagat at gmail.com
Fri Oct 8 04:38:39 CEST 2010


On Thu, Oct 7, 2010 at 11:14 PM, Gary Thomas <gary at mlbassoc.com> wrote:

> I have a camera which only produces UYUY video - caps:
>   video/x-raw-yuv, format=(fourcc)UYVY, width=(int)720, height=(int)480,
> framerate=(fraction)30/1
>
> I'd like to encode this as x264, so I tried this pipeline:
>   gst-launch -v v4l2src num-buffers=200 !
> 'video/x-raw-yuv,width=720,height=480,format=(fourcc)UYVY' !
> ffmpegcolorspace ! x264enc ! filesink location=/tmp/test.h264
>
> There are no complaints and the process seems to launch, but I
> get no data to my file.  A similar pipeline using a hardware (DSP)
> encoder on my platform works:
>   gst-launch -v v4l2src num-buffers=2000 !
> 'video/x-raw-yuv,width=720,height=480' ! TIVidenc1 codecName=h264enc
> engineName=codecServer ! filesink location=/tmp/test.h264
>
> The only difference is that I'm using ffmpegcolorspace to convert
> the data from UYUV to I420.
>
> Note: I enabled debug level 4 for ffmpeg and it produces lines
> like these:
>   0:00:11.669219616   766   0x10bf50 DEBUG       ffmpegcolorspace
> gstffmpegcolorspace.c:449:gst_ffmpegcsp_transform: from 35 -> to 0
>   0:00:11.689147594   766   0x10bf50 DEBUG       ffmpegcolorspace
> gstffmpegcolorspace.c:476:gst_ffmpegcsp_transform: from 35 -> to 0 done
>   0:00:12.354461316   766   0x10bf50 DEBUG       ffmpegcolorspace
> gstffmpegcolorspace.c:449:gst_ffmpegcsp_transform: from 35 -> to 0
>   0:00:12.368774059   766   0x10bf50 DEBUG       ffmpegcolorspace
> gstffmpegcolorspace.c:476:gst_ffmpegcsp_transform: from 35 -> to 0 done
> I'm not sure what they mean.  I also enabled debug for x264enc and
> it gave me these lines (the sizes tell me that the data coming from
> ffmpegcolorspace is not good):
>   0:00:10.976440135   774   0x10bf30 LOG                  x264enc
> :0::<x264enc0> frame=   1 QP=22.65 NAL=2 Slice:P Poc:8   I:31   P:982
>  SKIP:337  size=13873 bytes
>   0:00:11.750701609   774   0x10bf30 LOG                  x264enc
> :0::<x264enc0> frame=   2 QP=27.69 NAL=2 Slice:B Poc:4   I:0    P:129
>  SKIP:1221 size=112 bytes
>   0:00:14.098602000   774   0x10bf30 LOG                  x264enc
> :0::<x264enc0> frame=   3 QP=34.39 NAL=0 Slice:B Poc:2   I:1333 P:14
> SKIP:0    size=10943 bytes
>   0:00:14.993529978   774   0x10bf30 LOG                  x264enc
> :0::<x264enc0> frame=   4 QP=27.86 NAL=0 Slice:B Poc:6   I:3    P:63
> SKIP:1284 size=174 bytes
>
> Any ideas what I'm doing wrong?  My goal is just to compare the
> resulting encoded file between the hardware (DSP) version and the
> software (x264enc) version.
>
> One final question: I'd like to resize the data, e.g. from 720x480 to
> 360x240
> before the encode, but none of the pipelines I've tried (yes, I'm new to
> this!)
> seem to even want to run.  Mostly, I get messages about not being able to
> connect
> one endpoint to another, but I really don't understand either the messages
> or the
> process.
>

Hi Gary,

the reason you do not see the file dumped from your first pipeline, is
because by default x264enc uses packetized  stream format.

Use the "byte-stream=true" property of x264enc in your pipeline, to use a
byte-stream format containing NALUs, and you should be able to playout the
dumped file.

--
Raseel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20101008/d665eea0/attachment.htm>


More information about the gstreamer-devel mailing list