OS/2, eCS & ArcaOS - Technical > Hardware

WebCam Driver Question

<< < (10/13) > >>

Dave Yeo:
I think what needs to be done is the audio and video streams being muxed into a container such as AVI, WEBM or Matroska so that the video and audio are in sync. The program to do that is FFmpeg where you should be able to pipe or feed the files into it and get a stream out.
There's likely directions of the internet for doing it.
Even better would be to use FFmpeg's libavcodec in a program to do the muxing, beyond my abilities.

Remy:

--- Quote from: Dave Yeo on January 28, 2021, 04:30:06 pm ---I think what needs to be done is the audio and video streams being muxed into a container such as AVI, WEBM or Matroska so that the video and audio are in sync. The program to do that is FFmpeg where you should be able to pipe or feed the files into it and get a stream out.
There's likely directions of the internet for doing it.
Even better would be to use FFmpeg's libavcodec in a program to do the muxing, beyond my abilities.

--- End quote ---

I'm already working on ....  under Avxcat v2

Review some information from older post:
https://www.os2world.com/forum/index.php/topic,2453.msg27476.html#msg27476

Syntax I use has changed a lot due to syncro issue and other issue using latest ffmpeg (release 4.2.2-3)
I could get better result inverting audio and video input file order.
Sharing with you, here is a working example :
Of course, You have to start Wim's exes first.
ffmpeg -y -use_wallclock_as_timestamps 1 -thread_queue_size 64 -i \PIPE\Webcam\Audio -itsoffset 1.05 -use_wallclock_as_timestamps 1 -thread_queue_size 64 -f mjpeg -i \PIPE\Webcam\Video -c:v copy -c:a copy -map 1:v:0 -map 0:a:0 mywebcam.avi

(adjust -itsoffset 1.05 value if you have video/audio not syncro)

Of course, you can make the choice to change avi to mp4 etc.... but this will introduce ffmpeg process which could impact result at this step.
I've got some better results piping ffmpeg result into an other ffmpeg process.
ffmpeg -y -use_wallclock_as_timestamps 1 -thread_queue_size 64 -i \PIPE\Webcam\Audio -itsoffset 1.05 -use_wallclock_as_timestamps 1 -thread_queue_size 64 -f mjpeg -i \PIPE\Webcam\Video -c:v copy -c:a copy -map 1:v:0 -map 0:a:0 -f avi - |ffmpeg -i - mywebcam.mp4

Output of the second ffmpeg (or directly from first process) could be of other type (e.g. flv for rtmp...). You'll have visible latency due to ffmpeg process time (some special parameters exist to reduce streaming latency but already exist)

Warning: Piping from firs FFMPEG into second FFMPEG may consume a high amount of storage
From what I could see, about 174Mb shared low storage while runing only one ffmpeg step with avi output file requires about 42Mb shared low storage.
ffmpeg -y -use_wallclock_as_timestamps 1 -thread_queue_size 64 -i \PIPE\Webcam\Audio -itsoffset 1.05 -use_wallclock_as_timestamps 1 -thread_queue_size 64 -f mjpeg -i \PIPE\Webcam\Video -c:v copy -c:a copy -map 1:v:0 -map 0:a:0 mywebcam.avi    (or -f avi mywebcam.avi or any other format)

Note: If you start webcam through WCC, you can display/control current recording using:
 ffplay -i http://127.0.0.1:14225 -x 190 -y 144

Remy:

--- Quote from: Wim Brul on January 20, 2021, 11:57:26 am ---
--- Quote from: Remy on January 19, 2021, 07:24:03 pm ---Hi Wim,

It works nice since.

Regards
Rémy

--- End quote ---

Hi Rémy,

Fine. In the meantime I have updated webcam.exe and wmaudio.exe and added  wmvideo.exe and I think my package is now complete.
I think I tested it with your wcc.exe but I don't remember. My memory is getting worse. I have attached it here so Martin could try these too.

@Martin - Use "webcam /n" to start the Webcam Server and use "wmvideo /n" to start the Webcam Monitor Video and see what you get.

Regards,
Wim

--- End quote ---

Hi Wim,

This latest build has always 48000Hz audio output !
I went back to the previous build which allow me to set 44100Hz

Regards
Rémy

Wim Brul:

--- Quote from: Remy on January 29, 2021, 01:25:24 am ---
--- Quote from: Wim Brul on January 20, 2021, 11:57:26 am ---
--- Quote from: Remy on January 19, 2021, 07:24:03 pm ---Hi Wim,

It works nice since.

Regards
Rémy

--- End quote ---

Hi Rémy,

Fine. In the meantime I have updated webcam.exe and wmaudio.exe and added  wmvideo.exe and I think my package is now complete.
I think I tested it with your wcc.exe but I don't remember. My memory is getting worse. I have attached it here so Martin could try these too.

@Martin - Use "webcam /n" to start the Webcam Server and use "wmvideo /n" to start the Webcam Monitor Video and see what you get.

Regards,
Wim

--- End quote ---

Hi Wim,

This latest build has always 48000Hz audio output !
I went back to the previous build which allow me to set 44100Hz

Regards
Rémy

--- End quote ---

My latter build takes the audio sample frequency specified by the user and validates it against the usb audio descriptors of the webcam. Logitech c250/c270/pro9000 webcams do not support 44100 Hz. according to their audio descriptors and since the last scanned audio descriptor specifies 48000 Hz. this frequency is used. Similarly 16000 Hz. will be used by the Logitech Quickcam Pro for Notebooks because this is the only audio frequency that this webcam reports supported. This latter build is supposed to work with audio from all kinds of uvc compliant webcams.

On the contrary my former build takes the audio sample frequency specified by the user and validates it using a list of hardcoded values that work with the Logitech c250/c270/pro9000 webcams and this list includes 22050 Hz. and 44100 Hz. that happen to work on these webcams despite of the fact that their usb audio decriptors omit these. Scanning of usb audio descriptors was not yet implemented but that is really the way to go.

Martin Iturbide:

--- Quote from: Wim Brul on January 24, 2021, 05:43:23 pm ---Hi Martin,


--- Quote ---I wanted to test any kind of sound from my USB Webcam - Logitech C920 HD Pro Webcam
I'm using "Webcam00-20210120.zip" and Lar's USBAUDIO.

--- End quote ---

Please attach lsusb report of this camera for me to inspect.


--- End quote ---

Hi

I have a strange behavior with lsusb (lsusb-20130526.zip) with this device. If I don't plug the camera, I get the normal report. If I plugged the camera, I get no report at all from any device. Even that  "webcam /n" is working fine to see video from the webcam.

Any other tip to get the USB hardware report?

Regards

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version