Quantcast S-video capture on Linux via ATI USB card, FFmpeg - recommendations? - digitalFAQ Forum
Go Back    Forum > Digital Video > Video Project Help > Capture, Record, Transfer

Reply
 
LinkBack Thread Tools
  #1  
11-25-2014, 06:21 AM
wronkyn wronkyn is offline
Invalid Email / Banned / Spammer
 
Join Date: Nov 2014
Posts: 1
Thanked 0 Times in 0 Posts
Hi all,

I am experimenting with a Linux-based workflow to capture video from a Sony CCD-TRV66 Camcorder directly to an ATI TV Wonder HD 600 USB card. (The total specific financial expenses have been minimal so far: an S-Video cable, the USB adaptor, a pack of Hi8 blank tapes to experiment on later and the higher electrical bill due to reading things online.)

The eventual aim is to digitize some old (but in very good shape) 8mm/Hi8 tapes; much later, I may move on to VHS tapes (of much less quality). For now, I am concentrating on the capturing/post-processing phase, bypassing tapes (and TBCs/other analog filters) altogether and using the Camcorder as a webcam; I will likely have more questions later!

That's about it for my analog video (ignoring audio) sources for now. In case anybody finds it relevant, for current video production, I use (in increasing order of importance and advance warning):
I appreciate all the help and suggestions anybody may have. I am in no rush and, judging by the amount of time I've already spent reading this site, certainly not afraid of reading long technical explanations, so even pointing me to the right Wikipedia pages would be extremely helpful. (My background is in mathematics and computer science, so prior to finding this site a month ago, my understanding of analog electronics was limited to "if the connectors fit, why shouldn't it work?". According to my browser history, I am also happy to learn electrical engineering theory for its own sake.)

(a) Capture hardware (video)

Judging from the forums here, the ATI TV Wonder 600 is about the best I can do for capturing an S-video signal through USB, and I can do a little bit better if I go the AGP path. (It is unclear to me how the Blackmagic products compare.) Does this remain the case even if I increase my spending? (Does the answer depend on the quality of the S-video signal?) In my specific situation, the 8mm/Hi8 tapes are in good condition (mostly first-generation recordings on previously blank tapes, then stored cleanly, dryly and at room temperature), so signal correction hopefully is not needed. Assuming hypothetically optimal 8mm/Hi8 tapes (or bypassing them altogether), how much room for improvement is there? My understanding of 8mm/Hi8 tapes is that the S-video signal is not the limiting factor; otherwise, those old camcorders would have component video outputs.

I will probably get a green AVT-8710 off of eBay just to experiment with.

(b) Capture hardware (audio)

Similarly, is there much to be gained by using better hardware to capture the audio, or are the 8mm/Hi8 tapes and the tiny Camcorder microphones already the bottleneck? I would experiment with connecting my M-Audio M-Track Plus, except it's in a separate country from the Camcorder.

(c) Video noise from the camcorder

Using the camcorder in webcam mode (i.e., before degrading the signal by involving tapes), I get a fairly faithful on-screen capture using FFmpeg via:
Code:
ffmpeg -f v4l2 -video_size 720x480 -i /dev/video1 -vf hqdn3d=10 -vcodec rawvideo -f avi -framerate 30000/1001 - | ffplay -
(This captures in YUYV -- 16 bpp YUY2, 4:2:2, packed.)

For better for worse, the CCDs produce a staggering amount of noise! (The Camcorder's internal viewfinder shows the same level of noise, so I'm pinning it on the CCDs and not something else in the chain. Unless, of course, there is noise produced between the CCD and internal viewfinder.) Can (or should) anything be done about this noise prior to digitization? I assume not, as the signal is accurately transmitting what the CCDs capture.

The ATI USB 600 driver allows sharpness adjustment, on a scale of 0-15, where the default of 0 indicates least sharpness. As well, FFmpeg incorporates a denoising filter called hqdn3d. For reference, I have included various screenshots taken at various hqdn3d (FFmpeg) and sharpness (driver setting) levels, included in the attachment screenshots.zip.

(The raw shots were captured with something equivalent to
Code:
for $z in 0 5 10 15; do ffmpeg -f v4l2 -video_size 720x480 -i /dev/video1 -vcodec rawvideo -f avi -framerate 30000/1001 sharp$z.avi; done
-- changing the driver sharpness by hand with each iteration -- and then applying the noise filters and extracting the frames with

Code:
for z in 0 5 10 15; do cp sharp$z.avi sharp$z-0.avi; for q in 3 9 27; do ffmpeg -i sharp$z.avi -vf hqdn3d=$q -c:v rawvideo sharp$z-$q.avi; done; done
for z in 0 5 10 15; do cp sharp$z.avi sharp$z-0.avi; for q in 0 3 9 27; do mkdir sharp$z-$q-frames; ffmpeg -ss 1 -i sharp$z-$q.avi -f image2 sharp$z-$q-frames/frame-%03d.png; cp sharp$z-$q-frames/frame-010.png sharpness-$z-denoise-$q.png; done; done
Any opinions or comments on what I should be looking for here? Also, the denoising filter parameter is shorthand for four separate parameters, one for each of chroma vs luma and spatial vs temporal. On what basis are these settings frequently changed? (i.e. tape-by-tape, scene-by-scene, etc?) Do optimal (sub)settings depend more on ambient lighting conditions, or the amount of motion in a scene? (Or does the balance depend heavily on the quality of the CCDs? The Logitech webcam CCDs, for instance, seem to be of much higher quality, but I can't precisely quantify how.)

One thing I find interesting is that as I increase the driver sharpness level, a white gap around the "Sony" text appears. What is this phenomenon, and what filter is the ATI card using (or how is it doing it)? Wikipedia links are welcome here!

(d) Other capturing parameters

In addition to sharpness, the ATI drivers on Linux have the following proc amp controls:
  • brightness
  • contrast
  • saturation
  • hue
  • red balance and blue balance.
How do you prefer to choose these parameters? On one hand, there is the subjective situational (say, on a scene-by-scene basis) way, on what just looks best to the keyboard operator. On the other hand, I gather there are more methodical ways by taking luma/chroma histograms and averaging them on a scene-by-scene or tape-by-tape basis. I intend to experiment with this when I have time, but I also expect there is a wide range of opinions here, so I'd like to hear.

More subjective questions: is there supposed to be a huge trade-off between capture quality and patience/time here? When capturing from tape, is it normal to have to make multiple passes to fine-tune settings, and get the timing right between scene changes?

(e) Streamlining all of this in Linux

I'm happy to report that the ATI TV Wonder HD 600 USB card working more or less out of the box on my Ubuntu 14.04.1 LTS system. All that is needed is to download the firmware file.

Finding good tools is definitely harder. In theory, all the functionality you need to capture is there, but spread across disparate ad-hoc command-line interfaces that you need to cobble together yourself. I'm guessing that functionality-wise, FFmpeg seems roughly equivalent to VirtualDub, except that you need to do everything on the command line. Is this so? (There is also a Linux port of Avisynth called avxsynth.) Does anybody have any suggestions here? So far, I've been using ffmpeg to record/filter/encode, ffprobe/VLC to view, and qv4l2 to test USB connectivity and tweak/preview capture settings.

I have a Windows 7 installation in VirtualBox, so I could use that to process video if necessary, just not for capturing.

(f) Capture functionality on a stick

Back in the day, there used to be "Linux on a disk" projects -- stick a boot floppy into an abandoned computer, and suddenly you have a free router. I'm currently thinking about something similar, to capture from a laptop's USB capture device and potentially stream the Huffyuv/Lagarith/etc output somewhere else where it can be more easily handled.

Has anybody thought about this? It would be nice to be able use a MacBook Pro as a capturing laptop, and I really do not want to mess with dual-booting Linux or Windows XP on such a thing. (I already gave up trying to get the ATI USB card working on Windows 7, anyway.)

(g) Future-proofing

I anticipate that my primary storage and distribution channel will be the cloud, using Amazon S3 or something similar, and that I will hopefully only have to transcode if somebody asks for the DVD. Given this, is there much long-term (i.e., a few years out) disadvantage to settling on VP9 or H.265 for the codec, and how do I know when it's safe to do so? Chromecast unfortunately does not support these codecs yet, but I care more about things like further standards (and extensions?) stabilization and pending encoder quality.

On the other hand, it's simple enough to just dump everything on the cloud now and wait it out now. Assuming a 3:1 lossless h265 compression ratio, for an encoding rate of roughly 23GB/hour (720*480*2*30*60^2 / 1024^3 / 3) and S3 Glacier storage costs of 1 cent per GB-month, that's under 3 dollars to store an hour of video for a year...

Thank you for reading this post! This site has been a fabulous learning resource for me so far. Any comments are much appreciated, and no rush to reply, please -- I am in the midst of some travel and won't have access to the Camcorder for a while, anyway.


Attached Files
File Type: zip screenshots.zip (12.21 MB, 3 downloads)
Reply With Quote
Someday, 12:01 PM
admin's Avatar
Ads / Sponsors
 
Join Date: ∞
Posts: 42
Thanks: ∞
Thanked 42 Times in 42 Posts
  #2  
11-30-2014, 01:45 PM
msgohan msgohan is offline
Free Member
 
Join Date: Feb 2011
Location: Vancouver, Canada
Posts: 1,146
Thanked 256 Times in 221 Posts
Welcome. I doubt you'll find much assistance with Linux here, but I'll respond where I can. General interest in video on Linux seems to be more about low-cost, not high-quality.

Quote:
Originally Posted by wronkyn View Post
My understanding of 8mm/Hi8 tapes is that the S-video signal is not the limiting factor
Yes. The differences between composite, S-Video, and component primarily boil down to increasing color quality. 8mm/Hi8, (S-)VHS, (Super) Beta, and U-matic (SP) all severely compromise chroma bandwidth, allowing more bandwidth for luma since we notice it more. (See attached PDF if you care for the details.)

So do you care about getting the best possible S-Video capture, or just the best possible S-Video capture from tape? Color separation differences are certainly noticeable between capture devices if you compare a computer-generated signal, but not if it's recorded to tape first.

Quote:
For better for worse, the CCDs produce a staggering amount of noise! (The Camcorder's internal viewfinder shows the same level of noise, so I'm pinning it on the CCDs and not something else in the chain. Unless, of course, there is noise produced between the CCD and internal viewfinder.)
I'm sure Sony would consider that room to be low-light for the cameras available at the time.

Since you have camcorder-generated menus that we know should be the same pixel value across time, if you really want to test the level of noise the capture setup itself introduces, make a capture of a menu and do difference analyses. Subtract current frame minus previous frame + amplification for a visual view, or do measurements. (I'm not sure exactly which can be used but perhaps PSNR or SSIM.)

Quote:
Any opinions or comments on what I should be looking for here? Also, the denoising filter parameter is shorthand for four separate parameters, one for each of chroma vs luma and spatial vs temporal. On what basis are these settings frequently changed? (i.e. tape-by-tape, scene-by-scene, etc?) Do optimal (sub)settings depend more on ambient lighting conditions, or the amount of motion in a scene?
I'm still confused on what exactly you're planning on doing. Using the camcorder as a webcam in addition to capturing the tapes? Denoising is pretty taste-based.

Quote:
One thing I find interesting is that as I increase the driver sharpness level, a white gap around the "Sony" text appears. What is this phenomenon, and what filter is the ATI card using (or how is it doing it)? Wikipedia links are welcome here!
Unfortunately the Wikipedia article for ringing doesn't have screenshots, but the effect you noticed is what you should be looking for when using a sharpening filter. There's no reason to ever set the driver above 0. All it does is increase the contrast of edges, actually removing detail if it existed there.

Quote:
I gather there are more methodical ways by taking luma/chroma histograms and averaging them on a scene-by-scene or tape-by-tape basis.
Not familiar with this... Assuming the Linux drivers operate the same as the Windows drivers (which don't offer the red/blue balance option), the only setting I would ever touch with the ATI 600 is Brightness. The potentially-useful Contrast setting is ruined by the fact that lowering it does not recover any bloomed whites.

Quote:
When capturing from tape, is it normal to have to make multiple passes to fine-tune settings, and get the timing right between scene changes?
"Just" pick settings that don't crush/clip at any point in the recording. Scare quotes because that may require some guess and check. After capture, you can play around with individual scenes if you really want to.

Quote:
In theory, all the functionality you need to capture is there, but spread across disparate ad-hoc command-line interfaces that you need to cobble together yourself.
That's why no one here uses Linux for video, and why I'm the first response you've gotten after 5 days.

Quote:
I'm guessing that functionality-wise, FFmpeg seems roughly equivalent to VirtualDub, except that you need to do everything on the command line.
Well, ffmpeg does a lot of things that VirtualDub can't, but VirtualDub has been heavily extended with third-party filters for everything you can imagine.

Quote:
There is also a Linux port of Avisynth called avxsynth.
Someone told me VapourSynth has made more progress. I see posts on Doom9 about it all the time at least; can't say the same about avxsynth but perhaps they just don't catch my eye.

Quote:
capture from a laptop's USB capture device and potentially stream the Huffyuv/Lagarith/etc output somewhere else where it can be more easily handled.
You would need at least a 200Mbps sustained connection with no lost bits at any time, probably more like 500Mbps to be safe. I know very little about networking tech.

Quote:
(I already gave up trying to get the ATI USB card working on Windows 7, anyway.)
You use Linux command lines day-to-day and couldn't figure out the Win7 drivers?!


Reply With Quote
Reply




Tags
capture card, ffmpeg, hi8, linux

Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for a video capture card Jpass992 Capture, Record, Transfer 1 07-04-2011 02:55 AM
Video capture project, what direction is best? + Proc amp vs TBC + Best capture card? admin Project Planning, Workflows 11 06-16-2011 09:35 AM
ATI All In Wonder video capture card, with capture computer, for sale [SOLD] kpmedia Marketplace 1 05-23-2011 02:09 PM
Hard drive recommendations for video capture Steve(MS) Project Planning, Workflows 1 08-23-2010 04:44 AM
Hi8 Capture HW/SW Recommendations djam0000 Capture, Record, Transfer 8 02-24-2010 10:24 PM

Thread Tools



 
All times are GMT -5. The time now is 02:47 AM