Gstreamer and decklink playback

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

Gonçalo Dias

  • Posts: 4
  • Joined: Mon Jul 13, 2015 1:22 pm

Gstreamer and decklink playback

PostMon Jul 13, 2015 1:45 pm

Hi everyone.

I have one decklink card to play with, and I need to check how can I output to the card ( some video file for example)

My initial test was with ffmpeg, but I can only make it works if I dont send audio to the cards. Only video works fine. Unfortunately for me, I need both audio and video

Here in the forum I read that Gstreamer works well with this cards, so I gave it a try.

I have video and audio with:
gst-launch-1.0 videotestsrc ! decklinksink mode=10 name=sink audiotestsrc ! audio/x-raw,rate=48000 ! sink.

I'm having one hard time to get from this to actually sending from one file to the card. Can anyone point me to the right direction?
Offline

Dave Johnstone

  • Posts: 223
  • Joined: Mon Dec 08, 2014 11:12 am
  • Location: Adelaide

Re: Gstreamer and decklink playback

PostTue Jul 14, 2015 9:13 am

Hi,

I have had success with Gstreamer and Decklink cards and should be able to give you an example pipeline for gstlaunch. I am not able to access my development machine at the moment as I'm at the SMPTE show but will post one for you once I return home. What pipelines (other than test sources) have you tried?

Regards,

Dave.
Freelance Television Broadcast Engineer
and Software Programmer.
Offline

Gonçalo Dias

  • Posts: 4
  • Joined: Mon Jul 13, 2015 1:22 pm

Re: Gstreamer and decklink playback

PostWed Jul 15, 2015 8:49 am

I'll be honest, I'm not familiar with Gstreamer. I mostly use ffmpeg, it's basically the first time I'm using Gstreamer.

I tried a bunch of stuff that I found online, because I could not find anything usefull in the documentation of gstreamer.

With ffmpeg I can make it works, but only with video. Have to pass the -an option to disable the audio:
ffmpeg -i arte_2015-07-09T15-15-00Z_2015-07-09T15-20-00Z.ts -f decklink -pix_fmt uyvy422 -an 'DeckLink HD Extreme 3D'

With gstreamer I tried this (found somewhere online and adapted it):
gst-launch-1.0 filesrc location=/home/decklink/00015484.france4.ts ! tee ! queue ! decodebin name=demux ! tee ! queue ! deinterlace mode=0 fields=1 method=4 tff=0 ! tee ! queue ! videoscale ! videoconvert ! videorate ! decklinksink mode=10 name=sink demux.! tee ! queue ! audioconvert ! audioresample ! volume ! sink.

First I tried something simpler like:
gst-launch-1.0 filesrc location=/home/decklink/00015484.france4.ts ! decklinksink mode=10 name=sink
Setting pipeline to PAUSED ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstDecklinkSink:sink: GStreamer encountered a general stream error.
Additional debug info:
gstdecklinksink.cpp(495): gst_decklink_sink_videosink_chain (): /GstPipeline:pipeline0/GstDecklinkSink:sink:
Failed to schedule frame: 0x80000003
Execution ended after 0:00:00.000644616
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
Offline

Dave Johnstone

  • Posts: 223
  • Joined: Mon Dec 08, 2014 11:12 am
  • Location: Adelaide

Re: Gstreamer and decklink playback

PostSat Jul 18, 2015 5:08 am

Hi,

Your pipeline looks over-complicated, try something like this:

gst-launch-1.0 -v uridecodebin uri=file:///path/to/file name=bin bin. ! autovideoconvert ! videorate ! videoscale ! decklinkvideosink mode=10 bin. ! decklinkaudiosink

It's best if your video file already has the correct format (resolution/framerate) and the audio won't link unless it's pcm_s16le @ 48k.

Regards,

Dave.
Freelance Television Broadcast Engineer
and Software Programmer.
Offline

Gonçalo Dias

  • Posts: 4
  • Joined: Mon Jul 13, 2015 1:22 pm

Re: Gstreamer and decklink playback

PostTue Jul 21, 2015 9:22 am

I just tried that.

It seems that I don't have the decklinkvideosink and decklinkaudiosink.

If I do gst-inspect-1.0 decklink I have:
gst-inspect-1.0 decklink
Plugin Details:
Name decklink
Description Blackmagic Decklink plugin
Filename /usr/local/lib/gstreamer-1.0/libgstdecklink.so
Version 1.4.5
License LGPL
Source module gst-plugins-bad
Source release date 2014-12-18
Binary package GStreamer Bad Plug-ins
Origin URL Unknown package origin

decklinksrc: Decklink source
decklinksink: Decklink Sink

2 features:
+-- 2 elements

Is this normal or am I doing something wrong?
Offline

Gonçalo Dias

  • Posts: 4
  • Joined: Mon Jul 13, 2015 1:22 pm

Re: Gstreamer and decklink playback

PostTue Jul 21, 2015 12:41 pm

I have done a few more tests with ffmpeg, and turns out it works pretty well. My problem was in my input that is not proper to the card, when I tried with some other testing sources it run at the first try.

So, I will stick with ffmpeg because its what I know best and it's quite easier to handle.

Return to Software Developers

Who is online

Users browsing this forum: Bing [Bot] and 13 guests