video conversion

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

video conversion

Patrick Welche
This feels like a FAQ, but I haven't managed to put my finger on the
right documentation. The question is how to set about working out a
pipeline. (The overall problem is that matlab 2017a still uses gstreamer-0.10,
despite bugs to that affect being closed as "will appear in a future
release", so I am trying to use gstreamer-1.0 to convert to a video to
a format easy for a default gstreamer-0.10 installation to understand.)

Story so far:

The camera generates a:

$ gst-discoverer-1.0 DAV_3319.MOV
Analyzing file:///home/prlw1/DAV_3319.MOV
Done discovering file:///home/prlw1/DAV_3319.MOV

Topology:
  container: Quicktime
    video: H.264 (High Profile)

Properties:
  Duration: 0:00:22.800000000
  Seekable: yes
  Tags:
      video codec: H.264 / AVC
      language code: en
      bitrate: 21992710
      datetime: 2016-07-22T15:51:29Z
      QT atom: buffer of 388690 bytes
      container format: Quicktime


$ gst-inspect-1.0 | grep -i quicktime
isomp4:  qtmux: QuickTime Muxer
isomp4:  qtdemux: QuickTime demuxer
libav:  avenc_adpcm_ima_qt: libav ADPCM IMA QuickTime encoder
libav:  avenc_qtrle: libav QuickTime Animation (RLE) video encoder
libav:  avdec_adpcm_ima_qt: libav ADPCM IMA QuickTime decoder
libav:  avdec_8bps: libav QuickTime 8BPS video decoder
libav:  avdec_qtrle: libav QuickTime Animation (RLE) video decoder
libav:  avdec_rpza: libav QuickTime video (RPZA) decoder
libav:  avdec_smc: libav QuickTime Graphics (SMC) decoder
libav:  avmux_mov: libav QuickTime / MOV muxer (not recommended, use qtmux instead)
typefindfunctions: image/x-quicktime: qif, qtif, qti
typefindfunctions: video/quicktime: mov, mp4

As QuickTime is being used as a container, it looks as though qtdemux is
appropriate.

$ gst-inspect-1.0 qtdemux
...
  SRC template: 'video_%u'
    Availability: Sometimes
    Capabilities:
      ANY

  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/quicktime
...
Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "qtdemux0"
...

The graphics format is H.264, so

$ gst-inspect-1.0 | grep -i h264
rtp:  rtph264pay: RTP H264 payloader
rtp:  rtph264depay: RTP H264 depayloader
libav:  avdec_h264: libav H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 decoder
typefindfunctions: video/x-h264: h264, x264, 264

$ gst-inspect-1.0 avdec_h264
...
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-h264
              alignment: au
          stream-format: { avc, byte-stream }


I naively try to string them together (SRC=ANY to SINK=video/x-h264):

$ gst-launch-1.0 -v filesrc location="DAV_3319.MOV" ! qtdemux qtdemux0.video_00 ! avdec_h264 ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
WARNING: from element /GstPipeline:pipeline0/GstQTDemux:qtdemux0: Delayed linking failed.
Additional debug info:
./grammar.y(506): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstQTDemux:qtdemux0:
failed delayed linking pad  video_00 of GstQTDemux named qtdemux0 to some pad of avdec_h264 named avdec_h264-0
ERROR: from element /GstPipeline:pipeline0/GstQTDemux:qtdemux0: Internal data stream error.
Additional debug info:
qtdemux.c(5850): gst_qtdemux_loop (): /GstPipeline:pipeline0/GstQTDemux:qtdemux0:
streaming stopped, reason not-linked (-1)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...


I have a feeling I'm missing something fundamental... Any pointers gratefully
received!


Cheers,

Patrick
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video conversion

Arjen Veenhuizen
I think you almost got it right, except for the fact that you are missing a bitstream parsing element before the decoder:
gst-launch-1.0 -v filesrc location="DAV_3319.MOV" ! qtdemux qtdemux0.video_00 ! h264parse ! avdec_h264 ! fakesink 

(in gstreamer 0.10, the pipeline would probably work without the parser as well)
Reply | Threaded
Open this post in threaded view
|

Re: video conversion

Tim Müller
In reply to this post by Patrick Welche
On Mon, 2017-06-26 at 11:48 +0100, Patrick Welche wrote:

> $ gst-launch-1.0 -v filesrc location="DAV_3319.MOV" ! qtdemux
> qtdemux0.video_00 ! avdec_h264 ! fakesink

I think it should be video_0 in this case. You can just leave out the
pad name and write:

  qtdemux name=demux   demux. ! queue ! h264parse ! ...

If you want to decode, you can also just use uridecodebin, e.g.


uridecodebin uri=file:///path/to/foo.mov name=d \
  d. ! queue ! videoconvert ! videoscale ! autovideosink  \
  d. ! queue ! audioconvert ! audioresample ! autoaudiosink

Cheers
 -Tim

--
Tim Müller, Centricular Ltd - http://www.centricular.com

Join us at the GStreamer Conference!
21-22 October 2017 in Prague, Czech Republic
http://gstreamer.freedesktop.org/conference/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: video conversion

Patrick Welche
In reply to this post by Arjen Veenhuizen
On Mon, Jun 26, 2017 at 04:05:07AM -0700, Arjen Veenhuizen wrote:
> I think you almost got it right, except for the fact that you are missing a
> bitstream parsing element before the decoder:

Thanks! I wouldn't have guessed...

gst-launch-1.0 -v \
  filesrc location="DAV_3319.MOV" ! qtdemux name=d \
    d. ! h264parse ! avdec_h264 ! theoraenc ! oggmux \
       ! filesink location="output.ogg"

did the trick.


Cheers,

Patrick
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel