#!/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"
#!/bin/bash VID=/dev/video2 echo "delete previous capture..." rm ./out/c64_capture.mp4 # set s-video retro input v4l2-ctl -d $VID -i 2 # set pal standard v4l2-ctl -d $VID -s pal echo "starting capture..." ffmpeg -f v4l2 -i $VID -f pulse -i default -vf fps=50,crop=680:540:16:4,scale=1360:1080:sws_flags=neighbor -c:v libx264 -framerate 50 -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 $VID 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 $VID -l stick_settings2 & 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 #echo ".................ffmpegpid: $FFMPEGPID" #echo ".................ffplaypid: $FFPLAYPID" kill $FFMPEGPID sleep 1 kill $FFPLAYPID
lsusb Bus 003 Device 003: ID 258a:001f
v4l2-ctl --list-devices AV TO USB2.0 (usb-0000:01:00.0-9): /dev/video2 /dev/video3 Failed to open /dev/video0: No such file or directory
ffmpeg -f v4l2 -list_formats all -i /dev/video2 [video4linux2,v4l2 @ 0x5649ef38a8c0] Raw : yuyv422 : YUYV 4:2:2 : 720x480 720x576 640x480 320x240 160x120 /dev/video2: Immediate exit requested
ffmpeg -f v4l2 -framerate 25 -video_size 720x576 -i /dev/video2 -c:v copy testcap25_2.avi