LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-08-2018, 04:07 PM   #1
ljones0
Member
 
Registered: Dec 2007
Posts: 100

Rep: Reputation: 17
Analog video capture drops frames


Hello all!

(BTW: I've not posted this in software or hardware forums as I don't know if this a software or hardware problem - not sure which one!).

I'm currently trying to video capture some of my old VHS video tapes. However no matter what video capture device I try (or no matter which tape) there always seems to be a problem I'm having - the video capture is dropping frames.

To do this I'm using the latest version of debian (buster). The system I'm using is an older system however it should be able to surely do video captrue. It's an AMD Phenom II x2 555 CPU, 4 GB of RAM, onboard graphics. No hard drive but I'm using a SATA SSD of 55GB.

The capture devices I've tried are PCI and USB based. Right now I'm using a USB device (as both devices seem to have the same frame drop problem). The USB device is a USBTV007 video grabber (Easycap) 1B71:3002 .

I can see the video captured by this device OK with a programmed called QT V4L2 test utility and I can also hear the audio coming into the capture device without problem.

I'm also wanting to capture using lossless (not lossy) audio and video and I am using the following command line to perform the capture:

Code:
$ ffmpeg -f v4l2 -thread_queue_size 1024 -tvstd pal-i -i /dev/video1 -r 25 -f alsa -thread_queue_size 1024 -ac 2 -i hw:2,0 -acodec pcm_s16le -ar 48000 -vcodec ffv1 -level 3 -async 1 1.avi
This works and video and audio are recorded ok. However eventually for some reason I'm getting dropped frames - out of a 48 min video I ended up with 305 dropped frames.

Code:
frame=72477 fps= 25 q=-0.0 Lsize=15916485kB time=00:48:33.44 bitrate=44753.9kbits/s dup=0 drop=305 speed=   1x
However I'm also seeing this error listed several times while capturing:

Code:
[video4linux2,v4l2 @ 0x559016e9a340] Dequeued v4l2 buffer contains corrupted data (829440 bytes). speed=   1x    
[video4linux2,v4l2 @ 0x559016e9a340] Dequeued v4l2 buffer contains corrupted data (829440 bytes). speed=   1x    
[video4linux2,v4l2 @ 0x559016e9a340] Dequeued v4l2 buffer contains corrupted data (829440 bytes). speed=   1x     
[video4linux2,v4l2 @ 0x559016e9a340] Dequeued v4l2 buffer contains corrupted data (829440 bytes). speed=   1x
The PC I'm using isn't really doing much else apart from running normal KDE. However try as I might I can't find the reason for the frame drops. It seems to happen no matter if I use an older PCI device or the USB device mentioned above and also with any tape.

BTW I can confirm my VHS video recorder I'm using is working; I am capturing via its svideo output (and the machine I'm using even has a TBC which is powered on). Its model number is HR-S7600.

Has anyone experienced problems with frame dropping while doing analog video capture at all? I know this used to be a problem a long time ago with older PCs but largely that really was down to the PC and any I/O being too slow to keep up!

Thanks

ljones

Last edited by ljones0; 11-08-2018 at 04:08 PM.
 
Old 11-08-2018, 11:20 PM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,809
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Is that HR-S7600 a JVC? I had a JVC HR-S7500U, which was NTSC, not AFAIK PAL capable. Are your VHS tapes PAL? If NTSC I'd be trying -f 30 instead of -f 25.
 
Old 11-09-2018, 03:57 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i have no clue about the hardware being used.
can't they save the video to a file directly? why do you need ffmpeg?

if not, and you really need to capture an actual video stream, here's a general comment:
  • it is transcoding on the fly. is your cpu powerful enough to manage that with your settings?
  • you might want to try just dumping the raw data to disc. not sure you even need ffmpeg for that, but in any case, the resulting file will be HUGE.

PS: possibly my ignorance in these matters shows.
 
Old 11-09-2018, 06:48 AM   #4
ljones0
Member
 
Registered: Dec 2007
Posts: 100

Original Poster
Rep: Reputation: 17
It's definately a 7600 btw and PAL compatible and a JVC. All my stuff here is PAL-I (I should have mentioned I am from the UK, oops!). Plays VHS/PAL-I tapes with no problem.

I have found that the files are large but I'm wanting to make sure I preserve the videos at the best quality possible so the large files I'm getting are fine no problem with that. Maybe even an old Phenom II x2 isn't enough?

I do remember back in the late 90s and early 2000s being able to do reasonably good video capture with an old Matrox G400TV although a) that was a hardware based solution; b) it could be made to work in linux, but hasn't seen an update in an eternity; the card itself was based on the old zoran chipset ( the webspage is at http://marvel.sourceforge.net/ ). And I don't think I even have that hardware any more (not sure) plus it is an old AGP based device(!).

I do understand I'm likely to drop a few frames with old tapes but is 305 normal (305/25)? That represents about 12 seconds(!) worth of video -- so unless it is something to do with the CPU just being too slow I'm not sure.

Last edited by ljones0; 11-09-2018 at 06:55 AM.
 
Old 11-10-2018, 03:46 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i sense there is a lot of misunderstanding here about how these things work.
capturing a stream from a separate device does not typically involve the graphic card at all.

you should get more familiar with how this thing actually works.

personally, i'd try to just capture the stream directly from /dev/video1 or something liek that.
not saying that that's how it's done, just that that's what i would try first.

if you really capture raw data, the output WILL be too large by any measure, and significant compression is possible with no or imperceptible loss.

and yes, i think any old (10 years or more?) cpu is too weak to do encoding-on-the-fly.

here's a search - suitably the first 2 results are about ubuntu.
 
Old 11-10-2018, 12:53 PM   #6
ljones0
Member
 
Registered: Dec 2007
Posts: 100

Original Poster
Rep: Reputation: 17
>capturing a stream from a separate device does not typically involve the graphic card at all.

Very true although the device I mentioned in my last post (Matrox G400TV) was a graphics card which doubled up as a video capture device as it had the zoran chipset built onto it - which when it worked worked well, but little in the way of support on linux. Although we're talking about something that dates from the late 90s/early 2000s and is long since out of date.

>personally, i'd try to just capture the stream directly from /dev/video1
An intresting idea I have never tried this method. Will have to try it out and see if it works. One small problem though -- that won't include the sound!
Update: That idea didn't work 100% - I ended up with corrupt video x.x

>and yes, i think any old (10 years or more?) cpu is too weak to do encoding-on-the-fly.
Drat! Looks like I'll have to try to upgrade the hardware x.x !

One thing I'm going to try is to see what happens if I install the cpufrequtils package and set the CPU governor to "performance" (/etc/default/cpufrequtils). Don't think that will do anything but worth a go! I didn't have it installed at all.

Update 2: Drat that didn't make any difference. But I did try one other thing -- using the same USB capture device, VHS machine and tape (above) I tried doing about a ~5 min recording. On the Phenom II x2 555 I mentioned above I got around 30 or so frame drops. I tried on my "main" PC which has a AMD FX 6300 6-Core CPU ( a CPU with 'six' appeal, prehaps hehe :-) ) and 32GB RAM again running off a SSD and I got 0 framedrops.

ljones

Last edited by ljones0; 11-11-2018 at 05:54 AM.
 
Old 11-11-2018, 05:05 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
i still don't understand:
"The USB device is a USBTV007 video grabber"
you have hardware that is specifically built to do what you want, no?
concentrate your searches on making it work- e.g.:
https://linuxtv.org/wiki/index.php/E...BTV007_EasyCAP

Last edited by ondoho; 11-11-2018 at 05:07 AM.
 
Old 11-11-2018, 05:56 AM   #8
ljones0
Member
 
Registered: Dec 2007
Posts: 100

Original Poster
Rep: Reputation: 17
Yep it does what I need to do, it is just annoying that I'm getting framedrops although the problem is the same with other devices I've tried. I did get better results with a slightly newer machine (above, AMD FX 6300 6-Core CPU) although I'd need to try it more extensively. Might be just that the CPU and RAM on the machine I'm using is too slow.

ljones
 
Old 11-11-2018, 11:03 AM   #9
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,809
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
Quote:
Originally Posted by ljones0 View Post
Might be just that the CPU and RAM on the machine I'm using is too slow.
If this may indeed be the problem then you ought to test with a DE or WM with less overhead and bloat than KDE. Have you tried FVWM, I3-WM, IceWM or TWM? (I'd start with IceWM.)
 
Old 11-11-2018, 11:29 AM   #10
ljones0
Member
 
Registered: Dec 2007
Posts: 100

Original Poster
Rep: Reputation: 17
Well to be honest I did kinda think of that one -- I tried using just the command line straight without any GUI but I still got the same problem x.x although that was still "running" KDE but only at the login screen (I just pressed CTRL-ALT-F2 to get a command line without logging into KDE). I have an older SSD here in a SATA to USB converter frame with TDE (trinity desktop) on it maybe that might work?

ljones

Last edited by ljones0; 11-11-2018 at 11:32 AM.
 
Old 11-11-2018, 11:38 AM   #11
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,809
Blog Entries: 1

Rep: Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066Reputation: 2066
TDE, originally forked from KDE3, is very light compared to the KDE Plasmas.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
The nightmare of analog video capture. (Conexant BT848). matrobriva Linux - Hardware 1 04-06-2012 09:35 AM
Video Analog Capture on an ATI 9600XT VIVO? sausagejohnson Linux - Hardware 4 11-10-2004 08:09 PM
How to capture live Video frames from webcam Madhukar Linux - General 0 04-14-2004 07:31 AM
How to capture video frames form webcam Madhukar Linux - Software 0 04-14-2004 07:26 AM
what does it take to capture analog video off of a camera proto Linux - Hardware 1 10-20-2003 08:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration