User Tools

Site Tools


docs:vidcap

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
docs:vidcap [2022/05/17 12:11] – created rootdocs:vidcap [2022/05/19 06:16] (current) – [Composite] root
Line 1: Line 1:
 ====== Video capture on Linux ====== ====== Video capture on Linux ======
 +
 +The following guide is specifically targeted to capture analog video signals.
 +
 +Checklist:
 +
 +  * Capturing Video+Audio FIXME
 +  * Capturing Subtitle with VBI TODO
 +  * Authoring subtitles TODO
 +  * Authoring chapters TODO
 +  * Lossless content encoding TODO
 +  * Lossy content encoding FIXME
 +===== Video path types =====
 +
 +==== Composite ====
 +TODO
 +
 +[[https://superuser.com/questions/1677633/simultaneous-capture-and-monitor-with-ffmpeg]]
 +==== Y/C - S-Video ====
 +FIXME
 +
 +Luma and Chroma are transported on distinct wire pairs.
 +
 +Recommended over Composite if your A/V equipment has no better signal to offer, especially if Digital->Analog conversion is performed onboard (e.g. LaserDisc player with digital framebuffer, D-VHS w/o Components, etc).
 +
 +It's also recommended 
 +
 +  * If your capture card has a poor comb filter (your mileage may vary, make an A/B test with your specific setup). Typical artefacts of a poor comb filter is a blurry luma, and a smudged chroma, especially if you have an OSD. 
 +  * If your video path from source to acquisition goes through processing equipment, so that losses induced by comb filters is minimized.
 +==== RGBHV ====
 +
 +Best solution if you don't have access to Components video, when it comes to signal accuracy.
 +
 +Capture hardware is scarce and expensive.
 +  * [[http://www.micomsoft.co.jp/xcapture-1.htm|Micomsoft XCapture-1]]
 +  * [[https://junkerhq.net/xrgb/index.php/XRGB-mini_FRAMEMEISTER|XRGB Framemeister]]
 +==== Component - YPbPr ====
 +TODO
 +
 +The only way to get analog progressive scan content. The other peculiarity is you can transport HDTV content with it (up to 1080i/p).
 +
 +Capture cards I've found:
 +  * Osprey 260e with a suitable cable. Apparently supported by Linux, according to a quick search.
 +
 +Alternatively, you can use a components to HDMI converter, then a digital acquisition card to process those signals.
 +==== MUSE - Hi-Vision ====
 +Best way to deal with it is getting through a MUSE decoder, then capturing the components.
  
 ===== Capture cards ===== ===== Capture cards =====
    
 +==== August VGB100 ====
  
-  * Easy Cap DC60 [[https://fr.aliexpress.com/item/32485611956.html|Aliexpress product page]]+^ Input ^ Works? ^ 
 +| Composite | Yes, OOB, (input=0) | 
 +| S-Video | Yes, black and white only on Linux (input=1) | 
 +| Audio | Yes, OOB | 
 + 
 +Remarks: 
 +  ''VIDIOC_S_PARM'' ioctl natively supported. 
 +  * I suspect there is a signal integrity issue with this device, since I've had frequent video glitches that are unrelated to the video source (cross-tested with an Easycap DC60). 
 + 
 +==== Easy Cap DC60 ==== 
 +  
 +Sourcing: [[https://fr.aliexpress.com/item/32485611956.html|Aliexpress product page]]
  
 If you have issues with this card (dmesg yelling that it's a model with the generic USB PVID), you need either to reload the kernel module with ''modprobe em28xx card=64'', or adding ''options em28xx card64'' to ''/etc/modprobe.d/easycap-em28xx.conf'', but this will screw with other capture cards using the eMPIA em28xx controllers. If you have issues with this card (dmesg yelling that it's a model with the generic USB PVID), you need either to reload the kernel module with ''modprobe em28xx card=64'', or adding ''options em28xx card64'' to ''/etc/modprobe.d/easycap-em28xx.conf'', but this will screw with other capture cards using the eMPIA em28xx controllers.
Line 31: Line 89:
 <code>ffmpeg -f v4l2 -i /dev/video2 -f alsa -i hw:1,0 -vcodec ayuv -acodec copy -map 0:0 -map 1:0 -f avi pipe:1 | ffplay -</code> <code>ffmpeg -f v4l2 -i /dev/video2 -f alsa -i hw:1,0 -vcodec ayuv -acodec copy -map 0:0 -map 1:0 -f avi pipe:1 | ffplay -</code>
  
 +===== Capturing video signal =====
 +
 +Unless you have a decent machine, it is recommended to first save an uncompressed capture that you will process in a second time, then compress (either losslessly for mastering/archival, or lossily for final consumption).
 +
 +===== Authoring chapters =====
 +
 +This can be performed using a ''ffmetadata'' file. Add the following options to insert an external metadata file:
 +<code>-i example.ini -map_metadata 1</code>
 +
 +File example:
 +<code ini example.ini>;FFMETADATA1
 +title=bike\\shed
 +;this is a comment
 +artist=FFmpeg troll team
 +
 +[CHAPTER]
 +TIMEBASE=1/1000
 +START=0
 +#chapter ends at 0:01:00
 +END=60000
 +title=chapter \#1
 +[STREAM]
 +title=multi\
 +line
 +</code>
 +
 +Doc for more info: [[https://ffmpeg.org/ffmpeg-formats.html#Metadata-1]]
 +
 +===== Lossy content encoding =====
 +
 +  * Transparent, x264
 +<code>ffmpeg -i master.avi -c:v libx264 -preset slow -crf 18 -c:a opus -b:a 192 output.mkv</code>
 +
 +  * Transparent, x265
 +<code>ffmpeg -i master.avi -c:v libx265 -preset slow -crf 24 -c:a opus -b:a 192 output.mkv</code>
 +
 +Additionally, you should tune the encoder by inserting -tune <option> depending on the kind of content you're encoding:
 +
 +^ Option ^ Target ^
 +| film | use for high quality movie content; lowers deblocking |
 +| animation | good for anime and cartoons; uses higher deblocking and more reference frames |
 +| grain | preserves the grain structure in old, grainy film material |
 +| stillimage | good for slideshow-like content |
  
 +If you wish to have a smaller file, you can tune the CRF up to 28 for x264, and FIXME for x265.
docs/vidcap.1652782289.txt.gz · Last modified: 2022/05/17 12:11 by root

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki