如何在MacOSX上的VLC中录制带有音频的屏幕

时间:2015-09-15 20:24:36

标签: audio screen vlc recording

我遇到了这个How to capture microphone input in VLC?,在这篇文章中说:

  

Mac:使用VLC 2.0.0或更高版本并使用qtsound模块:

/Applications/VLC.app/Contents/MacOS/VLC -vvv qtsound:// 

如果我运行此命令,VLC将从麦克风接收声音并将其输出到扬声器:

/Applications/VLC.app/Contents/MacOS/VLC qtsound://

有没有办法将其记录到文件中? 如果有的话,有没有办法将它与屏幕录制结合起来并制作带声音的屏幕转换?

到目前为止,我设法录制了屏幕投射,但我无法为视频录制添加声音:

/Applications/VLC.app/Contents/MacOS/VLC -I dummy screen:// --screen-fps=25 --sout "#transcode{vcodec=h264,vb072,acodec=mp4a,ab=128}:standard{access=file,mux=mp4,dst="~/Desktop/vlc-output-terminal.mp4"}"

知道如何使用VLC和qtsound(或其他输入)录制麦克风的声音吗?

更新

在Linux上它可以使用所谓的 - input-slave 参数,我试图在mac上使用mac音频设备进行复制:

/Applications/VLC.app/Contents/MacOS/VLC -vvv -I dummy  screen:// --input-slave qtsound://AppleHDAEngineInput:1B,0,1,0:1 --sout "#transcode{vcodec=h264,vb=1024,acodec=mp4a,ab=128}:standard{access=file,mux=mp4,dst="~/Desktop/vlc-output-terminal.mp4"}"

不幸的是,即使VLC说一切都很好,输出文件也是无效的,总是只有44个字节。以下是命令的控制台输出:

APPLEs-MacBook-Pro:deploy-mac myuser$ /Applications/VLC.app/Contents/MacOS/VLC -vvv -I dummy  screen:// --input-slave qtsound://AppleHDAEngineInput:1B,0,1,0:1 --sout "#transcode{vcodec=h264,vb=1024,acodec=mp4a,ab=128}:standard{access=file,mux=mp4,dst="/Users/myuser/Desktop/vlc-output-terminal.mp4"}"
VLC media player 2.1.5 Rincewind (revision 2.1.4-59-g5f258d5)
[0x100503250] main libvlc debug: VLC media player - 2.1.5 Rincewind
[0x100503250] main libvlc debug: Copyright © 1996-2014 the VideoLAN team
[0x100503250] main libvlc debug: revision 2.1.4-59-g5f258d5
[0x100503250] main libvlc debug: configured with ../extras/package/macosx/../../../configure  '--prefix=/Users/fkuehne/Desktop/videolan/gits/vlc-2.1/release/vlc_install_dir' '--enable-macosx' '--enable-merge-ffmpeg' '--enable-growl' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-shout' '--enable-ncurses' '--enable-twolame' '--enable-realrtsp' '--enable-libass' '--enable-macosx-audio' '--enable-macosx-eyetv' '--enable-macosx-qtkit' '--enable-macosx-vout' '--disable-caca' '--disable-skins2' '--disable-xcb' '--disable-sdl' '--disable-samplerate' '--disable-macosx-dialog-provider' '--with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk' '--build=x86_64-apple-darwin10' '--with-macosx-version-min=10.6' 'build_alias=x86_64-apple-darwin10' 'CC=xcrun clang' 'CXX=xcrun clang++' 'OBJC=xcrun clang'
[0x100503250] main libvlc debug: searching plug-in modules
[0x100503250] main libvlc debug: loading plugins cache file /Applications/VLC.app/Contents/MacOS/plugins/plugins.dat
[0x100503250] main libvlc debug: recursively browsing `/Applications/VLC.app/Contents/MacOS/plugins'
[0x100503250] main libvlc debug: saving plugins cache /Applications/VLC.app/Contents/MacOS/plugins/plugins.dat
[0x100503250] main libvlc debug: plug-ins loaded: 373 modules
[0x100503250] main libvlc debug: opening config file (/Users/myuser/Library/Preferences/org.videolan.vlc/vlcrc)
[0x100503250] main libvlc debug: translation test: code is "C"
[0x100503250] main libvlc debug: CPU has capabilities MMX MMXEXT SSE SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 FPU 
[0x100477360] main interface debug: looking for interface module matching "(null),none": 15 candidates
[0x100477360] main interface debug: no interface modules matched
[0x100477360] main interface error: no suitable interface module
[0x100478c70] main input debug: Creating an input for 'Media Library'
[0x100478c70] main input debug: Input is a meta file: disabling unneeded options
[0x100478c70] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0x100478c70] main input debug: `file/xspf-open:///Users/myuser/Library/Application%20Support/org.videolan.vlc/ml.xspf' gives access `file' demux `xspf-open' path `/Users/myuser/Library/Application%20Support/org.videolan.vlc/ml.xspf'
[0x100478c70] main input debug: creating demux: access='file' demux='xspf-open' location='/Users/myuser/Library/Application%20Support/org.videolan.vlc/ml.xspf' file='/Users/myuser/Library/Application Support/org.videolan.vlc/ml.xspf'
[0x10047bf40] main demux debug: looking for access_demux module matching "file": 14 candidates
[0x10047bf40] main demux debug: no access_demux modules matched
[0x100478c70] main input debug: creating access 'file' location='/Users/myuser/Library/Application%20Support/org.videolan.vlc/ml.xspf', path='/Users/myuser/Library/Application Support/org.videolan.vlc/ml.xspf'
[0x10047c5f0] main access debug: looking for access module matching "file": 18 candidates
[0x10047c5f0] filesystem access debug: opening file `/Users/myuser/Library/Application Support/org.videolan.vlc/ml.xspf'
[0x10047c5f0] main access debug: using access module "filesystem"
[0x10047ca00] main stream debug: Using stream method for AStream*
[0x10047ca00] main stream debug: starting pre-buffering
[0x10047ca00] main stream debug: received first data after 0 ms
[0x10047ca00] main stream debug: pre-buffering done 296 bytes in 0s - 15213 KiB/s
[0x10047cc60] main stream debug: looking for stream_filter module matching "any": 9 candidates
[0x10047cc60] main stream debug: no stream_filter modules matched
[0x10047cc60] main stream debug: looking for stream_filter module matching "record": 9 candidates
[0x10047cc60] main stream debug: using stream_filter module "record"
[0x100478c70] main input debug: creating demux: access='file' demux='xspf-open' location='/Users/myuser/Library/Application%20Support/org.videolan.vlc/ml.xspf' file='/Users/myuser/Library/Application Support/org.videolan.vlc/ml.xspf'
[0x10047d4d0] main demux debug: looking for demux module matching "xspf-open": 63 candidates
[0x10047d4d0] playlist demux debug: using XSPF playlist reader
[0x10047d4d0] main demux debug: using demux module "playlist"
[0x10047d6e0] main demux meta debug: looking for meta reader module matching "any": 2 candidates
[0x10047d6e0] lua demux meta debug: Trying Lua scripts in /Users/myuser/Library/Application Support/org.videolan.vlc/lua/meta/reader
[0x10047d6e0] lua demux meta debug: Trying Lua scripts in /Applications/VLC.app/Contents/MacOS/share/lua/meta/reader
[0x10047d6e0] lua demux meta debug: Trying Lua playlist script /Applications/VLC.app/Contents/MacOS/share/lua/meta/reader/filename.luac
[0x10047d6e0] lua demux meta debug: Trying Lua scripts in /Applications/VLC.app/Contents/MacOS/share/share/lua/meta/reader
[0x10047d6e0] main demux meta debug: no meta reader modules matched
[0x100478c70] main input debug: `file/xspf-open:///Users/myuser/Library/Application%20Support/org.videolan.vlc/ml.xspf' successfully opened
[0x1004817e0] main xml reader debug: looking for xml reader module matching "any": 1 candidates
[0x1004817e0] main xml reader debug: using xml reader module "xml"
[0x10047d4d0] playlist demux debug: parsed 0 tracks successfully
[0x100478c70] main input debug: EOF reached
[0x10047d4d0] main demux debug: removing module "playlist"
[0x10047cc60] main stream debug: removing module "record"
[0x10047c5f0] main access debug: removing module "filesystem"
[0x100477870] main playlist debug: creating audio output
[0x10047ca00] main audio output debug: looking for audio output module matching "any": 4 candidates
[0x10047ca00] auhal audio output debug: found 4 audio device(s)
[0x10047ca00] auhal audio output debug: DevID: 39 DevName: AirPlay
[0x10047ca00] auhal audio output debug: found 1 stream formats for stream id 40
[0x10047ca00] auhal audio output debug: DevID: 65 DevName: Built-in Microphone
[0x10047ca00] auhal audio output debug: this 'Built-in Microphone' is INPUT only. skipping...
[0x10047ca00] auhal audio output debug: DevID: 55 DevName: Built-in Input
[0x10047ca00] auhal audio output debug: this 'Built-in Input' is INPUT only. skipping...
[0x10047ca00] auhal audio output debug: DevID: 47 DevName: Built-in Output
[0x10047ca00] auhal audio output debug: found 16 stream formats for stream id 48
[0x10047ca00] main audio output debug: restart requested (2)
[0x10047ca00] main audio output debug: using audio output module "auhal"
[0x100477870] main playlist debug: keeping audio output
[0x100477870] main playlist debug: adding item `screen://' ( screen:// )
[0x100477870] main playlist debug: no fetch required for (null) (art currently (null))
[0x100506170] main interface debug: looking for interface module matching "hotkeys,none": 15 candidates
[0x100506170] main interface debug: using interface module "hotkeys"
[0x100506590] main interface debug: looking for interface module matching "dummy": 15 candidates
[0x100506590] dummy interface: using the dummy interface module...
[0x100506590] main interface debug: using interface module "dummy"
[0x100477870] main playlist debug: processing request item: null, node: Playlist, skip: 0
[0x100477870] main playlist debug: rebuilding array of current - root Playlist
[0x100477870] main playlist debug: rebuild done - 1 items, index -1
[0x100477870] main playlist debug: starting playback of the new playlist item
[0x100477870] main playlist debug: resyncing on screen://
[0x100477870] main playlist debug: screen:// is at 0
[0x100477870] main playlist debug: creating new input thread
[0x10048e9e0] main input debug: Creating an input for 'screen://'
[0x100506cb0] main stream output debug: using sout chain=`transcode{vcodec=h264,vb=1024,acodec=mp4a,ab=128}:standard{access=file,mux=mp4,dst=/Users/myuser/Desktop/vlc-output-terminal.mp4}'
[0x100506cb0] main stream output debug: stream=`standard'
[0x100507250] main stream out debug: looking for sout stream module matching "standard": 20 candidates
[0x100507250] main stream out debug: set config option: sout-standard-access to file
[0x100507250] main stream out debug: set config option: sout-standard-mux to mp4
[0x100507250] main stream out debug: set config option: sout-standard-dst to /Users/myuser/Desktop/vlc-output-terminal.mp4
[0x100507e50] main access out debug: looking for sout access module matching "file": 8 candidates
[0x100507e50] access_output_file access out debug: file access output opened (/Users/myuser/Desktop/vlc-output-terminal.mp4)
[0x100507e50] main access out debug: using sout access module "access_output_file"
[0x100508430] main mux debug: looking for sout mux module matching "mp4": 10 candidates
[0x100508430] mux_mp4 mux debug: Mp4 muxer opened
[0x100508430] main mux debug: using sout mux module "mux_mp4"
[0x100507250] stream_out_standard stream out debug: using `file/mp4:///Users/myuser/Desktop/vlc-output-terminal.mp4'
[0x100507250] main stream out debug: using sout stream module "stream_out_standard"
[0x100506cb0] main stream output debug: stream=`transcode'
[0x1005087a0] main stream out debug: looking for sout stream module matching "transcode": 20 candidates
[0x1005087a0] main stream out debug: set config option: sout-transcode-vcodec to h264
[0x1005087a0] main stream out debug: set config option: sout-transcode-vb to 1024
[0x1005087a0] main stream out debug: set config option: sout-transcode-acodec to mp4a
[0x1005087a0] main stream out debug: set config option: sout-transcode-ab to 128
[0x1005087a0] stream_out_transcode stream out debug: codec audio=mp4a 0Hz 0 channels 128Kb/s
[0x1005087a0] stream_out_transcode stream out debug: codec video=h264 0x0 scaling: 0.000000 1024kb/s
[0x1005087a0] main stream out debug: using sout stream module "stream_out_transcode"
[0x10048e9e0] main input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[0x10048e9e0] main input debug: `screen://' gives access `screen' demux `' path `'
[0x10048e9e0] main input debug: creating demux: access='screen' demux='' location='' file='(null)'
[0x10050a4b0] main demux debug: looking for access_demux module matching "screen": 14 candidates
[0x10050a4b0] screen demux debug: screen width: 1920, height: 1200, depth: 32
[0x10048e9e0] main input debug: selecting program id=0
[0x10050a4b0] main demux debug: using access_demux module "screen"
[0x10048e9e0] main input debug: adding slave input 'qtsound://AppleHDAEngineInput:1B,0,1,0:1'
[0x10048e9e0] main input debug: `qtsound://AppleHDAEngineInput:1B,0,1,0:1' gives access `qtsound' demux `' path `AppleHDAEngineInput:1B,0,1,0:1'
[0x10048e9e0] main input debug: creating demux: access='qtsound' demux='' location='AppleHDAEngineInput:1B,0,1,0:1' file='(null)'
[0x100492f20] main demux debug: looking for access_demux module matching "qtsound": 14 candidates
[0x100492f20] qtsound.lo demux debug: qtsound uid = AppleHDAEngineInput:1B,0,1,0:1
[0x100492f20] qtsound.lo demux debug: qtsound : uid = AppleHDAEngineInput:1B,0,1,0:1
[0x100492f20] qtsound.lo demux debug: qtsound audio 0/2 localizedDisplayName: Built-in Microphone uniqueID: AppleHDAEngineInput:1B,0,1,0:1
[0x100492f20] qtsound.lo demux debug: Device found
[0x100492f20] qtsound.lo demux debug: created valid audio capture input facility
[0x100492f20] qtsound.lo demux debug: initialized audio output
[0x100492f20] qtsound.lo demux debug: Audio localized format summary: Linear PCM, 24 bit little-endian signed integer, 2 channels, 44100 Hz**
[0x100492f20] qtsound.lo demux debug: Audio format description attributes: {
    audioStreamBasicDescription = "<00000000 8088e540 6d63706c 04000000 08000000 01000000 08000000 02000000 18000000 00000000>";
}

除此之外,VLC什么都不做,我必须用Ctrl-C杀死它,因为没有什么事情可以进一步发生。 从上面的日志中我可以看出,与音频部分最相关的是,VLC方面的一切似乎都运行得很好,没有任何错误或抱怨:

[0x10048e9e0] main input debug: `qtsound://AppleHDAEngineInput:1B,0,1,0:1' gives access `qtsound' demux `' path `AppleHDAEngineInput:1B,0,1,0:1'
    [0x10048e9e0] main input debug: creating demux: access='qtsound' demux='' location='AppleHDAEngineInput:1B,0,1,0:1' file='(null)'
    [0x100492f20] main demux debug: looking for access_demux module matching "qtsound": 14 candidates
    [0x100492f20] qtsound.lo demux debug: qtsound uid = AppleHDAEngineInput:1B,0,1,0:1
    [0x100492f20] qtsound.lo demux debug: qtsound : uid = AppleHDAEngineInput:1B,0,1,0:1
    [0x100492f20] qtsound.lo demux debug: qtsound audio 0/2 localizedDisplayName: Built-in Microphone uniqueID: AppleHDAEngineInput:1B,0,1,0:1
    [0x100492f20] qtsound.lo demux debug: Device found
    [0x100492f20] qtsound.lo demux debug: created valid audio capture input facility
    [0x100492f20] qtsound.lo demux debug: initialized audio output
    [0x100492f20] qtsound.lo demux debug: Audio localized format summary: Linear PCM, 24 bit little-endian signed integer, 2 channels, 44100 Hz**
    [0x100492f20] qtsound.lo demux debug: Audio format description attributes: {
        audioStreamBasicDescription = "<00000000 8088e540 6d63706c 04000000 08000000 01000000 08000000 02000000 18000000 00000000>";
    }

0 个答案:

没有答案