LINUX.ORG.RU

gstreamer: конвертация YUV в mpeg


0

0

Задача сконвертировать video/x-raw-yuv,width=640,height=480,framerate=30/1,format=(fourcc)YUY2 в MPEG и положить это в AVI контейнер.
Использую следующий pipeline:
gst-launch filesrc location=cap.yuv ! video/x-raw-yuv,width=640,height=480,framerate=30/1 ! ffenc_mpeg4 ! video/mpeg,width=640,height=480,framerate=30/1 ! ffmux_mpeg ! filesink location=out.avi

В результате:
WARNING: erroneous pipeline: could not link ffenc_mpeg40 to ffmux_mpeg0

Подскажите, пожалуйста, что изменить в строке, чтоб выполнить конвертацию?


Ответ на: Re: gstreamer: конвертация YUV в mpeg от mv

Re: gstreamer: конвертация YUV в mpeg

Factory Details:
  Long name:	FFMPEG mpeg Muxer
  Class:	Codec/Muxer
  Description:	FFMPEG mpeg Muxer
  Author(s):	Wim Taymans <wim.taymans@chello.be>, Ronald Bultje <rbultje@ronald.bitfreak.net>
  Rank:		none (0)

Plugin Details:
  Name:			ffmpeg
  Description:		All FFMPEG codecs
  Filename:		C:\Program Files (x86)\Common Files\GStreamer\0.10\lib\gstreamer-0.10/libgstffmpeg.dll
  Version:		0.10.2
  License:		LGPL
  Source module:	gstreamer
  Binary package:	FFMpeg
  Origin URL:		http://ffmpeg.sourceforge.net/

GObject
 +----GstObject
       +----GstElement
             +----ffmux_mpeg

Implemented Interfaces:
  GstTagSetter

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/mpeg
           systemstream: true

  SINK template: 'audio_%d'
    Availability: On request
      Has request_new_pad() function: 002FDC55
    Capabilities:
      audio/mpeg
                   rate: [ 8000, 96000 ]
               channels: [ 1, 2 ]
            mpegversion: 1
                  layer: 2
      audio/mpeg
                   rate: [ 8000, 96000 ]
               channels: [ 1, 2 ]
            mpegversion: 1
                  layer: 3

  SINK template: 'video_%d'
    Availability: On request
      Has request_new_pad() function: 002FDC55
    Capabilities:
      video/mpeg
                  width: [ 16, 4096 ]
                 height: [ 16, 4096 ]
              framerate: [ 0/1, 2147483647/1 ]
            mpegversion: 1
           systemstream: false
      video/mpeg
                  width: [ 16, 4096 ]
                 height: [ 16, 4096 ]
              framerate: [ 0/1, 2147483647/1 ]
            mpegversion: 2
           systemstream: false
      video/x-h264
                  width: [ 16, 4096 ]
                 height: [ 16, 4096 ]
              framerate: [ 0/1, 2147483647/1 ]


Element Flags:
  no flags set

Element Implementation:
  No loopfunc(), must be chain-based or not configured yet
  Has change_state() function: 002FE4FB
  Has custom save_thyself() function: gst_element_save_thyself
  Has custom restore_thyself() function: gst_element_restore_thyself

Element has no clocking capabilities.
Element has no indexing capabilities.

Pads:
  SRC: 'src'
    Implementation:
      Has custom eventfunc(): gst_pad_event_default
      Has custom queryfunc(): gst_pad_query_default
        Provides query types:
      Has custom intconnfunc(): gst_pad_get_internal_links_default
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: null Current: "ffmux_mpeg0"

cod ()
Ответ на: Re: gstreamer: конвертация YUV в mpeg от mv

Re: gstreamer: конвертация YUV в mpeg

Поменял на avimux:
gst-launch filesrc location=cap.yuv ! video/x-raw-yuv,width=640,height=480,framerate=30/1 ! ffenc_mpeg4 ! video/mpeg,width=640,height=480,framerate=30/1 ! avimux ! filesink location=out.avi

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...

** (gst-launch-0.10:3272): CRITICAL **: file E:\devel-release\src_releases\gst-ffmpeg\ext\ffmpeg\gstffmpegenc.c: line 588: assertion `frame_size == GST_BUFFER_SIZE (inbuf)' failed
ERROR: from element /pipeline0/filesrc0: Internal data flow error.
Additional debug info:
E:\devel-release\src_releases\gstreamer\libs\gst\base\gstbasesrc.c(1642): (function) (): /pipeline0/filesrc0:
streaming task paused, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
FREEING pipeline ...

Каким должен быть размер буфера? Относительно чего считать?
Разрешение * цвет * framerate?

cod ()
Ответ на: Re: gstreamer: конвертация YUV в mpeg от mv

Re: gstreamer: конвертация YUV в mpeg

У него есть атрибут buffer-size, но каким он должен быть? чему равен frame_size?

Factory Details:
  Long name:	FFMPEG MPEG-4 compatible video encoder
  Class:	Codec/Encoder/Video
  Description:	FFMPEG mpeg4 encoder
  Author(s):	Wim Taymans <wim.taymans@chello.be>, Ronald Bultje <rbultje@ronald.bitfreak.net>
  Rank:		none (0)

Plugin Details:
  Name:			ffmpeg
  Description:		All FFMPEG codecs
  Filename:		C:\Program Files (x86)\Common Files\GStreamer\0.10\lib\gstreamer-0.10/libgstffmpeg.dll
  Version:		0.10.2
  License:		LGPL
  Source module:	gstreamer
  Binary package:	FFMpeg
  Origin URL:		http://ffmpeg.sourceforge.net/

GObject
 +----GstObject
       +----GstElement
             +----ffenc_mpeg4

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/mpeg
                  width: [ 16, 4096 ]
                 height: [ 16, 4096 ]
              framerate: [ 0/1, 2147483647/1 ]
            mpegversion: 4
           systemstream: false
      video/x-divx
                  width: [ 16, 4096 ]
                 height: [ 16, 4096 ]
              framerate: [ 0/1, 2147483647/1 ]
            divxversion: 5

  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw-rgb
      video/x-raw-yuv
      video/x-raw-gray


Element Flags:
  no flags set

Element Implementation:
  No loopfunc(), must be chain-based or not configured yet
  Has change_state() function: 0037CA9A
  Has custom save_thyself() function: gst_element_save_thyself
  Has custom restore_thyself() function: gst_element_restore_thyself

Element has no clocking capabilities.
Element has no indexing capabilities.

Pads:
  SRC: 'src'
    Implementation:
      Has custom eventfunc(): gst_pad_event_default
      Has custom queryfunc(): gst_pad_query_default
        Provides query types:
      Has custom intconnfunc(): gst_pad_get_internal_links_default
    Pad Template: 'src'
  SINK: 'sink'
    Implementation:
      Has chainfunc(): 0037C028
      Has custom eventfunc(): 0037C6DB
      Has custom queryfunc(): gst_pad_query_default
        Provides query types:
      Has custom intconnfunc(): gst_pad_get_internal_links_default
    Pad Template: 'sink'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: null Current: "ffenc_mpeg40"
  bitrate             : Target Video Bitrate
                        flags: readable, writable
                        Unsigned Long. Range: 0 - 4294967295 Default: 300000 Current: 300000
  gop-size            : Number of frames within one GOP
                        flags: readable, writable
                        Integer. Range: 0 - 2147483647 Default: 15 Current: 15
  me-method           : Motion Estimation Method
                        flags: readable, writable
                        Enum "GstFFMpegEncMeMethod" Current: 5, "epzs"
                           (1): zero             - 0
                           (2): full             - 1
                           (3): logarithmic      - 2
                           (4): phods            - 3
                           (5): epzs             - 4
                           (6): x1               - 5
  buffer-size         : Size of the video buffers
                        flags: readable, writable
                        Unsigned Long. Range: 0 - 4294967295 Default: 0 Current: 524288
  rtp-payload-size    : Target GOB length
                        flags: readable, writable
                        Unsigned Long. Range: 0 - 4294967295 Default: 0 Current: 0

cod ()
Ответ на: Re: gstreamer: конвертация YUV в mpeg от mv

Re: gstreamer: конвертация YUV в mpeg

Указал значение атрибута buffer-size=614400
gst-launch filesrc location=cap.yuv ! video/x-raw-yuv,width=640,height=480! ffenc_mpeg4,buffer-size=614400! video/mpeg,width=640,height=480! avimux ! filesink location=out.avi

Ассерт не ушел:
** (gst-launch-0.10:4948): CRITICAL **: file E:\devel-release\src_releases\gst-ffmpeg\ext\ffmpeg\gstffmpegenc.c: line 588: assertion `frame_size == GST_BUFFER_SIZE (inbuf)' failed
ERROR: from element /pipeline0/filesrc0: Internal data flow error.
Additional debug info:
E:\devel-release\src_releases\gstreamer\libs\gst\base\gstbasesrc.c(1642): (function) (): /pipeline0/filesrc0:
streaming task paused, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
FREEING pipeline ...

cod ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.