Merge Two audio and Video results in only audio saved to file

Questions involving a Windows version of FFmpeg.
Post Reply
rogiedodgie
Posts: 1
Joined: Thu May 09, 2019 4:15 pm

Merge Two audio and Video results in only audio saved to file

Post by rogiedodgie » Thu May 09, 2019 4:22 pm

Hello all!

I am trying to merge two audio sources and the desktop to create a video.

The following SUCCESSFULLY creates a blank video file with the audio from both sources:

Code: Select all

ffmpeg -y -f dshow -i audio="Microphone (2- HyperX Cloud Flight Wireless Headset)" -f dshow -i audio="Line (Elgato Sound Capture)" -filter_complex "[0][1] amix [a];[a] volume=volume=2 [b]" -map "[b]" -threads 2 -c:v h264_nvenc finalVideoFile.mp4
The following SUCCESSFULLY records the screen with no sound:

Code: Select all

ffmpeg -f gdigrab -i desktop -c:v h264_nvenc finalVideoFile.mp4
I can't figure out how to combine the two statements to record the video with the two audio sources at the same time. I expected the following to work, but it doesn't record the video (black screen):

Code: Select all

ffmpeg -f dshow -i audio="Microphone (2- HyperX Cloud Flight Wireless Headset)" -f dshow -i audio="Line (Elgato Sound Capture)" -f gdigrab -i desktop -filter_complex "[0][1] amix [a];[a] volume=volume=2 [b]" -map "[b]" -threads 2 -vcodec h264_nvenc finalVideoFile.mp4
=================================================================================================================

Here is the output:

Code: Select all

ffmpeg version N-92087-gdcbd89e000 Copyright (c) 2000-2018 the FFmpeg developers
  built with gcc 8.2.1 (GCC) 20180813
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
  libavutil      56. 19.101 / 56. 19.101
  libavcodec     58. 31.102 / 58. 31.102
  libavformat    58. 18.104 / 58. 18.104
  libavdevice    58.  4.105 / 58.  4.105
  libavfilter     7. 33.100 /  7. 33.100
  libswscale      5.  2.100 /  5.  2.100
  libswresample   3.  2.100 /  3.  2.100
  libpostproc    55.  2.100 / 55.  2.100
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, dshow, from 'audio=Microphone (2- HyperX Cloud Flight Wireless Headset)':
  Duration: N/A, start: 10699.515000, bitrate: 1411 kb/s
    Stream #0:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, dshow, from 'audio=Line (Elgato Sound Capture)':
  Duration: N/A, start: 10700.082000, bitrate: 1411 kb/s
    Stream #1:0: Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
[gdigrab @ 000001e1cfaa9fc0] Capturing whole desktop as 3840x2160x32 at (0,0)
[gdigrab @ 000001e1cfaa9fc0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #2, gdigrab, from 'desktop':
  Duration: N/A, start: 1557418840.980896, bitrate: 7954682 kb/s
    Stream #2:0: Video: bmp, bgra, 3840x2160, 7954682 kb/s, 29.97 fps, 1000k tbr, 1000k tbn, 1000k tbc
File 'YOUR_NAME_HERE.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 (pcm_s16le) -> amix:input0
  Stream #1:0 (pcm_s16le) -> amix:input1
  volume -> Stream #0:0 (aac)
Press [q] to stop, [?] for help
Output #0, mp4, to 'YOUR_NAME_HERE.mp4':
  Metadata:
    encoder         : Lavf58.18.104
    Stream #0:0: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      encoder         : Lavc58.31.102 aac
[dshow @ 000001e1cfa65280] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[dshow @ 000001e1cf9eb180] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
[gdigrab @ 000001e1cfaa9fc0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 8)
size=     317kB time=00:00:19.99 bitrate= 129.8kbits/s speed=1.09x
video:0kB audio:313kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.351769%
[aac @ 000001e1cfaabe40] Qavg: 14505.375
Exiting normally, received signal 2.

Post Reply
'