I want to capture and stream on Linux. Is this possible?

Do you have questions about Desktop Video, Converters, Routers and Monitoring?
  • Author
  • Message
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

I want to capture and stream on Linux. Is this possible?

PostSat Nov 02, 2013 6:10 am

I'm just trying to get some basic questions answered. Basically, my goal is to be able to capture and stream the output of my ATEM TVS. It looks like there's Linux support the DeckLink cards. Can someone just give me a quick run down of the tools and set up?

The end goal is to be able to script the entire process for capturing our shows, much the way we've completely automated our audio broadcasts.

So, is it possible...is there command line tools to capture?

Thanks
Offline

alexnano

  • Posts: 3
  • Joined: Wed Nov 13, 2013 5:44 pm

Re: I want to capture and stream on Linux. Is this possible

PostWed Nov 13, 2013 8:26 pm

Hello,

gstreamer has served our needs well with up to HD capture on decklink studio.

the 'gst-plugins-bad' has a community-supported decklinksrc to capture from most decklink studio cards.

decklinksrc name=blackmagic connection=1 mode=11 ! ffmpegcolorspace ! queue !

gst-inspect decklinksrc will show you the options.
Offline
User avatar

Roman Pytkin Pekarek

  • Posts: 2351
  • Joined: Tue Oct 30, 2012 1:11 pm
  • Location: SVK

Re: I want to capture and stream on Linux. Is this possible

PostWed Nov 13, 2013 8:55 pm

xxedgexx : search forum .. we was talked here about decklink , linux , ffmpeg .. search for bmdtools ..
http://tally.pytkin.sk
http://chucktv.eu
http://www.stonepp.tv
http://www.media-planet.sk
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: I want to capture and stream on Linux. Is this possible

PostWed Nov 13, 2013 9:11 pm

Pytkin wrote:xxedgexx : search forum .. we was talked here about decklink , linux , ffmpeg .. search for bmdtools ..


I've been reading the forum a lot and I have all these utilities but I'm failing to come up with the right combination. My initial goal isn't to stream as much as it is to capture to a file. Here's an email I just wrote to support. Might as well cut and paste:

Spoke with support and basically what I’m trying to do is beyond the scope of what support offers. I figured as much as I understand, but I’m trying desperately to make some headway on my issue.

The end goal is to be able to capture the program output of my ATEM TVS via a DeckLink Mini Recorder on my Linux server for archiving of our video feed.

Support confirmed that on a hardware level, this should be no problem. The trick is figuring out what utilities to string together to be able to do this capture on the command line to allow us to do some automation of the video capture.

First, if there’s any help in getting this piece complete on the command line, that would be pretty amazing. I’ve been through the forums. I have the sample Capture utility and I’ve built the third party bmdcapture from the bmdtools distribution. I have ffmpeg and I have avconv from the libav packages, but I’m still having trouble converting a capture in to a usable format. I’m hoping to end up with a mp4 or mpg or whatever compressed version I can get with the video output. The best I’ve been able to come up with is a file that is nothing but color bars and no sound. I don’t know what this means. Does it mean I’m not actually capturing anything??? I’ve tested the program output with just an HDMI screen and it works fine, so I know the correct signal is there. I’m running 720p 59 and I’m using the HDMI output on the TVS. It should use embedded audio.

If I can’t get support on a proper command line combination to do what I want to do, I’m fine with using the provided MediaExpress utility to at least prove that what I want to do is possible on a hardware level, but…I’m running in to glibc dependency issues. I’m running CentOS 5.9. I’m seeing this:

[root@ps1-2 Blackmagic]# MediaExpress
MediaExpress: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found (required by MediaExpress)

So can you tell me what library dependencies I need to satisfy to get the utility to work? The support person said CentOS 5 was supported, but I highly doubt you expect people to compile their own glibc to get this to work. Do I need one of the “compat-*” lib packages installed? By the way, this dependency information should be in the rpm spec file to avoid these issues. I’d be happy to help with your spec file in exchange for a functioning command line capture process :-)
Offline
User avatar

Roman Pytkin Pekarek

  • Posts: 2351
  • Joined: Tue Oct 30, 2012 1:11 pm
  • Location: SVK

Re: I want to capture and stream on Linux. Is this possible

PostWed Nov 13, 2013 10:58 pm

im not sure with centos 5 .. im using Declinks on centos 6 and it works OK ..

what is your problem ? U not getting video from input ? or your problem is ffmpeg switches ? its the same like U streaming .. Examples is here (from me for example) .. and if U need to store to disk , u just change output to mp4 file .. i can create example tommorow in work if U need ..
http://tally.pytkin.sk
http://chucktv.eu
http://www.stonepp.tv
http://www.media-planet.sk
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: I want to capture and stream on Linux. Is this possible

PostWed Nov 13, 2013 11:05 pm

Pytkin wrote:im not sure with centos 5 .. im using Declinks on centos 6 and it works OK ..

what is your problem ? U not getting video from input ? or your problem is ffmpeg switches ? its the same like U streaming .. Examples is here (from me for example) .. and if U need to store to disk , u just change output to mp4 file .. i can create example tommorow in work if U need ..


I would love an example. I think that's all I need. If I have an example that is known to work, than I can at least troubleshoot from that point as to why it's not working.

DeckLink card is using the HDMI input, the audio is embedded in HDMI and the input resolution is 720p 59. If you create an example using those parameters, I should have a reference point.

Like I mentioned, I tested the program output using the same cables and same length on a HDMI monitor and the picture was fine, so I'm guessing my problem is with the switches I'm using for bmdcapture and ffmpeg.

Thank you!!!
Offline
User avatar

Roman Pytkin Pekarek

  • Posts: 2351
  • Joined: Tue Oct 30, 2012 1:11 pm
  • Location: SVK

Re: I want to capture and stream on Linux. Is this possible

PostThu Nov 14, 2013 9:16 am

so here is example :
Code: Select all
./bmdcapture -m 12 -A 2 -V 3 -F nut -f pipe:1 | \
./ffmpeg -re -i - \
-c:v libx264 -pix_fmt yuv420p -profile:v main -level 4.1 -vb 8000k \
-c:a libvo_aacenc -ab 256k output.mp4


u need to set proper mode for input in bmcapture :
Code: Select all
Usage: bmdcapture -m <mode id> [OPTIONS]

    -m <mode id>:
=============== DeckLink Studio (-C 0 )===============

Supported video output display modes and pixel formats:
         0:   NTSC                     720 x 486       29.97 FPS
         1:   NTSC 23.98               720 x 486      23.976 FPS
         2:   PAL                      720 x 576          25 FPS
         3:   HD 1080p 23.98           1920 x 1080      23.976 FPS
         4:   HD 1080p 24              1920 x 1080          24 FPS
         5:   HD 1080p 25              1920 x 1080          25 FPS
         6:   HD 1080p 29.97           1920 x 1080       29.97 FPS
         7:   HD 1080p 30              1920 x 1080          30 FPS
         8:   HD 1080i 50              1920 x 1080          25 FPS
         9:   HD 1080i 59.94           1920 x 1080       29.97 FPS
        10:   HD 1080i 60              1920 x 1080          30 FPS
        11:   HD 720p 50               1280 x 720          50 FPS
        12:   HD 720p 59.94            1280 x 720     59.9401 FPS
        13:   HD 720p 60               1280 x 720          60 FPS
http://tally.pytkin.sk
http://chucktv.eu
http://www.stonepp.tv
http://www.media-planet.sk
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: I want to capture and stream on Linux. Is this possible

PostThu Nov 14, 2013 9:25 am

Thank you for this example. I will try this as soon as I'm in the studio tomorrow morning.
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: I want to capture and stream on Linux. Is this possible

PostThu Nov 14, 2013 9:28 am

So actually, I was able to run this remotely just to see if there was problems. Here's the error I received:

[root@ps1-2 ~]# sh -x capture.sh
+ bmdcapture -m 12 -A 2 -V 3 -F nut -f pipe:1
+ ffmpeg -re -i - -c:v libx264 -pix_fmt yuv420p -profile:v main -level 4.1 -vb 8000k -c:a libvo_aacenc -ab 256k output.mp4
ffmpeg version N-57980-gac4447b Copyright (c) 2000-2013 the FFmpeg developers
built on Nov 8 2013 17:51:09 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-54)
configuration: --enable-gpl --enable-libx264 --disable-yasm
libavutil 52. 52.100 / 52. 52.100
libavcodec 55. 41.100 / 55. 41.100
libavformat 55. 21.100 / 55. 21.100
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.102 / 3. 90.102
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Frame received (#1) - No input signal detected - Frames dropped 1 - Total dropped 1
Guessed Channel Layout for Input Stream #0.1 : stereo
Input #0, nut, from 'pipe:':
Metadata:
encoder : Lavf54.20.3
Duration: N/A, start: 0.000000, bitrate: 1536 kb/s
Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 1920x1080, 30 tbr, 30 tbn, 30 tbc
Stream #0:1: Audio: pcm_s16le (PSD[16] / 0x10445350), 48000 Hz, stereo, s16, 1536 kb/s
Unknown encoder 'libvo_aacenc'
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: I want to capture and stream on Linux. Is this possible

PostThu Nov 14, 2013 9:46 am

Ok, got around the issue by compiling the vo_accenc stuff in to ffmpeg. Your example runs, but this is what I get from the video:

http://www.skidrowstudios.com/podcasts/output.mp4

Color bars...no sound...which is what I got with my previous attempts.

So I'm trying to understand what this means and at what level things are working?

Any ideas?

Thanks
Offline
User avatar

Roman Pytkin Pekarek

  • Posts: 2351
  • Joined: Tue Oct 30, 2012 1:11 pm
  • Location: SVK

Re: I want to capture and stream on Linux. Is this possible

PostThu Nov 14, 2013 4:07 pm

hmm .. im not sure .. i think , threre is any problem with decklink .. at first .. just run BMD Media Express and try , if U see input ..
http://tally.pytkin.sk
http://chucktv.eu
http://www.stonepp.tv
http://www.media-planet.sk
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: I want to capture and stream on Linux. Is this possible

PostThu Nov 14, 2013 7:12 pm

I want to run Media Express, but the binary gives me a bunch of glibc issues.

May I ask specifically what version of CentOS 6 you're running and if MediaExpress works out of the box for you?
Offline
User avatar

Roman Pytkin Pekarek

  • Posts: 2351
  • Joined: Tue Oct 30, 2012 1:11 pm
  • Location: SVK

Re: I want to capture and stream on Linux. Is this possible

PostThu Nov 14, 2013 11:20 pm

http://tally.pytkin.sk
http://chucktv.eu
http://www.stonepp.tv
http://www.media-planet.sk
Offline
User avatar

frenchiefilms

  • Posts: 29
  • Joined: Thu Nov 14, 2013 7:27 pm
  • Location: Redmond, WA

Re: I want to capture and stream on Linux. Is this possible

PostFri Nov 22, 2013 5:29 pm

By the way the error about GLIBCXX_3.4.9 is due to not having the right version of libstdc++.so.6 You'll need 6.0.9 or later.

I found that data here: http://samritmaity.wordpress.com/2011/0 ... not-found/ and then to get that on CentOS 5 (Assumption is you're on 5.4, as 5.8 latest 5 but you could be on an earlier version and I saw most people using 5.4 before moving to 6.3) It looks like the easiest way to get that is to upgrade to a newer version of CentOS. Basically it requires a gcc version that isn't really supported on the much older CentOS. There may be workarounds but it would be much harder than just upgrading the whole OS to a more recent 6.x version of CentOS.
==
Phillip Davis
pdavis@frenchiefilms.com
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: I want to capture and stream on Linux. Is this possible

PostFri Nov 22, 2013 5:50 pm

Thanks. Yeah, it seems CentOS 5 support is deteriorating. Our server does a lot of stuff, so I'm going to have to find an extra machine to put CentOS 6 on. I don't want to break our existing processes.

Thanks
Offline
User avatar

frenchiefilms

  • Posts: 29
  • Joined: Thu Nov 14, 2013 7:27 pm
  • Location: Redmond, WA

Re: I want to capture and stream on Linux. Is this possible

PostFri Nov 22, 2013 6:04 pm

Yeah I looked and 5.x EOL is: CentOS-5 updates until Mar 31, 2017 so that's still a ways off, but usually that's just basic updates for security vulnerabilities, major bugs etc, not rolling newer versions of binaries into the build.

~Phil
==
Phillip Davis
pdavis@frenchiefilms.com
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: I want to capture and stream on Linux. Is this possible

PostFri Nov 22, 2013 6:11 pm

I was talking more from the third party side. Blackmagic is aware that their latest mediaexpress doesn't work with CentOS 5.
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: I want to capture and stream on Linux. Is this possible

PostFri Dec 06, 2013 10:10 am

Just wanted to say I got everything working and I'm super happy with the results.

Next phases are to stream while capturing. Is that possible?
Offline

mdelepeleire

  • Posts: 3
  • Joined: Sat Nov 09, 2013 2:36 pm

Re: I want to capture and stream on Linux. Is this possible

PostFri Dec 06, 2013 3:37 pm

PLEASE tell us how; what Linux distribution, driver...I was unable to use a decklink card ic Ubuntu 13.04 and if possible would try to copy your setup;
Kind regards,
Offline
User avatar

Roman Pytkin Pekarek

  • Posts: 2351
  • Joined: Tue Oct 30, 2012 1:11 pm
  • Location: SVK

Re: I want to capture and stream on Linux. Is this possible

PostFri Dec 06, 2013 4:19 pm

Use centos.. Examples are here on forum
http://tally.pytkin.sk
http://chucktv.eu
http://www.stonepp.tv
http://www.media-planet.sk
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: I want to capture and stream on Linux. Is this possible

PostSun Dec 08, 2013 7:51 pm

mdelepeleire wrote:PLEASE tell us how; what Linux distribution, driver...I was unable to use a decklink card ic Ubuntu 13.04 and if possible would try to copy your setup;
Kind regards,


I'm an rpm guy, so I use RPM based distros, which is pretty much CentOS. I'm using 6.4. I initially started with CentOS 5, and Blackmagic's Linux software is dynamically linked to newer versions of glibc. So I went with the latest CentOS, which was 6.4. 6.5 was released very recently.

Once I was able to start MediaExpress, it was good enough for me to figured out exactly what settings I needed. From this point, I knew what I had to do in bmdcapture and right now, so far so good.
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

How do I capture to a file and stream in the same process?

PostSun Dec 08, 2013 8:05 pm

I was able to get everything working great. I'm capturing to a file using avconv...

but my next phase is to run my own rtmp server and to be able to stream live video and capture to a file at the same time.

Is this possible? Is there a series of pipes I can use to do this?

Thanks
-jeremy
Offline

Reuben

  • Posts: 85
  • Joined: Wed Dec 12, 2012 3:50 pm

Re: How do I capture to a file and stream in the same proces

PostMon Dec 09, 2013 2:31 am

Use a "tee" pipe. (Read up in the man pages for tee)
Offline
User avatar

Roman Pytkin Pekarek

  • Posts: 2351
  • Joined: Tue Oct 30, 2012 1:11 pm
  • Location: SVK

Re: How do I capture to a file and stream in the same proces

PostMon Dec 09, 2013 7:45 am

im using ffmpeg and u can create more streams and records together from source input ..
http://tally.pytkin.sk
http://chucktv.eu
http://www.stonepp.tv
http://www.media-planet.sk
Offline
User avatar

frenchiefilms

  • Posts: 29
  • Joined: Thu Nov 14, 2013 7:27 pm
  • Location: Redmond, WA

Re: I want to capture and stream on Linux. Is this possible

PostThu Dec 12, 2013 7:14 pm

I'm not 100% sure it would work, but you may be able to use tee to take the file output you're doing and also send it to another app, tee is like pipe but where one output goes to a file, the other goes into something else. In this case a streaming app. I'm not super strong with what you're doing, just a linux nerd.

~Phil
==
Phillip Davis
pdavis@frenchiefilms.com
Offline
User avatar

frenchiefilms

  • Posts: 29
  • Joined: Thu Nov 14, 2013 7:27 pm
  • Location: Redmond, WA

Re: How do I capture to a file and stream in the same proces

PostThu Dec 12, 2013 7:32 pm

Reuben wrote:Use a "tee" pipe. (Read up in the man pages for tee)

That's funny, I just responded to a similar one saying they could probably use tee ;)

Great minds think alike.

~Phil
==
Phillip Davis
pdavis@frenchiefilms.com
Offline

xxedgexx

  • Posts: 36
  • Joined: Sat May 18, 2013 12:59 am

Re: How do I capture to a file and stream in the same proces

PostMon Dec 16, 2013 10:02 pm

Turned out the avconv just works specifying multiple output. Problem now, is it seems, at least according to the avconv developer, that my hardware simply can't keep up with multiple outputs. Trying different things to compensate.

Return to Post Production

Who is online

Users browsing this forum: No registered users and 39 guests