cytopia / ffscreencast

ffscreencast - ffmpeg screencast/desktop-recording with video overlay and multi monitor support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I can't record audio

oren opened this issue · comments

commented

ffscreencast --alist

Available audio recording devices (microphones):

[1] card 0: PCH [HDA Intel PCH], device 0: ALC269VC Analog [ALC269VC Analog]
[2] card 1: Snowball [Blue Snowball], device 0: USB Audio [USB Audio]

ffscreencast -a0 -c --cargs="-video_size 320x180"

Audio recording device: '0' does not exist.

ffscreencast -a1 -c --cargs="-video_size 320x180"

/usr/bin/ffmpeg -hide_banner -loglevel info -thread_queue_size 512 -f x11grab -video_size 1600x900  -i ":0.0" -thread_queue_size 512 -f v4l2  -video_size 320x180 -i "/dev/video0" -thread_queue_size 512 -f alsa -ac 2 -i "hw:0,0" -c:a libfaac -c:v libx264 -crf 0 -preset ultrafast -filter_complex 'overlay=main_w-overlay_w-10:main_h-overlay_h-10' -threads 0 "/home/oren/Desktop/Screencast 2017-03-05 at 12.46.34.mkv"
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1488746794.979572, bitrate: N/A
    Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1600x900, 29.97 fps, 29.97 tbr, 1000k tbn, 29.97 tbc
[video4linux2,v4l2 @ 0xefdc20] The V4L2 driver changed the video from 320x180 to 320x240
Input #1, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 35704.508922, bitrate: 36864 kb/s
    Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for  Input Stream #2.0 : stereo
Input #2, alsa, from 'hw:0,0':
  Duration: N/A, start: 1488746795.291798, bitrate: 1536 kb/s
    Stream #2:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Unknown encoder 'libfaac'

ffscreencast -a2 -c --cargs="-video_size 320x180"

/usr/bin/ffmpeg -hide_banner -loglevel info -thread_queue_size 512 -f x11grab -video_size 1600x900  -i ":0.0" -thread_queue_size 512 -f v4l2  -video_size 320x180 -i "/dev/video0" -thread_queue_size 512 -f alsa -ac 2 -i "hw:1,0" -c:a libfaac -c:v libx264 -crf 0 -preset ultrafast -filter_complex 'overlay=main_w-overlay_w-10:main_h-overlay_h-10' -threads 0 "/home/oren/Desktop/Screencast 2017-03-05 at 12.47.03.mkv"
Input #0, x11grab, from ':0.0':
  Duration: N/A, start: 1488746823.505493, bitrate: N/A
    Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1600x900, 29.97 fps, 29.97 tbr, 1000k tbn, 29.97 tbc
[video4linux2,v4l2 @ 0x966c20] The V4L2 driver changed the video from 320x180 to 320x240
Input #1, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 35733.033684, bitrate: 36864 kb/s
    Stream #1:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 320x240, 36864 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
[alsa @ 0x9686e0] cannot open audio device hw:1,0 (Device or resource busy)
hw:1,0: Input/output error

Unknown encoder 'libfaac'

DITTO

I tried :%s/libfaac/aac/g and rm ~/.config/ffscreencast but still got error:

The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

which persisted after adding "-strict -2" to optional args in the config...

So, I ran it back with flac (which I also prefer) and it worked; wav might as well.

I did have to edit /bin/ffscreencast; editing the config did not alter --dry output.

@oren it starts at index 1, not 0. I might have to make that more clear anyway. :-)

You can (as a workaround) use --oargs (which comes as the last argument and is therefore able to overwrite most/all options) to use a different audio codec:

$ ffscreencast -a1 --oargs='-c:a flac'

When building the command you can also always use --dry to see the final generated command:

$ ffscreencast -a1 --oargs='-c:a flac' --dry
commented

Thanks! it works now: ffscreencast -a1 -c --cargs="-video_size 320x180" --oargs='-c:a flac'

One more thing. I am not sure if it's ok but I see a lot of lines like this one in the console:

Past duration 0.998466 too large
Past duration 0.998650 too large
Past duration 0.999779 too large
Past duration 0.998192 too large      1kB time=00:00:00.00 bitrate=N/A dup=0 drop=11    
Past duration 0.998497 too large
Past duration 0.999352 too large
Past duration 0.998589 too large
Past duration 0.999901 too large
Past duration 0.998680 too large
Past duration 0.999596 too large
Past duration 0.998283 too large      1kB time=00:00:00.00 bitrate=N/A dup=0 drop=11    
Past duration 0.998314 too large

@NHQ can you show me the ffscreencast command and the config for the case that the config was not read during --dry