[SOLVED] Command Line audio device

Microsoft Windows specific usage questions
Forum rules
Please post only Windows specific questions in this forum category. If you don't know where to post, please read the different forums' rules. Thanks.
swordman
New Cone
New Cone
Posts: 3
Joined: 24 Mar 2012 10:08

[SOLVED] Command Line audio device

Postby swordman » 24 Mar 2012 10:20

First of all, let me thank for the wonderful software, I love VLC.
Today I'm trying to make a windows bat script that launch VLC for recording a video with vlc. It is for a friend of mine, that is not too go using PC, so I decided to make him a script "just to click on it".
I can open via command line the capture, set the resolution and so on, just the audio does not work.
After some testing, I've found out that it open as default the first device that is detected, but unfortunately it is not the webcam, but the sound card.
I know that I can use the dshow-adev to specify a different device, but my friend will not be able to get that information and edit the script properly.
so, this is my current script:

Code: Select all

%CD%\vlc\vlc.exe :dshow-adev="Microfono (Logitech Mic (QuickC" dshow:// --sout=#transcode{vcodec=mp2v,vb=1024,fps=30,width=320,acodec=mp2a,ab=128,scale=1,channels=2,deinterlace,audio-sync}:duplicate{dst=standard{access=file,mux=ps,dst="Output.mpg"},dst=display{noaudio}} --extraintf=logger -vvv pause
I would like to know if there is a way to force the audio device to be the same as the video device, or if there are some sort of "listing option" to show all the possible device found by vlc in command line mode, or if someone has a good idea about how to overcome this problem.
Thanks again to all!
Last edited by swordman on 25 Mar 2012 10:15, edited 1 time in total.

VLC_help
Mega Cone Master
Mega Cone Master
Posts: 25661
Joined: 13 Sep 2006 14:16

Re: Command Line audio device

Postby VLC_help » 24 Mar 2012 20:27

VLC GUI should show the device names in drop-down list (Media -> Open Capture Device...). You can also see the actual text parameters via Tools -> Messages (set verbosity to 2)

swordman
New Cone
New Cone
Posts: 3
Joined: 24 Mar 2012 10:08

Re: Command Line audio device

Postby swordman » 24 Mar 2012 23:31

Thanks for the reply.
I've already though about that, but I hoped that there was a parameter from command line that could print a list the devices found.
BTW, I'm having some problem in the capturing the audio also specifying the device.
This is the batch file that launch VLC:

Code: Select all

%CD%\vlc\vlc.exe --dshow-adev="Microfono (Logitech Mic (QuickC" dshow:// --sout=#transcode{vcodec=mp2v,vb=1024,fps=30,width=320,acodec=mp2a,ab=128,scale=1,channels=2,deinterlace,audio-sync}:duplicate{dst=standard{access=file,mux=ps,dst="Output.mpg"},dst=display} --extraintf=logger -vv
In the Log, It seems that VLC opens correctly both the video, and select the correct audio device specified, but I get errors on the "araw" module for audio:

Code: Select all

main debug: using interface module "logger" main debug: TIMER module_need() : 26.635 ms - Total 26.635 ms / 1 intvls (Avg 26.635 ms) main debug: looking for interface module: 1 candidate main debug: using interface module "hotkeys" main debug: TIMER module_need() : 1.981 ms - Total 1.981 ms / 1 intvls (Avg 1.981 ms) mainm adienb udge:b urge:b upilladyilnigs ta rtrharye aodfs ccuorrrreenctt l-y raocotti vaPtleady list mainm adienb udge:b uagd:d irnegb uitem `dilsdh odwo:n/e/ '- (0 distheomws:,/ /i n)d ex -1 main debug: no fetch required for (null) (art currently (null)) main debug: looking for interface module: 1 candidate main debug: using interface module "globalhotkeys" main debug: TIMER module_need() : 11.838 ms - Total 11.838 ms / 1 intvls (Avg 11.838 ms) main: Running vlc with the default interface. Use 'cvlc' to use vlc without interface. main debug: looking for interface module: 4 candidates main debug: looking for extension module: 1 candidate lua debug: Opening Lua Extension module lua debug: Trying Lua scripts in C:\Users\TiX\AppData\Roaming\vlc\lua\extensions lua debug: Trying Lua scripts in C:\Users\TiX\Documents\Vision\EasyVLC\vlc\lua\extensions main debug: using extension module "lua" main debug: TIMER module_need() : 5.893 ms - Total 5.893 ms / 1 intvls (Avg 5.893 ms) main debug: looking for services probe module: 6 candidates main debug: no services probe module matching "any" could be loaded main debug: TIMER module_need() : 5.812 ms - Total 5.812 ms / 1 intvls (Avg 5.812 ms) qt4 debug: Normal PL/ML or SD qt4 debug: Normal PL/ML or SD main debug: using interface module "qt4" main debug: TIMER module_need() : 174.598 ms - Total 174.598 ms / 1 intvls (Avg 174.598 ms) main debug: rebuilding array of current - root Playlist main debug: rebuild done - 1 items, index -1 main debug: processing request item: null, node: Playlist, skip: 0 main debug: starting playback of the new playlist item main debug: creating new input thread main debug: Creating an input for 'dshow://' main debug: using sout chain=`transcode{vcodec=mp2v,vb=1024,fps=30,width=320,acodec=mp2a,ab=128,scale=1,channels=2,deinterlace,audio-sync}:duplicate{dst=standard{access=file,mux=ps,dst=Output.mpg},dst=display{noaudio}}' main debug: stream=`duplicate' main debug: looking for sout stream module: 1 candidate stream_out_duplicate debug: creating 'duplicate' stream_out_duplicate debug: * adding `standard{access=file,mux=ps,dst=Output.mpg}' main debug: stream=`standard' main debug: looking for sout stream module: 1 candidate main debug: set config option: sout-standard-access to file main debug: set config option: sout-standard-mux to ps main debug: set config option: sout-standard-dst to Output.mpg main debug: looking for sout access module: 1 candidate access_output_file debug: file access output opened (Output.mpg) main debug: using sout access module "access_output_file" qt4 debug: IM: Setting an input main debug: TIMER module_need() : 9.154 ms - Total 9.154 ms / 1 intvls (Avg 9.154 ms) main debug: looking for sout mux module: 1 candidate mux_ps: Open main debug: using sout mux module "mux_ps" main debug: TIMER module_need() : 4.558 ms - Total 4.558 ms / 1 intvls (Avg 4.558 ms) main debug: muxer support adding stream at any time main debug: muxer prefers to wait for all ES before starting to mux stream_out_standard debug: using `file/ps://Output.mpg' main debug: using sout stream module "stream_out_standard" main debug: TIMER module_need() : 35.571 ms - Total 35.571 ms / 1 intvls (Avg 35.571 ms) stream_out_duplicate debug: * adding `display{noaudio}' main debug: stream=`display' main debug: looking for sout stream module: 1 candidate main debug: set config option: sout-display-audio to (null) main debug: using sout stream module "stream_out_display" main debug: TIMER module_need() : 4.548 ms - Total 4.548 ms / 1 intvls (Avg 4.548 ms) main debug: using sout stream module "stream_out_duplicate" main debug: TIMER module_need() : 56.682 ms - Total 56.682 ms / 1 intvls (Avg 56.682 ms) main debug: stream=`transcode' main debug: looking for sout stream module: 1 candidate main debug: set config option: sout-transcode-vcodec to mp2v main debug: set config option: sout-transcode-vb to 1024 main debug: set config option: sout-transcode-fps to 30 main debug: set config option: sout-transcode-width to 320 main debug: set config option: sout-transcode-acodec to mp2a main debug: set config option: sout-transcode-ab to 128 main debug: set config option: sout-transcode-scale to 1 main debug: set config option: sout-transcode-channels to 2 main debug: set config option: sout-transcode-deinterlace to (null) main debug: set config option: sout-transcode-audio-sync to (null) stream_out_transcode debug: codec audio=mp2a 0Hz 2 channels 128Kb/s stream_out_transcode debug: codec video=mp2v 320x0 scaling: 1.000000 1024kb/s main debug: using sout stream module "stream_out_transcode" main debug: TIMER module_need() : 18.618 ms - Total 18.618 ms / 1 intvls (Avg 18.618 ms) main debug: using timeshift granularity of 50 MiB, in path 'C:\Users\TiX\AppData\Local\Temp' main debug: `dshow://' gives access `dshow' demux `' path `' main debug: creating demux: access='dshow' demux='' location='' file='(null)' main debug: looking for access_demux module: 1 candidate dshow debug: dshow-vdev: dshow debug: dshow-adev: Microfono (Logitech Mic (QuickC dshow debug: found device: Logitech QuickCam E3500 dshow debug: asking for default device: Logitech QuickCam E3500 dshow debug: asked for Logitech QuickCam E3500, binding to Logitech QuickCam E3500 dshow debug: using device: Logitech QuickCam E3500 dshow debug: EnumDeviceCaps: output pin: Acquisizione dshow debug: EnumDeviceCaps: input pin: Video Camera Terminal dshow debug: EnumDeviceCaps: output pin: Fermo dshow debug: EnumDeviceCaps: trying pin Acquisizione dshow debug: EnumDeviceCaps: input pin default format configured dshow debug: EnumDeviceCaps: input pin accepts chroma: I420, width:640, height:480, fps:15.000015 dshow debug: CaptureFilter::JoinFilterGraph dshow debug: connecting filters dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::ConnectedTo [not connected] dshow debug: CapturePin::QueryPinInfo dshow debug: CaptureFilter::QueryFilterInfo dshow debug: CapturePin::QueryPinInfo dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::QueryAccept [OK] (width=640, height=480, chroma=I420, fps=15.000015) dshow debug: CapturePin::ReceiveConnection [OK] dshow debug: CapturePin::NotifyAllocator dshow debug: ConnectFilters: graph_builder2 available. dshow warning: ConnectFilters: No crossBar routes found (incompatible pin types) dshow debug: filters connected successfully ! dshow debug: MEDIATYPE_Video dshow debug: selected video pin accepts format: I420 dshow debug: found device: CD Audio (VIA High Definition A dshow debug: found device: Microfono (Logitech Mic (QuickC dshow debug: found device: Missaggio stereo (VIA High Defi dshow debug: asking for device: Microfono (Logitech Mic (QuickC dshow debug: asked for Microfono (Logitech Mic (QuickC, binding to Microfono (Logitech Mic (QuickC dshow debug: using device: Microfono (Logitech Mic (QuickC dshow debug: EnumDeviceCaps: output pin: Capture dshow debug: EnumDeviceCaps: input pin: Volume master dshow debug: EnumDeviceCaps: trying pin Capture dshow debug: EnumDeviceCaps: input pin default format configured dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:44100 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:44100 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:44100 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:32000 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:32000 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:22050 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:22050 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:11025 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:11025 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:8000 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:8000 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:44100 bits/sample:8 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:44100 bits/sample:8 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:22050 bits/sample:8 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:22050 bits/sample:8 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:11025 bits/sample:8 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:11025 bits/sample:8 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:8000 bits/sample:8 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:8000 bits/sample:8 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:48000 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:48000 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:2, samples/sec:96000 bits/sample:16 dshow debug: EnumDeviceCaps: input pin accepts format: araw, channels:1, samples/sec:96000 bits/sample:16 dshow debug: CaptureFilter::JoinFilterGraph dshow debug: connecting filters dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::ConnectedTo [not connected] dshow debug: CapturePin::QueryPinInfo dshow debug: CaptureFilter::QueryFilterInfo dshow debug: CapturePin::QueryPinInfo dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::QueryAccept [OK] (channels=2, samples/sec=44100, bits/samples=16, format=araw) dshow debug: CapturePin::ReceiveConnection [OK] dshow debug: CapturePin::NotifyAllocator dshow debug: filters connected successfully ! dshow debug: MEDIATYPE_Audio dshow debug: selected audio pin accepts format: araw dshow debug: Playing... dshow debug: CapturePin::QueryPinInfo dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::QueryPinInfo dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::QueryPinInfo dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::QueryPinInfo dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::ConnectedTo [OK] dshow debug: CaptureFilter::EnumPins dshow debug: CapturePin::QueryDirection dshow debug: CapturePin::ConnectedTo [OK] dshow debug: CaptureFilter::SetSyncSource dshow debug: CaptureFilter::SetSyncSource dshow debug: CaptureFilter::Pause dshow debug: CaptureFilter::Pause dshow debug: CaptureFilter::Run dshow debug: CaptureFilter::Run main debug: selecting program id=0 main debug: using access_demux module "dshow" main debug: TIMER module_need() : 4873.523 ms - Total 4873.523 ms / 1 intvls (Avg 4873.523 ms) main debug: looking for packetizer module: 21 candidates main debug: using packetizer module "rawvideo" main debug: TIMER module_need() : 7.491 ms - Total 7.491 ms / 1 intvls (Avg 7.491 ms) main debug: looking for packetizer module: 21 candidates main debug: using packetizer module "packetizer_copy" main debug: TIMER module_need() : 12.750 ms - Total 12.750 ms / 1 intvls (Avg 12.750 ms) main debug: starting in async mode main debug: looking for meta reader module: 2 candidates lua debug: Trying Lua scripts in C:\Users\TiX\AppData\Roaming\vlc\lua\meta\reader lua debug: Trying Lua scripts in C:\Users\TiX\Documents\Vision\EasyVLC\vlc\lua\meta\reader lua debug: Trying Lua playlist script C:\Users\TiX\Documents\Vision\EasyVLC\vlc\lua\meta\reader\filename.luac main debug: no meta reader module matching "any" could be loaded main debug: TIMER module_need() : 8.465 ms - Total 8.465 ms / 1 intvls (Avg 8.465 ms) main debug: `dshow://' successfully opened main error: Invalid PCR value in ES_OUT_SET_(GROUP_)PCR ! main debug: switching to sync mode packetizer_copy debug: need valid dts main debug: Buffering 0% main debug: Buffering 36% main debug: adding a new sout input (sout_input:02f64da0) stream_out_transcode debug: creating audio transcoding from fcc=`s16l' to fcc=`mp2a' main debug: looking for decoder module: 31 candidates araw debug: samplerate:44100Hz channels:2 bits/sample:16 main debug: using decoder module "araw" main debug: TIMER module_need() : 14.236 ms - Total 14.236 ms / 1 intvls (Avg 14.236 ms) main debug: looking for encoder module: 13 candidates main debug: no encoder module matching "any" could be loaded main debug: TIMER module_need() : 82.050 ms - Total 82.050 ms / 1 intvls (Avg 82.050 ms) stream_out_transcode error: cannot find audio encoder (module:any fourcc:mp2a). Take a look few lines earlier to see possible reason. main debug: removing module "araw" stream_out_transcode error: cannot create audio chain main error: cannot create packetizer output (s16l) main debug: Buffering 73% main debug: Stream buffering done (330 ms in 330 ms) main debug: Decoder buffering done in 0 ms main debug: adding a new sout input (sout_input:02f65d30)
and I can't understand what I'm doing wrong, any help would be appreciated :)
As a side note, If I use the GUI to "Convert/Save" from the devices selected, I do get a correct file, video + audio, so I think it is not something like missing codex.

EDITED: Solved
In case that someone else is looking for the solution:
Note: I'm using VLC Portable version 2.0.0
from the GUI you can get what parameters are passed to the core uf VLC.
For example you can get those doing the following:
- start VLC
- "Media" -> "Stream" -> "Capture device"
- In the Device Selection, select the device you want to use
- at the bottom, hit "Show more options" and here you can see the first two parameters
- Hit "Stream" at the bottom
- select "Source", then hit the button "Next"
- select ehat type of steram, I streamed to file, so I chose "Add" and set the file name, hit "Next"
- now you can see the "Options setup" and here you see the transcode setting in accord to what you have chose, this is the second parameter.

I know that some other have posted a simila question, but since the poster wasn't able to get the result, I hope that this could be of some help.

In my case I got this:

Code: Select all

MRL = dshow:// Edit Options = :dshow-vdev=Logitech QuickCam E3500 :dshow-adev=Microfono (Logitech Mic (QuickC :live-caching=300 Streaming options = :sout=#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=file{dst=a.mp4},dst=display} :sout-keep Source = dshow://
then you can pass these on the command line as parameters, paying some attention on using the string delimiter right for your operating system, so in wndows the command became:

Code: Select all

%CD%\vlc\vlc.exe dshow:// :dshow-vdev="Logitech QuickCam E3500" :dshow-adev="Microfono (Logitech Mic (QuickC" :live-caching=300 --sout="#transcode{vcodec=h264,vb=0,scale=0,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=display,dst=std{access=file,mux=mp4,dst='c.mp4'}}" --extraintf=logger -vv
(note the " " around the parameters).

twalp
New Cone
New Cone
Posts: 9
Joined: 23 Jun 2012 04:45

Re: [SOLVED] Command Line audio device

Postby twalp » 24 Jun 2012 21:56

Thank you for your post. It helped me solve a challenge, too.


Return to “VLC media player for Windows Troubleshooting”

Who is online

Users browsing this forum: No registered users and 13 guests