Skip to content

Instantly share code, notes, and snippets.

View jetsonhacks's full-sized avatar

JetsonHacks jetsonhacks

View GitHub Profile
@jetsonhacks
jetsonhacks / gist:3731cac47c2faf440926
Created August 15, 2014 15:53
Make Export for Jetson Variant
To prep for building:
$ export MAKEFLAGS="-j4 -s PLATFORM_VARIANT=jetson"
@jetsonhacks
jetsonhacks / createSwapfile.sh
Created October 4, 2014 21:19
Create a Swapfile
#!/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 November 19, 2015 05:50
NVIDIA Jetson TK1 Configure System
#!/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 September 8, 2019 17:30
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.
#!/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 October 9, 2014 16:15
Install Gstreamer 1.0 on the NVIDIA Jetson TK1
#!/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

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 January 14, 2023 18:37 — forked from tstellanova/jetson_kernel_install.md
Install Grinch Linux4Tegra (L4T) version 19.3.6 for NVIDIA Jetson TK1

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 October 17, 2014 04:14
Use GStreamer to preview webcams
#!/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 March 27, 2023 12:11
Gstreamer two MJPG Webcams
#!/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 October 28, 2014 06:03
Gstreamer example preview, save and stream video
#!/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