OS/2, eCS & ArcaOS - Technical > Multimedia

Use of webcam

<< < (33/35) > >>

Wim Brul:
Hi Remy,


--- Quote ---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

--- End quote ---
On my DELL Latitude E6500 laptop /a1 is the builtin audio adapter and /a2 is the Conceptronic CSOUNDU and /a3 is the Behringer UMC204HD.
The Behringer UMC204HD is setup as the default device and thus on my system /a0 is that adapter too.
See USB Audio Adapters on my website. ;) Now you know where wmaudio is coming from.


--- Quote ---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)

--- End quote ---
Done. I added the /vN parameter and I changed the default of the /aN parameter. See wmaudio.txt for more information.

Regards,
Wim.

Remy:

--- Quote from: Wim Brul on July 25, 2020, 09:57:16 am ---Hi Remy,


--- Quote ---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

--- End quote ---
On my DELL Latitude E6500 laptop /a1 is the builtin audio adapter and /a2 is the Conceptronic CSOUNDU and /a3 is the Behringer UMC204HD.
The Behringer UMC204HD is setup as the default device and thus on my system /a0 is that adapter too.
See USB Audio Adapters on my website. ;) Now you know where wmaudio is coming from.


--- Quote ---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)

--- End quote ---
Done. I added the /vN parameter and I changed the default of the /aN parameter. See wmaudio.txt for more information.

Regards,
Wim.

--- End quote ---

Hi Wim,

I have good results using wmaudio  (I could limit larsen when using PC HPs and hear me very good using headphones)
I did more test using ffmpeg and the strange I found is that the c270 output specifies a framerate of 25 but in fact, it isn't due I have to use framerate 15 to get a ormal video output speed (with ffplay, framerate doesn't change the video speed but it helps to drop latency, read buffer..) . A test which allow me to have a nearly "syncronized" video file (it can be adjusted changing parm -itsoffset value).

switched from mjpeg to yuyv (better for syncro) for webcam with audio rate 48000 or 44100   
Used following command (inverted video and audio order compared ti my previous test and it is better)

ffmpeg -itsoffset 2.38 -framerate 15 -thread_queue_size 128 -f mjpeg -i \PIPE\Webcam\Video -thread_queue_size 192 -f wav -i \PIPE\Webcam\Audio -probesize 128 -q:v 5 -vsync 1 -threads 2 test.avi

A 30s recording test provided me a better result than all tests I previously did.
(wait about 3s second having started the recording to start speak etc...)   

Regards
Rémy

An updated WCC will be available soon.

Remy:
WCC update (including wmaudio volume reduction (one setting only to prevent larsen)

Wim Brul:
Hi Remy,

To record zmovie.avi I used webcam.exe /a/n and the following line:

ffmpeg -async 1 -framerate 25 -itsoffset 2.0 -i \PIPE\Webcam\Video -i \PIPE\Webcam\Audio -c:v copy -c:a copy -map 0:0 -map 1:0 zmovie.avi

And it works very well. The following line produces compressed output (10 times reduction in filesize):

ffmpeg -async 1 -framerate 25 -itsoffset 2.0 -i \PIPE\Webcam\Video -i \PIPE\Webcam\Audio -map 0:0 -map 1:0 zmovie.avi

And works very well too. But I do prefer the uncompressed movie.

There is no delay in the recorded audio and it stays in sync.

Best regards,
Wim.

Remy:

--- Quote from: Wim Brul on July 26, 2020, 07:16:37 pm ---Hi Remy,

To record zmovie.avi I used webcam.exe /a/n and the following line:

ffmpeg -async 1 -framerate 25 -itsoffset 2.0 -i \PIPE\Webcam\Video -i \PIPE\Webcam\Audio -c:v copy -c:a copy -map 0:0 -map 1:0 zmovie.avi

And it works very well. The following line produces compressed output (10 times reduction in filesize):

ffmpeg -async 1 -framerate 25 -itsoffset 2.0 -i \PIPE\Webcam\Video -i \PIPE\Webcam\Audio -map 0:0 -map 1:0 zmovie.avi

And works very well too. But I do prefer the uncompressed movie.

There is no delay in the recorded audio and it stays in sync.

Best regards,
Wim.

--- End quote ---

Oh well done,
I have missplaced parameters...

Your command line as given:
It will not work with ffmpeg 4.0.2 and up  (many options or parameters changed between versions.
(I have to check ffmpeg version to use correct ffmpeg version/parameters under AVxCAT) 

ffmpeg -async 1 -framerate 25 -itsoffset 2.0 -i \PIPE\Webcam\Video -i \PIPE
\Webcam\Audio -c:v copy -c:a copy -map 0:0 -map 1:0 zmovie.avi
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 5.5.0 (GCC)
  configuration: --enable-gpl --disable-doc --cpu=i686 --enable-fontconfig --ena
ble-libfreetype --enable-libxvid --enable-libvpx --enable-libx264 --enable-libmp
3lame --enable-libopus --enable-libtheora --prefix='h:/tmp/ffmpeg' --disable-sta
tic --enable-shared --extra-libs=-lcx --extra-ldflags=-Zhigh-mem --extra-cflags=
'-isysroot k:/usr/include'
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
Option framerate not found.

Without framerate, it works but it is played very fast (not real framerate) due to auto set to 25 which is too fast (accelerated video/audio)

But, from yous suggestion I did a new test changing parameters as needed and it work now well here with c270 using :
ffmpeg -async 1 -framerate 15 -itsoffset 2.0 -f mjpeg -i \PIPE\Webcam\Video
 -i \PIPE\Webcam\Audio -c:v copy -c:a copy -map 0:0 -map 1:0 zmovie.avi

note: mapping is not needed here because each input file only has one stream (video or audio), it is automatically mapped by ffmpeg. 
copy will copy frames as is without changes (this produces a big file) 

I have to set framerate to 15 to get normal speed and add -f mjpeg to use -framerate option.

The best command line with a resulting small video size:
ffmpeg -async 1 -framerate 15 -itsoffset 2.0 -f mjpeg -i \PIPE\Webcam\Video -i \PIPE\Webcam\Audio -q:v 3 -b:a 192k zmovie.avi

To remove the thread_queue_size message, I add one more parameter:
ffmpeg -async 1 -framerate 15 -itsoffset 2.0 -f mjpeg -i \PIPE\Webcam\Video -thread_queue_size 96 -i \PIPE\Webcam\Audio -q:v 3 -b:a 192k zmovie.avi

video quality set to a good value and audio set to CBR (converted into mp3) with a good 192K bitrate.

Thanks  ;)
Regards
Rémy 

logfile from a test using an experimental ffmpeg build (not available yet by its author):

Update: after adding -framerate 25 to the input stream just after -f mjpeg, It works too using the -framerate 25 setting after -async, having a correct 25 fps output.
ffmpeg -async 1 -framerate 25 -itsoffset 2.0 -f mjpeg -framerate 25 -i \PIPE\Webcam\Video -i \PIPE\Webcam\Audio -q:v 3 -b:a 192k zmovie.avi
(adding the -thread_queue_size may introduce some out of sync
 

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version