Skip to content

Instantly share code, notes, and snippets.

Avatar

Jetsonhacks jetsonhacks

View GitHub Profile
@jetsonhacks
jetsonhacks / gist:3731cac47c2faf440926
Created Aug 15, 2014
Make Export for Jetson Variant
View gist:3731cac47c2faf440926
To prep for building:
$ export MAKEFLAGS="-j4 -s PLATFORM_VARIANT=jetson"
View createSwapfile.sh
#!/bin/bash
#NVIDIA Jetson TK1
#Create a swapfile for Ubuntu at the current directory location
fallocate -l 4G swapfile
#List out the file
ls -lh swapfile
# Change permissions so that only root can use it
chmod 600 swapfile
#List out the file
ls -lh swapfile
@jetsonhacks
jetsonhacks / configureJetson.sh
Last active Nov 19, 2015
NVIDIA Jetson TK1 Configure System
View configureJetson.sh
#!/bin/sh
# Add some niceties for a new NVIDIA Jetson TK1 - LT 19.3
# Installs Chromium, git and aptitude
# Mark this file as executable in the permissions are of the properties dialog then
# $ sudo ./configureJetson.sh
# Don't allow apt-get upgrade of xorg overwrite libglx.so
# May be fixed in future versions of LT4
sudo apt-mark hold xserver-xorg-core
@jetsonhacks
jetsonhacks / gEncodeH264WithPreviews.sh
Last active Sep 8, 2019
Using Gstreamer, take a h264 stream from a Logitech c920, preview it on the display and save it to a file along with the webcam audio.
View gEncodeH264WithPreviews.sh
#!/bin/sh
# Preview and save webcam video on NVIDIA Jetson TK1
# Grab audio and video (in h264 format) from Logitech c920 @ 1920x1080
# Preview @ 1280x720 on screen
# Store video to file named gEncode1080p.mp4
# Logitech c920 is video1 on this machine
VELEM="v4l2src device=/dev/video1 do-timestamp=true"
# Video capability from the camera - get h264 1920x1080
VCAPS="video/x-h264, width=1920, height=1080, framerate=30/1"
@jetsonhacks
jetsonhacks / installGStreamer-1.0.sh
Created Oct 9, 2014
Install Gstreamer 1.0 on the NVIDIA Jetson TK1
View installGStreamer-1.0.sh
#!/bin/sh
# Install Gstreamer 1.0 on the NVIDIA Jetson TK1
apt-get install gstreamer1.0-tools gstreamer1.0-alsa \
gstreamer1.0-plugins-base gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly gstreamer1.0-plugins-bad gstreamer1.0-libav -y
View Jetson_tk1_setup2.md

Before you begin, ensure that you've setup network access, either with ethernet or wlan.

Setup timezone

sudo dpkg-reconfigure tzdata

Typically we use "US/Pacific-New"

Mount sdcard

@jetsonhacks
jetsonhacks / jetson_kernel_install.md
Last active Nov 25, 2015 — forked from tstellanova/jetson_kernel_install.md
Install Grinch Linux4Tegra (L4T) version 19.3.6 for NVIDIA Jetson TK1
View jetson_kernel_install.md

For this process you will need:

  • A host desktop or laptop computer running Ubuntu Linux 12.04. This may be a VM, I've used VirtualBox.
  • Micro USB cable provided with the Jetson TK1 kit
  • Jetson TK1 and power supply
  • Optional: DB9 null modem cable if you want to use the serial console during boot
  1. On your host computer open a Terminal, then create a directory to operate from, and switch to it. As an example:
mkdir ~/Grinch
cd ~/Grinch
@jetsonhacks
jetsonhacks / gstreamerPreviewWebcam.sh
Created Oct 17, 2014
Use GStreamer to preview webcams
View gstreamerPreviewWebcam.sh
#!/bin/sh
# Show a webcam that delivers video 1920x1080 MJPG on screen
VELEM="v4l2src device=/dev/video0"
VCAPS="image/jpeg, width=1920, height=1080, framerate=30/1"
VSOURCE="$VELEM ! $VCAPS"
VIDEO_SINK="videoconvert ! videoscale ! xvimagesink sync=false"
VIDEO_DECODE="jpegparse ! jpegdec"
# echo is just for debugging purposes
echo gst-launch-1.0 -vvv \
@jetsonhacks
jetsonhacks / sideBySide.sh
Last active May 3, 2020
Gstreamer two MJPG Webcams
View sideBySide.sh
#!/bin/sh
# Run two video webcam feeds in two different windows
# Script assumes that:
# Microsoft LifeCam Studio is video0
# Logitech c920 is video1
# Both cameras run max 1920x1080 MJPG, but two have both on a USB bus they can run @ 1280x720 max
# MS is made a little smaller
# text overlay and clockoverlay may be added to the pipeline, but render poorly
VELEM="v4l2src device=/dev/video0 do-timestamp=true"
VCAPS="image/jpeg, width=640, height=480, framerate=30/1"
@jetsonhacks
jetsonhacks / gist:1008d24f02e532217cfa
Created Oct 28, 2014
Gstreamer example preview, save and stream video
View gist:1008d24f02e532217cfa
#!/bin/sh
# NVIDIA Jetson TK1
# Use Gstreamer to grab H.264 video and audio stream from Logitech c920 webcam
# Preview video on screen
# Save Video and Audio to a file
# Send video as RTSP stream over TCP
# IP Address of the this machine hosting the TCP stream
IP_ADDRESS=<ENTER IP ADDRESS HERE e.g 10.10.10.10>
# You can list devices:
# $ v4l2-ctl --list-devices
You can’t perform that action at this time.