Question / Help List of linux compatible capture cards

1Miguel1

New Member
I wanted to share a quick update on this topic. Today, I've met a major milestone, eventhough the driver is still super hacky and nowhere near done. I was finally able to receive smooth 720p audio & video stream data from my Elgato GCHD and capture it onto my harddisk. Here you can view the ~2 minute video (was using 1080p in menu, but as soon as the game starts, it's switching to 720p -> correct capture): https://drive.google.com/file/d/0B29z6-xPIPLEYUYxTzRhQ0RDXzQ/view?usp=sharing. There is still lots of work to be done; but hey, it's a good point to start experiment and optimize.

Cheers,
Tolga

This is awesome.
I noted that the audio was encoded in mp3, doesn't the Elgato GCHD encode it in AAC? When I use it on Windows I'm pretty sure it's AAC.

Really looking forward to use this during the summer.
 

tolga9009

New Member
@1Miguel1: sorry for the late answer. I'm also sure, that the audio under Windows was AAC. Given the fact that I have used the Mac OS X version of the drivers, things might be slightly different. Nevertheless, it's encoded in 384 kbit/s, which is equal to CD quality. As soon as I have figured out most of the stuff, I will work on AAC support.

@All: I have managed to work on the driver a bit over the weekend. I figured out many things in the official script files and reverse engineered some of their functions. Additionally, I was able to use the output file as a video input in OBS Studio. This means, we're actually able to live stream under Linux with the limitation of 720p60 output and 720p input. Unfortunately, the output file will grow with the length of your stream. So it means, that you won't be able to stream once you go out of disk space. Currently, I'm trying to implement a function, where I'm gonna make the driver output to a filesize-limited, temporary file (in /tmp). This might be a good temporary solution, until things get really rolling with this driver. I still need to figure out, how to do this (circular buffer? Named FIFO pipe?). I need to read about this.

I have also read about V4L. Unfortunately, it's not meant for user space, so I can't use it to pass our video buffer to a /dev/videoX file. I'd need to write a kernel module for the Elgato, which I'm definitely not going to do on my own.
Therefore, I have switched the codebase to plain old C again and started commenting out my code, so porting it to kernel space gets a bit easier, if someone else is willing to try it. I have already written a kernel module once. However, it was not a pleasing experience, since debugging is a NIGHTMARE (even with VMs) and the kernel space are very limiting (also license-wise). Also, writing code as a hobby programmer, which gets accepted by kernel developers is extremely difficult. Getting your code refused after months of hard work is extremely frustrating.

If you can think of another method, how to use the data stream in OBS, please share. I'm unaware of anything else, besides V4L (kernel space) and FIFO pipe.

Cheers,
Tolga

//Edit: I've read about FIFO pipes (also called named pipes). Yepp, they should do it. I'm gonna implement it tomorrow and keep you up-to-date.

//Edit 2: Ok, I have implemented a FIFO pipe now. VLC seems to work well with it: reduced delay, no infinitely growing file on your harddrive, no stutter, 60 fps. However, OBS seems to have problems reading from a FIFO pipe. It just shows around 1 second of footage, then the video freezes. Any comments from the OBS devs?
Also, OBS is looking for file extensions. It hides files, which don't have a file extension. But that's a minor issue (?).
 
Last edited:

Oby

New Member
@tolga9009: I have the same experience here as you have in Edit 2. I also noticed that after trying to play the /tmp/elgato_gchd.ts file in OBS (which showed me only a still image from the HDMI device connected to my elgato) I could not open it in VLC either. I had to stop the driver, unplug/replug the elgato and restart the driver before I could open it again.
 

tolga9009

New Member
@tolga9009I had to stop the driver, unplug/replug the elgato and restart the driver before I could open it again.
This is (currently) perfectly normal behaviour, since the driver is not taking care of reinitializing the Elgato GCHD. Also, there are some rough edges witht the FIFO pipe implementation. E.g. if you start the file with VLC, exit VLC, restart VLC and load the file again, there is a chance the program will crash. I have yet to figure out, how to correctly reset the Elgato device, without replugging. That's WIP.

Alternatively, if you can't get it to work with VLC at all (after replugging the device and restarting the driver), try the following command in a terminal:
vlc - < /tmp/elgato-gchd.ts

This is the correct form for passing a pipe to VLC. Nevertheless, I will keep you guys up-to-date about any milestones.

Cheers,
Tolga
 

Oby

New Member
Is it?

I am aware that replugging is normal behavior when the driver is stopped (Crtl+C). However, here I never stopped the driver, just opened the output .ts file in OBS and after closing OBS tried opening it in VLC - with no success in the latter endavor. If I open the .ts file in VLC, close VLC, and then open the .ts file with VLC again, it works both times.

So, what I was suggesting with my above post was that OBS does something to the .ts file making it unplayable, which would explain why it does not continue playing in OBS apart from the first frame or so. I could of course be wrong, but just wanted to spell out exactly what I did so that things would be more clear.

On a side note: when basic functionality is working I was thinking of putting up at wiki page on github on compiling the driver + an HOWTO here on how to use the driver w/OBS. Bothj of course with huge disclaimers discuraging people from asking for support. Would you be OK with that @tolga9009 ?
 

tolga9009

New Member
Is it?On a side note: when basic functionality is working I was thinking of putting up at wiki page on github on compiling the driver + an HOWTO here on how to use the driver w/OBS. Bothj of course with huge disclaimers discuraging people from asking for support. Would you be OK with that @tolga9009 ?
Sure. Thanks for your help! Let's talk about further improvements directly on GitHub.
 

Oby

New Member
I agree we should continue the discussion of the driver at GitHub. However, we still need some developer input from OBS as to why it does not read the FIFO piped .ts file generated by the driver.

For that reason I am therefore shamelessly paging @leonhard, @dodgepong, @Jim, and @bazukas with the hope that one of them will be able to comment on this issue (see also post #22 above, by @tolga9009, for more information).
 

bazukas

Developer
I agree we should continue the discussion of the driver at GitHub. However, we still need some developer input from OBS as to why it does not read the FIFO piped .ts file generated by the driver.

For that reason I am therefore shamelessly paging @leonhard, @dodgepong, @Jim, and @bazukas with the hope that one of them will be able to comment on this issue (see also post #22 above, by @tolga9009, for more information).

Most likely won't be able to help myself, but it would probably help to include steps to reproduce and obs log.
 
  • Like
Reactions: Oby

Oby

New Member
Most likely won't be able to help myself, but it would probably help to include steps to reproduce and obs log.
Steps to reproduce:
1) Plug in Elgato Game Capture HD and start driver (using https://github.com/tolga9009/elgato-gchd with latest patches, commits as of 25-06-2015)
2) Open /tmp/elgato_gchd.ts in VLC - it plays fine. I can also close and reopen the file in VLC and still get a live feed from the Xbox One.
3) Open OBS studio
4) In OBS add Media Source, and choose the /tmp/elgato_gchd.ts file
5) Only one frame of the video stream is shown in the preview window.
6) Close OBS.
7) Attempt to open the file in VLC, but it stops before playing even a single frame.

OBS log:
Code:
kl. 22.35 +0200: OBS 0.10.1 (linux)
kl. 22.35 +0200: Processor: 4 logical cores
kl. 22.35 +0200: Processor: Intel(R) Core(TM) i5-4670 CPU @ 3.40GHz
kl. 22.35 +0200: Physical Memory: 15987MB Total
kl. 22.35 +0200: Kernel Version: Linux 3.19.0-21-generic
kl. 22.35 +0200: Distribution: "Ubuntu" "15.04"
kl. 22.35 +0200: audio settings reset:
    samples per sec: 44100
    speakers:        2
    buffering (ms):  1000

kl. 22.35 +0200: X and Y: 902 489
Backbuffers: 2
Color Format: 3
ZStencil Format: 0
Adapter: 0

kl. 22.35 +0200: OpenGL version: 3.2.0 NVIDIA 304.125

kl. 22.35 +0200: video settings reset:
    base resolution:   1920x1080
    output resolution: 1280x720
    fps:               30/1
    format:            NV12
kl. 22.35 +0200: No blackmagic support
kl. 22.35 +0200: Failed to start search for DeckLink devices
kl. 22.35 +0200: output 'simple_stream' (rtmp_output) created
kl. 22.35 +0200: output 'simple_file_output' (flv_output) created
kl. 22.35 +0200: encoder 'simple_h264' (obs_x264) created
kl. 22.35 +0200: encoder 'simple_aac' (libfdk_aac) created
kl. 22.35 +0200: service 'default_service' (rtmp_common) created
kl. 22.35 +0200: source 'Scene 1' (scene) created
kl. 22.35 +0200: source 'Media Source' (ffmpeg_source) created
kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: decode_slice_header error

kl. 22.35 +0200: no frame!

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: decode_slice_header error

kl. 22.35 +0200: no frame!

kl. 22.35 +0200: PES packet size mismatch

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: decode_slice_header error

kl. 22.35 +0200: no frame!

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: decode_slice_header error

kl. 22.35 +0200: no frame!

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: decode_slice_header error

kl. 22.35 +0200: no frame!

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: non-existing PPS 0 referenced

kl. 22.35 +0200: decode_slice_header error

kl. 22.35 +0200: no frame!

kl. 22.35 +0200: Input #0, mpegts, from '/tmp/elgato_gchd.ts':

kl. 22.35 +0200:   Duration:
kl. 22.35 +0200: N/A
kl. 22.35 +0200: , start:
kl. 22.35 +0200: 8.016000
kl. 22.35 +0200: , bitrate:
kl. 22.35 +0200: 384 kb/s
kl. 22.35 +0200:

kl. 22.35 +0200:   Program 1

kl. 22.35 +0200:     Stream #0:0
kl. 22.35 +0200: [0x1011]
kl. 22.35 +0200: : Video: h264 (High) (HDMV / 0x564D4448), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9]
kl. 22.35 +0200: ,
kl. 22.35 +0200: 59,94 fps,
kl. 22.35 +0200: 59,94 tbr,
kl. 22.35 +0200: 90k tbn,
kl. 22.35 +0200: 119,88 tbc
kl. 22.35 +0200:

kl. 22.35 +0200:     Stream #0:1
kl. 22.35 +0200: [0x10f]
kl. 22.35 +0200: : Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, s16p, 384 kb/s
kl. 22.35 +0200:

kl. 22.35 +0200: Header missing

kl. 22.35 +0200: concealing 1462 DC, 1462 AC, 1462 MV errors in P frame

kl. 22.35 +0200: illegal short term buffer state detected

kl. 22.35 +0200: Update check: latest version is: 0.4.0
kl. 22.35 +0200: service 'default_service' destroyed
kl. 22.35 +0200: encoder 'simple_h264' destroyed
kl. 22.35 +0200: encoder 'simple_aac' destroyed
kl. 22.35 +0200: output 'simple_stream' destroyed
kl. 22.35 +0200: output 'simple_file_output' destroyed
kl. 22.35 +0200: Freeing OBS context data
kl. 22.35 +0200:     2 user source(s) were remaining
kl. 22.35 +0200: source 'Scene 1' destroyed
kl. 22.35 +0200: source 'Media Source' destroyed
kl. 22.35 +0200: refresh timer stopping; eof
kl. 22.35 +0200: Number of memory leaks: 0
 

Oby

New Member
I'm not a coder, but I do have one suspicion: Could it be that the use of the .ts extension is part of the problem? Does OBS identify files by extension, or does it look at the actual contents of the file?
 

1Miguel1

New Member
I have finally got my hands on the driver. I can actually get it to work in OBS.

Steps to reproduce:
1) Plug in Elgato Game Capture HD and start driver (using https://github.com/tolga9009/elgato-gchd with latest patches, commits as of 25-06-2015)
2) Open /tmp/elgato_gchd.ts in VLC - it plays fine. I can also close and reopen the file in VLC and still get a live feed from the Xbox One.
3) Open OBS studio
4) In OBS add Media Source, and choose the /tmp/elgato_gchd.ts file
5) Only one frame of the video stream is shown in the preview window.
6) Close OBS.
7) Attempt to open the file in VLC, but it stops before playing even a single frame.

If I do this and skip step 2, OBS shows the live feed, not only one frame. :D
After closing OBS I can open the file with VLC, but not with OBS again (driver crashes).

So it seems that OBS can only open the file properly if it hasn't been opened before. (?)
 

Oby

New Member
Actually, latest release of OBS studio solved the issue. So at least for me it is not possible to reproduce what I described above at all. Now it works whether one opens it in VLC first or not.

But there are further issues preventing pass-through from working. That's all due to the driver not OBS through, so you need to go to the driver's github and look at the issues there if you want to contribute.
 

1Miguel1

New Member
Actually, latest release of OBS studio solved the issue. So at least for me it is not possible to reproduce what I described above at all. Now it works whether one opens it in VLC first or not.

But there are further issues preventing pass-through from working. That's all due to the driver not OBS through, so you need to go to the driver's github and look at the issues there if you want to contribute.

Acually I was planning to contribute. :D
I will look into the driver deeper next week and see if my beginner programming skills are useful.
Time to learn about github.
 

ShockiTV

New Member
Hello,
So is there any 1080p@30 capture card currently working?
I would prefer internal one and best with pass-through to just plug between notebook and projector.
Still even with external hdmi splitter the final solution can be acceptable.
 
Top