Skip to content

Instantly share code, notes, and snippets.

View jampekka's full-sized avatar

Jami Pekkanen jampekka

View GitHub Profile
@jampekka
jampekka / v4l2_hang.c
Created September 17, 2014 20:08
v4l2src hangs on Gstreamer 1.0 but works on 0.10
/**
Hangs after two frames with gstreamer 1.0:
gcc -o v4l2_hang1.0 `pkg-config gstreamer-1.0 --cflags --libs` v4l2_hang.c && ./v4l2_hang1.0
Works fine with 0.10
gcc -o v4l2_hang0.10 `pkg-config gstreamer-0.10 --cflags --libs` v4l2_hang.c && ./v4l2_hang0.10
*/
#include <gst/gst.h>
#include <stdio.h>
@jampekka
jampekka / gst0.10.py
Created September 17, 2014 19:07
Gstreamer 1.0 v4l2src with Python halts
# PyGST with Gst 0.10 works fine
import gst
pipe = gst.parse_launch("""v4l2src device=/dev/video0 !
appsink sync=false max-buffers=1 drop=true name=sink emit-signals=true""")
sink = pipe.get_by_name('sink')
pipe.set_state(gst.STATE_PLAYING)
<html>
<head>
<script src="http://motherjones.github.io/newsquizjs/jquery.js"></script>
<script src="http://motherjones.github.io/newsquizjs/tabletop.js"></script>
<script src="http://motherjones.github.io/newsquizjs/newsquiz.min.js"></script>
<link href="http://motherjones.github.io/newsquizcss/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="http://motherjones.github.io/newsquizcss/bootstrap-responsive.css" rel="stylesheet" media="screen">
<link href="http://motherjones.github.io/newsquizcss/style.css" rel="stylesheet" media="screen">
</head>
<body>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.