Author Topic: Use of webcam  (Read 78143 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2092
  • Karma: +159/-0
    • View Profile
Re: Use of webcam
« Reply #75 on: June 17, 2020, 12:10:51 pm »
Read Paul's answer:

1) it is stored here (Netlabs "PORTS" repo):
 http://svn.netlabs.org/repos/ports/libusb1/trunk/

2) bww have their own updated version in their github account

Another good example where things drift apart.

Not quite right.

I originally ported libusb and added source to http://svn.netlabs.org/repos/USB/libusb/trunk/ this is at 1.0.16 level

Later, someone decided that having it somewhere different at netlabs would be a terrific idea, and added it to http://svn.netlabs.org/repos/ports/libusb1/trunk/ - this is at 1.0.21 level

AFAICS bww haven't added to their github yet

To answer your original question though, from my POV, http://svn.netlabs.org/repos/USB/libusb/trunk/ could be removed.

Cheers,

Paul

Lars

  • Hero Member
  • *****
  • Posts: 1271
  • Karma: +65/-0
    • View Profile
Re: Use of webcam
« Reply #76 on: June 17, 2020, 01:21:42 pm »
https://github.com/bitwiseworks/libusb1-os2

I don't know the details but looking at the commits, they added some fixes, maybe because they are linking to USBCALLS.

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #77 on: June 20, 2020, 03:41:20 pm »
Hi Rémy,

Quote
No sound and only video from what I could test.
Once we are satisfied with video I will try and implement sound.

Quote
May be  webcam could be updated to use - as a generic parm for /s , could it be done ?
It could probably be done but I am not going to do that. Sorry.

Quote
Could I get video from http and stdout at the same time ?
(this would allow record the video "via stdout" and play it during recording 'http') 
Yes. Done. Acts now as an http server and/or a named pipe server and/or streams to stdout.

Quote
Output is 640x480
How to get 480p and 720p out of the webcam which is able to deliver 720p ?
Could an additional parm provide this option e.g.  /r480  or /r720 ?  (r for resolution)
Perhaps a new /rN argument (like the /fN argument) wil do?

/rN - resolution. Select Nth video streaming frame index setting.
Proper values for N are 0 up to the highest setting available on your webcam.

This way all resolutions available on your webcam could be used.

Best regards,
Wim.
« Last Edit: June 20, 2020, 03:44:11 pm by Wim Brul »

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #78 on: June 20, 2020, 06:52:30 pm »

Quote
Could I get video from http and stdout at the same time ?
(this would allow record the video "via stdout" and play it during recording 'http') 
Yes. Done. Acts now as an http server and/or a named pipe server and/or streams to stdout.

Quote
Output is 640x480
How to get 480p and 720p out of the webcam which is able to deliver 720p ?
Could an additional parm provide this option e.g.  /r480  or /r720 ?  (r for resolution)
Perhaps a new /rN argument (like the /fN argument) wil do?

/rN - resolution. Select Nth video streaming frame index setting.
Proper values for N are 0 up to the highest setting available on your webcam.

This way all resolutions available on your webcam could be used.

Best regards,
Wim.

Hi Wim,

I could start with pipe and http enabled but I'm unable to get the video out of both at the same time. only one output is usable at a time.
I would like video stream available on both output at the same (e.g. having ffplay run at the same time I run ffmpeg to control recording etc....) or run ffplay pipe at the same time as web http and have the video on both at the same time.

Yes /rN could be nice.

Regards
Rémy

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #79 on: June 20, 2020, 09:33:47 pm »
I could start with pipe and http enabled but I'm unable to get the video out of both at the same time. only one output is usable at a time.
I would like video stream available on both output at the same (e.g. having ffplay run at the same time I run ffmpeg to control recording etc....) or run ffplay pipe at the same time as web http and have the video on both at the same time.
Too bad. There must be something wrong somewhere. What do you exactly use when you attempt to get video out both at the same time?

First I use xplay.cmd which shows video from stdout:
Code: [Select]
webcam /h /n /s | ffplay -f mjpeg -framerate 50 -i -

Then I use xzhttp.cmd showing video from http server:
Code: [Select]
ffplay -f mjpeg -framerate 50 -i http://127.0.0.1:14225/

Then I use xzpipe.cmd which shows video from named pipe:
Code: [Select]
ffplay -f mjpeg -framerate 50 -i \PIPE\Webcam\Video

See attached screenshot all running at the same time with live video. I don't know why the actual video's are all black on the screenshot though.

Quote
Yes /rN could be nice.
This will be my next goal then.
« Last Edit: June 21, 2020, 10:56:53 am by Wim Brul »

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #80 on: June 21, 2020, 12:45:25 am »
I could start with pipe and http enabled but I'm unable to get the video out of both at the same time. only one output is usable at a time.
I would like video stream available on both output at the same (e.g. having ffplay run at the same time I run ffmpeg to control recording etc....) or run ffplay pipe at the same time as web http and have the video on both at the same time.
Too bad. There must be something wrong somewhere. What do you exactly use when you attempt to get video out both at the same time?

First I use xplay.cmd which shows video from stdout:
Code: [Select]
webcam /h /n /s | ffplay -f mjpeg -framerate 50 -i -

Then I use xzhttp.cmd showing video from http server:
Code: [Select]
ffplay -f mjpeg -framerate 50 -i http://127.0.0.1:14225/

Then I use xzhttp.cmd which shows video from named pipe:
Code: [Select]
ffplay -f mjpeg -framerate 50 -i \PIPE\Webcam\Video

See attached screenshot all running at the same time with live video. I don't know why the actual video's are all black on the screenshot though.

Quote
Yes /rN could be nice.
This will be my next goal then.

Hi Wim,

I apology having found what's going wrong under my ArcaOS.
In fact, wrong webcam.exe was taken !  (removed older webcam)
New test show it works well. thanks

* I use detach mode

Regards
Rémy

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4787
  • Karma: +99/-1
    • View Profile
Re: Use of webcam
« Reply #81 on: June 21, 2020, 01:12:25 am »
See attached screenshot all running at the same time with live video. I don't know why the actual video's are all black on the screenshot though.

Colourspace?

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #82 on: June 21, 2020, 02:29:54 pm »
See attached screenshot all running at the same time with live video. I don't know why the actual video's are all black on the screenshot though.

Colourspace?

I have the video under each.

Wecam masked !
Reduce framerate to 30 (this value is mostly used below 720p webcam)

You test web page should display the mjpeg  ( <img src....> )

Regards
Rémy

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #83 on: June 24, 2020, 05:49:50 pm »
Hi Rémy,
Yes /rN could be nice.
And it really is. Now up to 1080p i.e. 1920x1080 resolution.

With my dell latitude e6500 (kindly given to me by V.O.I.C.E to develop webcam support) I could only test up to 1600x1200 resolution.

Regards,
Wim.

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #84 on: June 26, 2020, 12:03:46 am »
Hi Rémy,
Yes /rN could be nice.
And it really is. Now up to 1080p i.e. 1920x1080 resolution.

With my dell latitude e6500 (kindly given to me by V.O.I.C.E to develop webcam support) I could only test up to 1600x1200 resolution.

Regards,
Wim.

Fine.
Current working results:
   QuickCam
   Pro 9000         C270
r0 160x120          640x480
r1 160x120         640x480
r2 176x144         160x120
r3 320x240         176x144
r4 352x288         320x180
r5 640x480          320x240
r6 800x600         352x288
r7 960x720         432x240
r8 1600x1200     544x288
r9                         640x360
r10                     752x416
r11                     800x448
r12                     800x600
r13                     864x480
r14                     960x544
r15                     960x720
r16                     1024x576
r17                     1184x656
r18                     1280x720
r19                    1280x960

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #85 on: June 26, 2020, 10:45:13 am »
Hi Rémy,

Good to know that it is working for you too. What actual parameters did you use?
I am asking because /m for mjpg versus /u for yuyv makes a big difference in processing.
The mjpg images are sent as is whereas the yuyv images are converted to mjpg first.

I think that for the C270 with /r4 the resolution is 320x176 rather than 320x180.

Thanks for testing and reporting back.

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #86 on: June 26, 2020, 08:55:46 pm »
Hi Rémy,

Good to know that it is working for you too. What actual parameters did you use?
I am asking because /m for mjpg versus /u for yuyv makes a big difference in processing.
The mjpg images are sent as is whereas the yuyv images are converted to mjpg first.

I think that for the C270 with /r4 the resolution is 320x176 rather than 320x180.

Thanks for testing and reporting back.

Hi Wim,

Yes, you are right, it is 320x176 with /r4   (I rounded by error the value after taking a window copy by pmview - before changing it to window interior).

I know use ffprob instead of ffplay to get all information with accurate values
webcam /s/r4 | ffprobe -i -
or
webcam /s/r4 | ffprobe -show_streams -i - | more

[STREAM]
index=0
codec_name=mjpeg
codec_long_name=Motion JPEG
profile=192
codec_type=video
codec_time_base=0/1
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=320
height=176
coded_width=320
coded_height=176
has_b_frames=0
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuvj422p
level=-99
color_range=pc
color_space=bt470bg
color_transfer=unknown
color_primaries=unknown
chroma_location=center
field_order=unknown
timecode=N/A
refs=1
id=N/A
r_frame_rate=25/1
avg_frame_rate=0/0
time_base=1/25
start_pts=N/A
start_time=N/A
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]

webcam /u/s/r4 | ffprobe -show_streams -i - | more
[STREAM]
index=0
codec_name=mjpeg
codec_long_name=Motion JPEG
profile=192
codec_type=video
codec_time_base=0/1
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=320
height=176
coded_width=320
coded_height=176
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=20:11
pix_fmt=yuvj422p
level=-99
color_range=pc
color_space=bt470bg
color_transfer=unknown
color_primaries=unknown
chroma_location=center
field_order=unknown
timecode=N/A
refs=1
id=N/A
r_frame_rate=25/1
avg_frame_rate=0/0
time_base=1/25
start_pts=N/A
start_time=N/A
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]

webcam /m/s/r4 | ffprobe -show_streams -i - | more
[STREAM]
index=0
codec_name=mjpeg
codec_long_name=Motion JPEG
profile=192
codec_type=video
codec_time_base=0/1
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=320
height=176
coded_width=320
coded_height=176
has_b_frames=0
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuvj422p
level=-99
color_range=pc
color_space=bt470bg
color_transfer=unknown
color_primaries=unknown
chroma_location=center
field_order=unknown
timecode=N/A
refs=1
id=N/A
r_frame_rate=25/1
avg_frame_rate=0/0
time_base=1/25
start_pts=N/A
start_time=N/A
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]

The strange is that I have 640x480 if no /rN parm but the second cam QuickCam pro 9000 has a 160x120 size
With the previous build, I had 640x480 in both cases without new /rN parm which was better as general default size.

Regards
Rémy

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #87 on: June 26, 2020, 09:06:43 pm »
Comparaison on the QuickCam pro 9000

webcam /m/s/r3 | ffprobe -show_streams -i - | more
[STREAM]
index=0
codec_name=mjpeg
codec_long_name=Motion JPEG
profile=192
codec_type=video
codec_time_base=0/1
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=320
height=240
coded_width=320
coded_height=240
has_b_frames=0
sample_aspect_ratio=N/A
display_aspect_ratio=N/A
pix_fmt=yuvj422p
level=-99
color_range=pc
color_space=bt470bg
color_transfer=unknown
color_primaries=unknown
chroma_location=center
field_order=unknown
timecode=N/A
refs=1
id=N/A
r_frame_rate=25/1
avg_frame_rate=0/0
time_base=1/25
start_pts=N/A
start_time=N/A
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]

webcam /u/s/r3 | ffprobe -show_streams -i - | more
[STREAM]
index=0
codec_name=mjpeg
codec_long_name=Motion JPEG
profile=192
codec_type=video
codec_time_base=0/1
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=320
height=240
coded_width=320
coded_height=240
has_b_frames=0
sample_aspect_ratio=1:1
display_aspect_ratio=4:3
pix_fmt=yuvj422p
level=-99
color_range=pc
color_space=bt470bg
color_transfer=unknown
color_primaries=unknown
chroma_location=center
field_order=unknown
timecode=N/A
refs=1
id=N/A
r_frame_rate=25/1
avg_frame_rate=0/0
time_base=1/25
start_pts=N/A
start_time=N/A
duration_ts=N/A
duration=N/A
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
DISPOSITION:timed_thumbnails=0
[/STREAM]

Note: without /u or /m parm,

QuickCam pro 9000 has:
started.
format:yuyv

while C270 has
started.
format:mjpg

Regards
Rémy
 

Wim Brul

  • Sr. Member
  • ****
  • Posts: 295
  • Karma: +25/-0
    • View Profile
    • Wim's home page
Re: Use of webcam
« Reply #88 on: June 27, 2020, 03:13:58 pm »
Hi Rémy,

Quote
The strange is that I have 640x480 if no /rN parm but the second cam QuickCam pro 9000 has a 160x120 size
With the previous build, I had 640x480 in both cases without new /rN parm which was better as general default size.

All webcams are not equal. Most supply both mjpg and yuyv formats while some provide just mjpg or yuyv formats.
Also the number of resolutions as well as the sequence of these in the list of supported formats varies by webcam.
Right now without /rN parm the first entry in that list is taken. Hence becomes 160x120 for the QuickCam pro 9000.
Since you prefer 640x480 default for all webcams I could change that behavior to force 640x480 instead. But...

It might be better to drop the /rN parameter in favor of /xN and /yN parameters.
The list will be scanned until a match with the /xN and /yN parameters is found.
If only the /xN parameter is used then only a match with /xN will be performed.
If only the /yN parameter is used then only a match with /yN will be performed.
Without /xN and /yN parameters the list is scanned for 640x480 resolution.

What do you think?

Regards,
Wim.
 
 

Remy

  • Hero Member
  • *****
  • Posts: 645
  • Karma: +9/-1
    • View Profile
Re: Use of webcam
« Reply #89 on: June 29, 2020, 01:29:41 pm »
Hi Rémy,

Quote
The strange is that I have 640x480 if no /rN parm but the second cam QuickCam pro 9000 has a 160x120 size
With the previous build, I had 640x480 in both cases without new /rN parm which was better as general default size.

All webcams are not equal. Most supply both mjpg and yuyv formats while some provide just mjpg or yuyv formats.
Also the number of resolutions as well as the sequence of these in the list of supported formats varies by webcam.
Right now without /rN parm the first entry in that list is taken. Hence becomes 160x120 for the QuickCam pro 9000.
Since you prefer 640x480 default for all webcams I could change that behavior to force 640x480 instead. But...

It might be better to drop the /rN parameter in favor of /xN and /yN parameters.
The list will be scanned until a match with the /xN and /yN parameters is found.
If only the /xN parameter is used then only a match with /xN will be performed.
If only the /yN parameter is used then only a match with /yN will be performed.
Without /xN and /yN parameters the list is scanned for 640x480 resolution.

What do you think?

Regards,
Wim.
 

Hi Wim,

Your suggestion seems easier tu use.
In addition to your suggest, may I suggest to add:
If /xN nor /yN parameters are found, the list is scanned for 640x480 resolution.

Ak.

Regards
Rémy