Author Topic: Use of webcam  (Read 19849 times)

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 215
  • Posts: 3024
  • Karma: +45/-0
    • View Profile
Re: Use of webcam
« Reply #30 on: May 26, 2020, 05:10:45 pm »
Hi Remy,
My understanding is that there was a "RFC" type document for USB at the beginning and IBM faithfully followed it. Unluckily Microsoft didn't, as well as all their vendors so we're left trying to implement the MS version of USB rather then the official implementation.
As for Arca Noae's more recent drivers, my guess is they're mostly focusing on getting USB3 working and once that's done, they'll fix USBCALLS and such. USB3 seems to have turned out much harder then they first thought it seems.

roberto

  • Hero Member
  • *****
  • Thank You
  • -Given: 18
  • -Receive: 13
  • Posts: 596
  • Karma: +1/-0
    • View Profile
Re: Use of webcam
« Reply #31 on: May 26, 2020, 07:46:49 pm »
Your query of usb12.05 and the closing of Thunderbird 45.8.0 in standard memory and in highmem.
When I select forward a message, the thunderbird closes.

It is not a problem of the usb12.05
It seems that the error has been when updating the library  libstdc++-fwd
The anpm log shows an error, which did not appear on the screen after updating. And that seems to be my
 problem. sorry.
 
 ----------[ 26 May 2020 19:18:08 ]----------
Executing: @python C:\SYS\APPS\ANPM\scripts\yum_update_dep.py libstdc++-fwd
Return code: 0
----------[ 26 May 2020 19:18:21 ]----------
Executing: @python C:\SYS\APPS\ANPM\scripts\yum_update.py libstdc++-fwd
Ejecutando verificación de transacción
PackageSackError(): Rpmdb checksum is invalid: dCDPT(pkg checksums): libgcc.i686 0:9.2.0-4.oc00 - u
Error: Rpmdb checksum is invalid: dCDPT(pkg checksums): libgcc.i686 0:9.2.0-4.oc00 - u
PackageSackError()
Return code: 0

Remy

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 15
  • Posts: 408
  • Karma: +0/-0
    • View Profile
Re: Use of webcam
« Reply #32 on: May 26, 2020, 08:24:26 pm »
Hi Remy,
My understanding is that there was a "RFC" type document for USB at the beginning and IBM faithfully followed it. Unluckily Microsoft didn't, as well as all their vendors so we're left trying to implement the MS version of USB rather then the official implementation.
As for Arca Noae's more recent drivers, my guess is they're mostly focusing on getting USB3 working and once that's done, they'll fix USBCALLS and such. USB3 seems to have turned out much harder then they first thought it seems.

Thanks for your reply Dave.
Yes, I could read some information that USB3 implementation requires lot of work and harder as expected (buffer size etc...)

Regards

Rich Walsh

  • Full Member
  • ***
  • Thank You
  • -Given: 1
  • -Receive: 14
  • Posts: 138
  • Karma: +2/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Use of webcam
« Reply #33 on: May 27, 2020, 05:10:03 am »
As for Arca Noae's more recent drivers, my guess is they're mostly focusing on getting USB3 working and once that's done, they'll fix USBCALLS and such.

What exactly needs fixing in USBCALLS or anywhere else? Just because someone mentioned it in passing as a possible cause doesn't make it so. In fact, I went through AN's Mantis bugtracker and found remarkably few open USB tickets - and most of those pertained to USB3.

In my search, I did find one comment from David A (the USB developer) that's relevant here. He said that he uses a "046D:0804" as part of his QA testing and that it works "just fine". I wouldn't have known what device that was if it weren't the very first one on Wim's "USB Webcam Tests" page: a Logitech C250 Webcam.

So, at this point we know that one program is able to establish an isochronous connection with a common webcam using v12.04/12.05 while another isn't. Until someone files a ticket with AN and/or Wim cares to look into this, that's _all_ we know. IMO, it's way too early to play the blame game.

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 215
  • Posts: 3024
  • Karma: +45/-0
    • View Profile
Re: Use of webcam
« Reply #34 on: May 27, 2020, 07:02:20 am »
I probably got confused by something mentioned on the testers list in answer to Doug's question about USB on the 20th.

Wim Brul

  • Full Member
  • ***
  • Thank You
  • -Given: 5
  • -Receive: 42
  • Posts: 234
  • Karma: +9/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #35 on: May 27, 2020, 05:11:57 pm »
In my search, I did find one comment from David A (the USB developer) that's relevant here. He said that he uses a "046D:0804" as part of his QA testing and that it works "just fine". I wouldn't have known what device that was if it weren't the very first one on Wim's "USB Webcam Tests" page: a Logitech C250 Webcam.

So, at this point we know that one program is able to establish an isochronous connection with a common webcam using v12.04/12.05 while another isn't. Until someone files a ticket with AN and/or Wim cares to look into this, that's _all_ we know. IMO, it's way too early to play the blame game.

Too early to file a ticket. Right now I am busy testing isochronous transfers with my Logitech C250 Webcam using the usbecd.sys interface. Will take some time though.

Andy Willis

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 11
  • Posts: 221
  • Karma: +0/-0
    • View Profile
Re: Use of webcam
« Reply #36 on: May 28, 2020, 05:10:59 am »
Could Andy or Roderick help with they suggestions about how to progress into this "no more working issue"?
Open a Mantis ticket, be sure to include a testlog that was run with the desired hardware plugged in.  Even if it turns out to be an issue in third party software, we'll look at the issue to try to make that determination.
Be sure to give a good description of what you are attempting and any errors that you receive. 
I can tell you that isochronous support is available, I cannot say it is impossible for there to be an issue with it.

Remy

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 15
  • Posts: 408
  • Karma: +0/-0
    • View Profile
Re: Use of webcam
« Reply #37 on: May 29, 2020, 08:11:00 pm »
Could Andy or Roderick help with they suggestions about how to progress into this "no more working issue"?
Open a Mantis ticket, be sure to include a testlog that was run with the desired hardware plugged in.  Even if it turns out to be an issue in third party software, we'll look at the issue to try to make that determination.
Be sure to give a good description of what you are attempting and any errors that you receive. 
I can tell you that isochronous support is available, I cannot say it is impossible for there to be an issue with it.

Thanks Andy,
I followed your suggestion and AN found the issue

In fact: The code has nothing to do with isochronous transfers and it seems to be a buffer pointer verification error
I just tested a correction and it works (have to wait on next v12.6)

Now, how to get audio out of the webcam ?
Any idea ?

Regards
Rémy

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 215
  • Posts: 3024
  • Karma: +45/-0
    • View Profile
Re: Use of webcam
« Reply #38 on: May 30, 2020, 02:22:40 am »
Is it just a regular USB microphone? I had a turntable that presented itself as a USB microphone and it just worked. Unluckily I forget the specifics.

Remy

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 15
  • Posts: 408
  • Karma: +0/-0
    • View Profile
Re: Use of webcam
« Reply #39 on: May 30, 2020, 11:36:50 am »
Is it just a regular USB microphone? I had a turntable that presented itself as a USB microphone and it just worked. Unluckily I forget the specifics.

Hi Dave,

The microphone is the one included into the C270. How to make it work ?
Which application to use, how to find the USB microphone information to bind with, any tools ? how to enable it ? ....

As you see, I have a lot of questions :D

Regards
Rémy

Dave Yeo

  • Hero Member
  • *****
  • Thank You
  • -Given: 13
  • -Receive: 215
  • Posts: 3024
  • Karma: +45/-0
    • View Profile
Re: Use of webcam
« Reply #40 on: May 30, 2020, 05:56:36 pm »
As I said, it was some time back and all I was doing was saving to a wav file to convert to MP3. It was likely with the default usbaudio (from IBM dated 2001) at the time. Unluckily for what you need would probably be tricky as you'd need to use 2 sound devices at the same time, USB Audio to read the microphone and another audio device to play it.

Remy

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 15
  • Posts: 408
  • Karma: +0/-0
    • View Profile
Re: Use of webcam
« Reply #41 on: May 30, 2020, 08:10:35 pm »
May b Wim could help on this webcan part ?

Full information about c270 found:

Device 3:
  ctrlID=3 DevAdr=0 ConfigVal=5 IfNo=1 Speed=2 Port=4 HubIx=4
  USB Release number=0x200 DevReleaseNumber=0x10
  Class=239 SubClass=2 Protocol=1 MaxPacketSize=64
  Vendor:Product=046d:0825 NumConfigurations=1
  Configuration: NumInterfaces=4 ConfigValue=1 StringIx=0 Attr=0x80 MaxPower=250
  Interface 0: Alt=0 nEP=1 Class=14(Video) SubClass=1 Protocol=0 StringIx=0
  Endpoint: Adr=0x87 Attr=0x3 MaxPktSize=16 Interval=8
  Interface 1: Alt=0 nEP=0 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Interface 1: Alt=1 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=192 Interval=1
  Interface 1: Alt=2 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=384 Interval=1
  Interface 1: Alt=3 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=512 Interval=1
  Interface 1: Alt=4 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=640 Interval=1
  Interface 1: Alt=5 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=800 Interval=1
  Interface 1: Alt=6 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=944 Interval=1
  Interface 1: Alt=7 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=2688 Interval=1
  Interface 1: Alt=8 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=2848 Interval=1
  Interface 1: Alt=9 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=3040 Interval=1
  Interface 1: Alt=10 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=4992 Interval=1
  Interface 1: Alt=11 nEP=1 Class=14(Video) SubClass=2 Protocol=0 StringIx=0
  Endpoint: Adr=0x81 Attr=0x5 MaxPktSize=5116 Interval=1
  Interface 2: Alt=0 nEP=0 Class=1(Audio) SubClass=1 Protocol=0 StringIx=0
  Interface 3: Alt=0 nEP=0 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=1 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=2 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=3 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=4 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0


Wim Brul

  • Full Member
  • ***
  • Thank You
  • -Given: 5
  • -Receive: 42
  • Posts: 234
  • Karma: +9/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #42 on: May 31, 2020, 10:40:06 am »
Quote
  Interface 2: Alt=0 nEP=0 Class=1(Audio) SubClass=1 Protocol=0 StringIx=0
  Interface 3: Alt=0 nEP=0 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=1 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=2 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=3 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=4 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0

The information on audio is rather meager i.e. even endpoint information is missing.
Fortunately I have lsusb reports from both c250 and c270 webcams and the audio descriptors appear to be identical.
The inbuild microphone may deliver 16-bit mono at 16000/ 24000/32000/48000 Hz.

I have experimented in the past to obtain audio from the c250 webcam and it appears to be possible.
The big question is what to do with the audio data once obtained. Should it go to the default audio device?
The truth is that I am not really an application programmer, so I want this to be as simple as it can be.

I also tried to have usbaudio.sys recognize the c250 microphone but I gave up on that.

Remy

  • Sr. Member
  • ****
  • Thank You
  • -Given: 1
  • -Receive: 15
  • Posts: 408
  • Karma: +0/-0
    • View Profile
Re: Use of webcam
« Reply #43 on: May 31, 2020, 11:20:55 am »
Quote
  Interface 2: Alt=0 nEP=0 Class=1(Audio) SubClass=1 Protocol=0 StringIx=0
  Interface 3: Alt=0 nEP=0 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=1 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=2 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=3 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0
  Interface 3: Alt=4 nEP=1 Class=1(Audio) SubClass=2 Protocol=0 StringIx=0

The information on audio is rather meager i.e. even endpoint information is missing.
Fortunately I have lsusb reports from both c250 and c270 webcams and the audio descriptors appear to be identical.
The inbuild microphone may deliver 16-bit mono at 16000/ 24000/32000/48000 Hz.

I have experimented in the past to obtain audio from the c250 webcam and it appears to be possible.
The big question is what to do with the audio data once obtained. Should it go to the default audio device?
The truth is that I am not really an application programmer, so I want this to be as simple as it can be.

I also tried to have usbaudio.sys recognize the c250 microphone but I gave up on that.

Hi Wim,

I understand.
Having the possibility to get the audio usable as input to ffmpeg (stdout / pipe) in a compatible format would be nice and like this, it could be sent to ffplay etc...

Thanks and kind regards
Rémy

Q: may it be possible to update uvcscope to be able to stream the video to stdout or pipe, usable as input for ffmpeg ?

- This will make webcam usable to record video
- For the integrated microphone, record audio
« Last Edit: May 31, 2020, 12:03:28 pm by Remy »

Wim Brul

  • Full Member
  • ***
  • Thank You
  • -Given: 5
  • -Receive: 42
  • Posts: 234
  • Karma: +9/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #44 on: June 01, 2020, 03:23:13 pm »
I have read some of the ffmpeg documentation and rfc1341(mime).

Section 20.15 mpjpeg - MJPEG encapsulated in multi-part MIME demuxer. 
Suppose the webcam streams mjpg video through "\PIPE\Webcam\Video".
Would the following be correct to play that mjpg video?

"ffplay -f mpjpeg \PIPE\Webcam\Video"
"ffplay -f mpjpeg Strict_mime_boundary 0 \PIPE\Webcam\Video"
"ffplay -f mpjpeg Strict_mime_boundary 1 \PIPE\Webcam\Video"

What are the exact mime headers to be used?

Section 20.16 rawvideo - Raw video demuxer.
Suppose the webcam streams yuyv video through "\PIPE\Webcam\Video".
Would the following be correct to play that yuyv video?

"ffplay -f rawvideo -video_size 640x480 \PIPE\Webcam\Video"
"ffplay -f rawvideo -pixel_format yuv420p -video_size 640x480 -framerate 10 \PIPE\Webcam\Video"

The above assumes that the original mjpg/yuyv video from the webcam will be streamed.
An alternative could be to stream rgb24/mjpg snapshots from the application window?