OS/2, eCS & ArcaOS - Technical > Multimedia

Use of webcam

<< < (32/35) > >>

Wim Brul:
Hi Remy,

Test results with WCC_updated-21072020_nodoc.zip:

1. I saw the "Missing Requirements" popup several times.
    Each time only once just after booting op the system.
    But not always. Too short timeout perhaps?

2. Now all yuyv formats are found for the builtin webcam.
    1600x1200 and 1280x1024 formats only show with the [] button.
    Perhaps because my laptop screen size is 1440x900 pixels?

3. Cam-Intf range is 1:9 but logitech webcams have 1:11 range.
    There could be webcams out there with even a larger range.

4. Audio does not work with my ffmpeg 2.8.6-2 installation.
    Without -volume 30 and without -nodisp audio works.
    And without -sync ext audio works somewhat better.

5. When I set Defaults Audio to 22050HZ then 48000 Hz is used.
    When I set Defaults Audio to 44100HZ then 48000 Hz is used.
    The c250/c270 webcams support 16000/24000/32000/48000 Hz.
    I could make these deliver 22050 Hz and 44100 Hz too.
    At least the list must include 24000 Hz and 32000 Hz.

Regards,
Wim.

Remy:

--- Quote from: Wim Brul on July 22, 2020, 06:24:09 pm ---Hi Remy,

Test results with WCC_updated-21072020_nodoc.zip:

1. I saw the "Missing Requirements" popup several times.
    Each time only once just after booting op the system.
    But not always. Too short timeout perhaps?

2. Now all yuyv formats are found for the builtin webcam.
    1600x1200 and 1280x1024 formats only show with the [] button.
    Perhaps because my laptop screen size is 1440x900 pixels?

3. Cam-Intf range is 1:9 but logitech webcams have 1:11 range.
    There could be webcams out there with even a larger range.

4. Audio does not work with my ffmpeg 2.8.6-2 installation.
    Without -volume 30 and without -nodisp audio works.
    And without -sync ext audio works somewhat better.

5. When I set Defaults Audio to 22050HZ then 48000 Hz is used.
    When I set Defaults Audio to 44100HZ then 48000 Hz is used.
    The c250/c270 webcams support 16000/24000/32000/48000 Hz.
    I could make these deliver 22050 Hz and 44100 Hz too.
    At least the list must include 24000 Hz and 32000 Hz.

Regards,
Wim.

--- End quote ---

1/ I run in detach mode a process. May be your system isn't fully available when WCC is run ! (I run it under a delayed start folder "AN")
    I added a short delay near what I use under mys system to not having trouble running some process in detach mode and add an extra delay if this process didn't reply in the expected time delay)

2/ If you have virtual desktop, it should display with a part in the next window... (So doesn't look under my system when I select the highest size above my screen size)...  When you use the show button, video size is what webcam provides (no specified size under ffplay) using Size setting. The [] uses the same webcam setting but ffplay has a size set to the min-size  (At start, it may display for a fraction of seconds, original webcam size set but immedialtly, it switches to the specified min-size.
note1: sometimes, I have no output from first webcam start but all next restart work
note2: Now, if you select a Size above what your screen is able, the Text Size goes into red.

3/ increased to 15

4/ "Without -volume 30 and without -nodisp audio works"
     It must work but I think your system audio level is set very low (ref for 100) and when 30 is used, the audio is then very very low may be like no sound (I'll added an option to use default volume at 100 or to reduce it to 50). -nodisp has no impact here and prevent video simulation process for audio stream. About -sync ext (it improves a little audio latency under my system but it could have a little impact on audio under some systems. I removed it

    As I wrote it, audio is comming later then the video (about 2s). You have to wait to hear the audio... Under ffplay, I reduces as much as possible but I know it will introduce long delay du to ffplay internal process. 

5/ 24000 and 32000 added
    When you set 22050HZ, /a22050 is set on webcam (no other value is possible using this setting and so is it for other audio sample settings).
    I did a try  webcam /a22050 | ffplay -f wav -i \PIPE\Webcam\Audio  and I have 48000
    With -f wav , ffplay provides 48000 for the received input stream   (webcam sends wav audio stream)
    I tried -f s16le - ffplay provides 44100 for the received input stream   (but bad audio in this case due input is wav)
    The issued webcam command is correct. In fact, no matter if ffplay output has higher sampling then the input stream.
    If webcam could send needed information to allow ffplay to auto detect the codec, this would prevent -f wav use. 
   
     

Wim Brul:
Hi Remy,

Thank you for your explanations and modifications. WCC_update-22072020.zip works well.

Only audio does not work for me because I have ffmpeg 2.8.6-2 installed which does not support -volume 30 nor -nodisp.

--- Quote ---4/ "Without -volume 30 and without -nodisp audio works"
     It must work but I think your system audio level is set very low (ref for 100) and when 30 is used, the audio is then very very low may be like no sound (I'll added an option to use default volume at 100 or to reduce it to 50). -nodisp has no impact here and prevent video simulation process for audio stream.

--- End quote ---
That is not the case. It does not work because I am using ffmpeg 2.8.6-2 which rejects -volume 30 and -nodisp.

I have updated webcam.exe because:
A. It now recognizes webcams better while scanning descriptors.
B. It may obtain 22050/44100 Hz. audio streams from logitech webcams.
Note: Audio capabilities are still hardcoded i.e. descriptors not scanned.


--- Quote ---May be wmaudio could provide a syncronized audio with the ffplay video output !

--- End quote ---
I added wmaudio.exe - Webcam Monitor Audio for OS/2 - first beta version.
Not really synchronized but perhaps more appropriate.
 
Best regards,
Wim.

Remy:

--- Quote from: Wim Brul on July 23, 2020, 06:09:30 pm ---Hi Remy,

Thank you for your explanations and modifications. WCC_update-22072020.zip works well.

Only audio does not work for me because I have ffmpeg 2.8.6-2 installed which does not support -volume 30 nor -nodisp.

--- Quote ---4/ "Without -volume 30 and without -nodisp audio works"
     It must work but I think your system audio level is set very low (ref for 100) and when 30 is used, the audio is then very very low may be like no sound (I'll added an option to use default volume at 100 or to reduce it to 50). -nodisp has no impact here and prevent video simulation process for audio stream.

--- End quote ---
That is not the case. It does not work because I am using ffmpeg 2.8.6-2 which rejects -volume 30 and -nodisp.

>> ok, parms have changed (not supported)


I have updated webcam.exe because:
A. It now recognizes webcams better while scanning descriptors.
B. It may obtain 22050/44100 Hz. audio streams from logitech webcams.
Note: Audio capabilities are still hardcoded i.e. descriptors not scanned.


--- Quote ---May be wmaudio could provide a syncronized audio with the ffplay video output !

--- End quote ---
I added wmaudio.exe - Webcam Monitor Audio for OS/2 - first beta version.
Not really synchronized but perhaps more appropriate.
 
Best regards,
Wim.

--- End quote ---

Nice.
I just did a few test (audio delay seems to be much better but not enough time to be sure "larsen")
tried with c270: default or /a3 provides no audio, I have to set /a1 to get some audio

Now, 22050 and 44100 provides correct results as expected. 

But I can not reduce its volume and it goes immediately into larsen at full volume level. It seems that PMUNIMIX loses control. May it possible to add a volume level flag to wmaudio ?  /vNNN or something like that (volume level adjustable from 0 to 100 ? like ffplay has)
Thanks

regards
Rémy 

Remy:
Hi Wim,

I tried other test using webcam and ffmpeg
- Latency is not a real problem recording video with ffmpeg
- But it is if the output should be streamed

My ffmpeg test show audio having a delay against video but it seems to me that the tempo isn't fully correct.
I tried several ffmpeg test but I didn't find the right setting up to know.
My latest test:
webcam set to 640x360 and audio to 22050
ffmpeg -y -thread_queue_size 128 -f:a atempo=1.01 -f wav -ac 1 -i \PIPE\Webcam\Audio -itsoffset 2.80 -thread_queue_size 128 -framerate 25 -f mjpeg -i \PIPE\Webcam\Video -q:v 4 -vcodec copy -acodec copy -async 1 -threads 2 output.avi

itsoffset reduces audio delay
-tread_queue_size 128 to prevent some messages
copy for video and audio to not convert
async 1 (to try to maintain in sync quickly)
treads 2 to optimize process
outup as avi because it is compatible with wav and mjped
q:v 4 to set video quality
Because audio seems slower than the video, I added atempo to try having a better result (supported with recent ffmpeg build ok with 4.0.2)
(note: setting a slower framerate than 25 could help but to much dropped frames)
The result is better but not good at all...

Any suggestion to improve sync and final result is wellcome

Tried:
ffmpeg -y -thread_queue_size 192 -f:a atempo=1.02 -f wav -ac 1 -i \PIPE\Webcam\Audio -itsoffset 3.23 -thread_queue_size 64 -framerate 16 -f mjpeg -i \PIPE\Webcam\Video -q:v 4 -vcodec copy -acodec copy -async 1 -threads 2 output.avi

Reducing video framerate to 16 instead of source 25 makes things a little bit better. It looks like the video is too fast or audio too slow ! 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version