-
-
Save on-three/9e40cbf33765dbd3ffbb to your computer and use it in GitHub Desktop.
1: Get the audio output device you'll record off: | |
pacmd list-sources | awk '/name:.+\.monitor/' | |
name: <alsa_output.pci-0000_01_00.1.hdmi-stereo.monitor> | |
name: <alsa_output.pci-0000_00_1b.0.analog-stereo.monitor> | |
2: Get the x windows id (linux) of the window you'll capture | |
xwininfo -name "Nestopia" | |
xwininfo: Window id: 0x3a00003 "Nestopia" | |
... | |
3: Fire up vlc with the right parameters: | |
vlc window://0x2a00003 :screen-fps=30 :input-slave=pulse://alsa_output.pci-0000_00_1b.0.analog-stereo.monitor --sout '#transcode{vcodec=h264,vb=800,scale=1,height=480,acodec=mpga,ab=128,channels=2,samplerate=44100}:http{mux=ts,dst=:8090/game}' |
vlc window://0x3e0000b :screen-fps=25 :input-slave=pulse://alsa_output.pci-0000_00_1b.0.analog-stereo.monitor --sout '#transcode{vcodec=h264,vb=800,scale=1,height=480,fps=25,venc=x264{aud,profile=baseline,level=30,keyint=30,ref=1},acodec=mpga,ab=128,channels=2,samplerate=44100}:http{mux=ts,dst=:8090/game}'
@echo off & cls
:: KNARZ
:: Description
:: Run the Batch with URL as Parameter
:: Exsample: THISBATCH.cmd http://www.anything.com/stream.m3u
:: Fixed Stream: replace "stream=%~1" with your URL "stream=http://..."
:: Batch closes after executing VLC.
set program=c:\progra~1\videolan\vlc\vlc.exe
set stream=%~1
set ratio=0
call :usage
choice /m "Select Ratio" /C 123456789
set select=%errorlevel%
if %select% equ 9 exit
if %select% equ 1 set ratio=2:1
if %select% equ 2 set ratio=3:2
if %select% equ 3 set ratio=4:3
if %select% equ 4 set ratio=5:4
if %select% equ 5 set ratio=16:9
if %select% equ 6 set ratio=16:10
if %select% equ 7 set ratio=21:9
if %select% equ 8 set ratio=21:10
start /b "VLC" "%program%" --aspect-ratio %ratio% "%stream%"
exit
transcode{width=320,height=240,fps=25,vcodec=h264,vb=256,venc=x264{aud,profile=baseline,level=30,keyint=30,ref=1},acodec=mp3,ab=96}