Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable the experimental AAC encoder for VLC and record AAC sound from the microphone?

I managed to record mp3 with VLC 2.1.5 on MacOSX 10.9.2 by using this command:

./VLC -vvv qtsound://AppleHDAEngineInput:1B,0,1,0:1 --sout "#transcode{acodec=mp3,ab=128}:standard{access=file,mux=mp3,dst=~/Desktop/Recording.mp3}"

However I need to record AAC audio and every time I use the AAC settings, the file is 203 bytes and broken, probably only the header gets written. Some mux/filetype combinations produce 0 bytes files or don't produce any file at all. I used this command:

./VLC -vvv qtsound://AppleHDAEngineInput:1B,0,1,0:1 --sout "#transcode{acodec=mp4a,ab=128}:standard{access=file,mux=ts,dst=~/Desktop/Recording.mp4}"

Any command that works and records AAC audio with VLC from the Terminal would be greatly appreciated. Thanks!

Update:

I managed to get it started with this command:

./VLC -vvv qtsound://Internal\ microphone --sout "#transcode{acodec=mp4a,ab=128}:standard{access=file,mux=mp4,dst=~/Desktop/Recording.mp4}"

But when it tries to encode it tells this:

[aac @ 0x10309e000] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it. [0x100469c30] avcodec encoder error: cannot open encoder

So it looks like I should add this

-strict -2

parameter to the command to fix it. Unfortunately this parameter is for ffmpeg and VLC does not recognize it. Do you have any idea how to enable the experimental AAC encoder for VLC?

like image 716
DevtelSoftware Avatar asked Nov 19 '15 22:11

DevtelSoftware


2 Answers

Had something similar - Have no idea if this is doing anything, but it did make the error go away. Basically tried to pass params to ffmpeg

#transcode{aenc=ffmpeg{strict=-2},vcodec=mp4v,vb=1024,acodec=mp4a}

Hope this gives you some ideas

like image 79
Michael Dalziel Avatar answered Sep 19 '22 16:09

Michael Dalziel


Another way this seems to work is with the --sout-avcodec-strict switch to the vlc command itself. To modify the original example:

./VLC -vvv qtsound://Internal\ microphone --sout-avcodec-strict -2 --sout "#transcode{acodec=mp4a,ab=128}:standard{access=file,mux=mp4,dst=~/Desktop/Recording.mp4}"

FYI, on Windows systems, one needs to use an equals sign for option values (not a space), so it would be --sout-avcodec-strict=-2 instead there.

I don't know what the difference is between these two forms, or indeed, if there is one. I suspect the sout-avcodec-strict form might be more robust in the face of future changes to the codec library interface, but given that it's a library-specific option in the first place, I'm not sure that matters.

My info was from: https://forum.videolan.org/viewtopic.php?t=111801

Hope this helps.

like image 35
Ben Scott Avatar answered Sep 20 '22 16:09

Ben Scott