Page 15 of 25 FirstFirst ... 51314151617 ... LastLast
Results 141 to 150 of 249

Thread: Linux driver for EasyCap USB2.0 Video Adapter DC60

  1. #141
    Join Date
    May 2008
    Beans
    83

    Re: Linux driver for EasyCap USB2.0 Video Adapter DC60

    Hi Dave,

    I haven't attempted any recording for some months, but I'll test that mencoder command with driver version 0.8.3 and report back here later today.

    At present I don't know how to get the easycap module to load satisfactorily at boot time. The problem is that if the snd_usb_audio module is registered (?) at boot time before (or with higher priority than?) the easycap module, you may find that when the EasyCAP is plugged in the snd_usb_audio has usurped the EasyCAP's audio channel and /dev/easysnd1 is not created. This may not seem a big deal, but if you then try to run mplayer or mencoder with a command line which requests audio streaming from /dev/easysnd1 you will get no video as well as no audio. I may have a fix for this in the next version of the driver, but I'm not sure yet.

    The question about terminating mencoder cleanly has been asked on a couple of other forums before, but I don't remember seeing a good answer. If the driver and mencoder get into a deadlock there may be no way out other than a `kill -9 ...` from another window.

    Mike

  2. #142
    Join Date
    May 2008
    Beans
    83

    Re: Linux driver for EasyCap USB2.0 Video Adapter DC60

    Hi Dave,

    It seems necessary to add the "norm=..." parameter to the command line, because mencoder hangs otherwise, and the "fps=..." parameter needs to be adapted too. It's probably also advisable to omit the "audiorate=48000" parameter because this isn't appropriate to those EasyCAPs which do not have a dedicated audio chip. With these edits the result is:

    Code:
    mencoder tv:// -tv driver=v4l2:norm=NTSC_M:width=640:height=480:outfmt=uyvy:device=/dev/easycap0:input=0:fps=30:adevice=/dev/easysnd1:amode=1:forceaudio:immediatemode=0 -msglevel all=9 -ffourcc DX50 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:turbo:vbitrate=1200:keyint=15 -vf pp=lb,scale=640:480 -oac mp3lame -o test.avi
    Mike

  3. #143
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,439
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: Linux driver for EasyCap USB2.0 Video Adapter DC60

    Hey, thanks for all the quick info! I'll remember what you said about the module and just manually load it rather than put it in modules and then have it get out of sync.

    I'll be trying the mencoder line in a little while, but I wanted to post a thank you first.

    Thanks again!
    Dave

  4. #144
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,439
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: Linux driver for EasyCap USB2.0 Video Adapter DC60

    Thanks again, Mike.

    Tried the mencoder line (just copied it from your post and pasted in the .sh file). Still getting frame drops - I copied what I could of the screen and will paste it here - a bunch of stuff rolled off the top of the buffer.

    Code:
    ==========================================================================
    Forcing output FourCC to 30355844 [DX50].
    Building audio filter chain for 32000Hz/2ch/s16le -> 0Hz/0ch/??...
    [libaf] Adding filter dummy 
    [dummy] Was reinitialized: 32000Hz/2ch/s16le
    [libaf] Adding filter format 
    [format] Changing sample format from little-endian 16-bit signed int to big-endian 8-bit signed int
    [dummy] Was reinitialized: 32000Hz/2ch/s16le
    [format] Changing sample format from little-endian 16-bit signed int to big-endian 8-bit signed int
    LAME 3.98.2 32bits (http://www.mp3dev.org/)
    CPU features: MMX (ASM used), 3DNow! (ASM used), SSE, SSE2
    Using polyphase lowpass filter, transition band: 15613 Hz - 16000 Hz
    
    misc:
    
    	scaling: 1
    	ch0 (left) scaling: 0
    	ch1 (right) scaling: 0
    	huffman search: normal
    	experimental Y=0
    	...
    
    stream format:
    
    	MPEG-1 Layer 3
    	2 channel - joint stereo
    	padding: all
    	variable bitrate - VBR mtrh (default)
    	...
    
    psychoacoustic:
    
    	using short blocks: channel coupled
    	subblock gain: 1
    	adjust masking: -7 dB
    	adjust masking short: -4 dB
    	quantization comparison: 9
    	 ^ comparison short blocks: 9
    	noise shaping: 1
    	 ^ amplification: 0
    	 ^ stopping: 0
    	ATH: using
    	 ^ type: 4
    	 ^ shape: 1 (only for type 4)
    	 ^ level adjustement: -0.75
    	 ^ adjust type: 3
    	 ^ adjust sensitivity power: 1.000000
    	 ^ adapt threshold type: 2
    	experimental psy tunings by Naoki Shibata
    	   adjust masking bass=0 dB, alto=0 dB, treble=0 dB, sfb21=6.5 dB
    	using temporal masking effect: no
    	interchannel masking ratio: 0
    	...
    
    MP3 audio selected.
    Building audio filter chain for 32000Hz/2ch/s16le -> 32000Hz/2ch/s16le...
    [dummy] Was reinitialized: 32000Hz/2ch/s16le
    [format] Changing sample format from little-endian 16-bit signed int to big-endian 8-bit signed int
    [libaf] Removing filter format 
    [dummy] Was reinitialized: 32000Hz/2ch/s16le
    ======= WAVE Format =======
    Format Tag: 85 (0x55)
    Channels: 2
    Samplerate: 32000
    avg byte/sec: 24000
    Block align: 1152
    bits/sample: 0
    cbSize: 12
    mp3.wID=1
    mp3.fdwFlags=0x2
    mp3.nBlockSize=1152
    mp3.nFramesPerBlock=1
    mp3.nCodecDelay=0
    ==========================================================================
    Forcing audio preload to 0, max pts correction to 0.
    ds_fill_buffer(d_video) called
    v4l2: going to capture
    DEMUX: Append packet to d_video, len=829440  pts=0.000  pos=0  [packs: A=0 V=1]
    DEMUX: Append packet to d_video, len=829440  pts=0.000  pos=0  [packs: A=0 V=1]
    *** [scale] Exporting mp_image_t, 720x576x16bpp YUV packed, 829440 bytes
    (imgfmt: 59565955, planes: (nil),(nil),(nil) strides: 0,0,0, chroma: 0x0, shift: h:0,v:0)
    
    Skipping frame!
    ds_fill_buffer(d_video) calledps Trem:   0min   0mb  A-V:0.000 [0:0] A/Vms 0/0 D/B/S 0/1/1 
    DEMUX: Append packet to d_video, len=829440  pts=0.000  pos=0  [packs: A=0 V=1]
    
    Skipping frame!
    ds_fill_buffer(d_video) calledps Trem:   0min   0mb  A-V:0.000 [0:0] A/Vms 0/0 D/B/S 0/2/2 
    DEMUX: Append packet to d_video, len=829440  pts=0.000  pos=0  [packs: A=0 V=1]
    
    Skipping frame!
    ds_fill_buffer(d_video) calledps Trem:   0min   0mb  A-V:0.000 [0:0] A/Vms 0/0 D/B/S 0/3/3 
    DEMUX: Append packet to d_video, len=829440  pts=0.000  pos=0  [packs: A=0 V=1]
    
    Skipping frame!
    ds_fill_buffer(d_video) calledps Trem:   0min   0mb  A-V:0.000 [0:0] A/Vms 0/0 D/B/S 0/4/4 
    DEMUX: Append packet to d_video, len=829440  pts=0.000  pos=0  [packs: A=0 V=1]
    
    Skipping frame!
    ds_fill_buffer(d_video) calledps Trem:   0min   0mb  A-V:0.000 [0:0] A/Vms 0/0 D/B/S 0/5/5 
    DEMUX: Append packet to d_video, len=829440  pts=0.000  pos=0  [packs: A=0 V=1]
    
    Skipping frame!
    ds_fill_buffer(d_video) calledps Trem:   0min   0mb  A-V:0.000 [0:0] A/Vms 0/0 D/B/S 0/6/6 
    ^Z
    [3]+  Stopped                 ./mencoder_cap.sh
    dave@dave-desktop:~/Downloads/easycap_dc60.0.8.3$
    Thanks!

    Dave

    BTW - if we get this working, I'd like to go over with you afterwards what all the options mean, why you selected them, etc., so I can try to get an understanding of this. It's all new to me!

  5. #145
    Join Date
    May 2008
    Beans
    83

    Re: Linux driver for EasyCap USB2.0 Video Adapter DC60

    Hi Dave,

    That's strange - the mencoder command works fine on my Ubuntu 10.04. If I understand the situation correctly, you are getting satisfactory video and sound when you run

    ./test.sh 5

    but no output from mencoder. That's puzzling, because in many respects mencoder is almost the same as mplayer - it differs only in that it sends the output to file rather than the screen. If you have not already done so, it would be a good idea to check that `./test.sh 5` is successful for the actual videotape you are using for the mencoder tests - there might be something wrong with the tape itself.

    The mencoder messages tell me incidentally that your EasyCAP has no dedicated audio chip (because the sound is 32000Hz, not 48000Hz), but they don't explain why frames are being skipped. To capture all mencoder's messages to file, you can prepend "1>mc.out 2>mc.err" to the mencoder command, like this (all on one line):

    Code:
    1>mc.out 2>mc.err mencoder tv:// -tv driver=v4l2:norm=NTSC_M:width=640:height=480:outfmt=uyvy:device=/dev/easycap0:input=0:fps=30:adevice=/dev/easysnd1:amode=1:forceaudio:immediatemode=0 -msglevel all=9 -ffourcc DX50 -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:turbo:vbitrate=1200:keyint=15 -vf pp=lb,scale=640:480 -oac mp3lame -o test.avi
    The messages will then appear in files mc.out and mc.err and can be perused at leisure after the run has finished. I suspect, however, that the mencoder messages will not give a clear indication of what is going wrong, and it will probably be necessary to look instead at the messages written by the driver in file /var/log/kern.log. You can open this file in your editor of choice and look for lines suggesting that the driver is in distress. If you are comfortable with the vi editor, you can alternatively run ./tail.sh from the directory where the other easycap scripts are kept: this will automatically extract the lines from /var/log/kern.log which are written by the driver and display them neatly within the editor.

    Mike

  6. #146
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,439
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: Linux driver for EasyCap USB2.0 Video Adapter DC60

    Thanks again, Mike. I'll look at things later today when I'm at home again. I'd sure like to get this to work, because indeed running ./test.sh 5 works fine - in fact, the video wasn't all jittery as it is in Windows (looks like it's dropping a lot of frames there as well so the video is jumpy), so I was hoping I'd be able to capture that "not-jittery" video and audio using ubuntu and burn to dvd.

    About the audio - is it still going to be captured and play ok? It plays fine with the test, so I assumed it would.

    Audio/video files are something I have never known squat about, so I really appreciate the help!

    Dave

  7. #147
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,439
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: Linux driver for EasyCap USB2.0 Video Adapter DC60

    Well, I have no idea what I did before, but I copied the latest mencoder line you provided, where you redirect the messages from mencoder to the 2 files, and it runs fine! I replaced the line in the shell script with the line and the shell script runs fine also!

    So, THANK YOU VERY MUCH!!!

    Now, I've just got to figure out how to know when I'm at the end of the movie that's being recorded, but I know that will just be a matter of knowing the elapsed time.

    It's interesting - running this through Ubuntu and mencoder, using the same VCR, the same tape and the same Easycap plugged into the same USB port, the output in Ubuntu doesn't look all choppy - just nice and smooth! Doing this in Windows with the software supplied with the Easycap results in really choppy video, like it's dropping a lot of frames. Maybe it's because it's playing it back on screen at the same time it is recording it, whereas with mencoder there is no video being played while recording (which is fine with me!).

    So, could you perhaps explain the pieces of the mencoder line you provided that worked? I'm sure this stuff is probably tucked away in some user guide somewhere, but giving that info with this example will help me understand, and perhaps help some others also.

    Thanks again, Mike!!!

    Dave

  8. #148
    Join Date
    May 2008
    Beans
    83

    Re: Linux driver for EasyCap USB2.0 Video Adapter DC60

    Hi Dave,

    I'm relieved that it's working now - I wasn't at all confident about what to suggest next

    You may be right about the MS-Windows driver overloading the hardware by displaying the video on screen at the same time as recording, although I must say a lot of people like this feature because the on-screen video gives reassurance that the recording is actually taking place. Redirecting the mencoder messages to file with the "1>mc.out 2>mc.err" option also takes some load off the CPU: in the default arrangement where the messages are written to screen the video subsystem has to do an appreciable amount of work to render the characters, fit them in the output window, etc.

    I'm really not the person to advise on the optimization of the command line parameters for mencoder, because I very rarely do any recording nowadays either with mencoder or ffmpeg. One of my objectives when deciding to write the driver was to allow the EasyCAP DC60 to generate good recordings, but when I actually came to experiment with recording earlier this year the results were rather disappointing. I found that mencoder begins to drop frames after a while because its buffers get filled up. One might expect ffmpeg to do better in this respect, but the disadvantage of ffmpeg is that there is an unacceptable loss of audio/video synchronisation. My personal opinion is that recording with the EasyCAP on Linux is an unsolved problem, but I suppose it depends on the duration of the material to be recorded and what is regarded as acceptable quality. Maybe I just didn't try hard enough to find the right recording parameters.

    The command `man mencoder` brings up a very lengthy guide to the mencoder options which is intimidating at first, but spending 15 or 20 minutes looking through it is definitely worth the effort. For example, you'll see that if you know in advance the duration of the recording, you can include a command-line parameter to tell mencoder when to stop:

    Code:
     -endpos <[[hh:]mm:]ss[.ms]|size[b|kb|mb]> (also see -ss and -sb)
                  Stop at given time or byte position.
                  NOTE: Byte position is enabled only for MEncoder and will not be
                  accurate, as it can only stop at a frame boundary.  When used in
                  conjunction with -ss option, -endpos time will shift forward  by
                  seconds specified with -ss.
    
                  EXAMPLE:
                     -endpos 56
                          Stop at 56 seconds.
                     -endpos 01:10:00
                          Stop at 1 hour 10 minutes.
                     -ss 10 -endpos 56
                          Stop at 1 minute 6 seconds.
                     -endpos 100mb
                          Encode only 100 MB.

    Of course, knowing the syntax for setting the more sophisticated parameters isn't enough - you also need to know what values to give them, and here I guess you just have to do a bit of googling to see what is claimed to work. There's some information in the Sourceforge thread

    http://sourceforge.net/projects/easy.../topic/3534088

    but you'll certainly want to look elsewhere too in order to get a balanced view.

    Mike

  9. #149
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,439
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: Linux driver for EasyCap USB2.0 Video Adapter DC60

    Well, I put in a ending position of 01:25:00 for 1 hour and 25 minutes, and indeed it seems to have stopped then. The file on disk is under a gigabyte, yet when I try to open it in any of the media creators it says the file is almost 3 hours long. The only program I've gotten to open it (besides mplayer of course) is devede, which still said it was huge (1.98 times the size of a 4.7 gb DVD). I did the "adjust size" option in devede which immediately changed it to 99% and am trying the conversion now. My past experience with devede is not good, and I really don't expect this to be any better (sound way out of sync with video), but we'll see.

    I looked at the man pages for mencoder/mplayer and was wondering if there is a way to create a file that Windows Media Player can handle - my previous AVI outputs from mencoder cause WMP to choke.

    Thanks!
    Dave

  10. #150
    Join Date
    Nov 2008
    Location
    Sussex, England
    Beans
    871
    Distro
    Lubuntu

    Angry Re: Linux driver for EasyCap USB2.0 Video Adapter DC60

    I'm having problems with this 'ere EasyCrap device, so I just want to check that its not a known driver issue before I send it back.

    When I first plug it in and run using a command line like this:-
    Code:
    mplayer tv:// -tv device=/dev/video0:input=1:norm=PAL
    it runs for 60-70s OK, and then the picture starts to break up, just like it has lost sync. After a short time, the video stops updating and the green light then goes off.

    If I unplug it, then plug it back in and run the command again, it typically runs for 10-20s before stopping.

    It appears that if I "let it cool down" then try again, it will run for 60-70s (so the cycle repeats).

    Details:-
    Tested on Lubuntu & Ubuntu 10.10
    EzCap DC+ from Climax Digital (via Amazon)
    ID eb1a:2861 eMPIA Technology, Inc.
    From:-
    Code:
    dmesg | grep em28
    I see this...em28xx #0: Board detected as EM2860/SAA711X Reference Design

    Any clues (or a glimmer of hope) may save me postage!
    Last edited by SteveDee; November 21st, 2010 at 11:54 AM. Reason: Error in product description: should be "+" not "++"

Page 15 of 25 FirstFirst ... 51314151617 ... LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •