#!/bin/bash echo "delete previous capture..." rm ./out/c64_capture.mp4 echo "starting capture..." ffmpeg -f v4l2 -i /dev/video0 -f pulse -i default -c:v libx264 -framerate 25 -preset ultrafast -c:a aac -f tee -map 0:v -map 1:a "./out/c64_capture.mp4|[f=nut]pipe:" | ffplay pipe: & # load improved settings (only has an effect if ffmpeg is already reading from /dev/video0 otherwise it always reverts to default settings) echo "loading improved stick settings..." # wait a bit to make sure ffmpeg and ffplay are already running sleep 1 # (loading the settings shows error messages on console but the settings are changed as evident by looking at the captured video) v4l2ctrl -d /dev/video0 -l stick_settings & FFMPEGPID=`ps T | grep ffmpeg | awk '{ print $1 }'` FFPLAYPID=`ps T | grep ffplay | awk '{ print $1 }'` read -p "...................press any key to stop..................." -n1 -s kill $FFMPEGPID sleep 1 kill $FFPLAYPID
9963776: Brightness:500 9963777: Contrast:500 9963778: Saturation:750 9963779: Hue:0 9963803: Sharpness:128
import vapoursynth as vs core = vs.get_core() clip = core.ffms2.Source(source="./out/c64_capture.mp4") clip = core.std.SeparateFields(clip=clip, tff=1) # also interleaves after separation clip = core.std.Crop(clip=clip, left=12, right=24, top=4, bottom=4) # scale up high for fine control over jitter removal clip = core.resize.Spline36(clip=clip, width=2160, height=1728) # get rid of line jitter between frames, by panning the odds evens = core.std.SelectEvery(clip=clip, cycle=2, offsets=0) odds = core.std.SelectEvery(clip=clip, cycle=2, offsets=1) odds = core.std.AddBorders(clip=odds, bottom=2) odds = core.std.Crop(clip=odds, top=2) # put frames back together clip = core.std.Interleave((odds,evens)) # cut off jitter clip = core.std.Crop(clip=clip, bottom=2) # resize to 1080p clip = core.resize.Spline36(clip=clip, width=1350, height=1080, format=vs.YUV420P16) clip.set_output()
#!/bin/bash echo "extract audio..." ffmpeg -i ./out/c64_capture.mp4 -c:a copy ./out/c64_capture_audio.aac echo "transcode video..." vspipe --y4m vapoursynth_c64.vpy - | ffmpeg -i pipe: -c:v libx264 -preset ultrafast -c:a aac ./out/c64_capture_video.mp4 echo "merge video and audio" ffmpeg -i ./out/c64_capture_video.mp4 -i ./out/c64_capture_audio.aac -c:v copy -c:a copy ./out/c64_capture_deinterlaced.mp4 echo "remove intermediate files..." rm ./out/c64_capture_audio.aac rm ./out/c64_capture_video.mp4 echo "done"