Created
July 21, 2014 11:50
-
-
Save Brick85/0b327ac2d3d45e23ed33 to your computer and use it in GitHub Desktop.
somagic record and play
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
PIPE=/tmp/somagic-pipe | |
OUTFILEDIR=~/dirs/Videos/ | |
LOGDIR=~/.somagic-log/ | |
NOW=`date +"%m_%d_%Y_%H_%M_%S"` | |
OUTFILE=${OUTFILEDIR}fpv_video_${NOW}.mp4 | |
mkdir $LOGDIR | |
FFMPEG_LOG=${LOGDIR}ffmpeg.log | |
SOMAGIC_LOG=${LOGDIR}somagic.log | |
MPLAYER_LOG=${LOGDIR}mplayer.log | |
rm $PIPE >/dev/null 2>&1 | |
rm $OUTFILE >/dev/null 2>&1 | |
rm $FFMPEG_LOG | |
rm $SOMAGIC_LOG | |
rm $MPLAYER_LOG | |
mkfifo $PIPE >/dev/null 2>&1 | |
ffmpeg -loglevel panic -f rawvideo -pixel_format uyvy422 -video_size 720x576 -framerate 25 -i $PIPE -vcodec libx264 -preset ultrafast $OUTFILE > $FFMPEG_LOG 2>&1 & | |
somagic-capture 2> $SOMAGIC_LOG | tee $PIPE | \ | |
mplayer -nosound -vo xv -vf yadif,screenshot -demuxer rawvideo -rawvideo pal:format=uyvy:fps=25 -vf crop=720:430:0:65 -monitoraspect 16:9 -aspect 4:3 -fs - 2> $MPLAYER_LOG | |
rm $PIPE >/dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks. This is the first configuration working on my Ubuntu 14.04. I only switched from ffmpeg to avconv.