Skip to content

Instantly share code, notes, and snippets.

@endrift
Last active August 29, 2015 14:04
Show Gist options
  • Save endrift/462a927331b7ad36323c to your computer and use it in GitHub Desktop.
Save endrift/462a927331b7ad36323c to your computer and use it in GitHub Desktop.
GStreamer-based web video streamer for Freescale i.MX6
#!/bin/sh
# Stream video from your Freescale i.MX6 device (e.g. CuBox-i, Hummingboard, Wandboard, UDOO)
# Pass it a URL that `youtube-dl` can handle, or pass it as a player to `livestreamer`.
# Currently only works with MP4 streaming h.264 video and AAC audio.
#
# Requires:
# - gstreamer >= 1.2
# - gst-plugins-good
# - gst-plugins-bad
# - gstreamer-imx (https://github.com/Freescale/gstreamer-imx)
# - youtube-dl
#
# Note that gstreamer-imx builds in Arch Linux ARM's repo before 0.9.7-3 were compiled
# with incorrect flags and will not work properly. This was fixed in 0.9.7-3.
if [ "x$1" = "x-" ]
then
SRC="fdsrc fd=0"
else
SRC="souphttpsrc location=$(youtube-dl -g $1)"
fi
ALSADEV=default:CARD=imxhdmisoc
GST_LAUNCH=gst-launch-1.0
FB_MULTI_BUFFER=2 $GST_LAUNCH $SRC ! qtdemux name=demux demux. ! queue ! h264parse ! imxvpudec ! imxeglvivsink demux. ! queue ! faad ! alsasink device=$ALSADEV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment