Linux üzerinde nasıl stream yayını yapılır bileniniz var mı?
Şöyle bir script buldum.
#! /bin/bash
INRES="1366x768"
OUTRES="1366x768"
FPS="30" # fps
QUAL="placebo"
STREAM_KEY=$(cat ~/.twitch_key)
avconv \
-f x11grab -s $INRES -r "$FPS" -i :0.0 \
-f alsa -ac 2 -i pulse \
-vcodec libx264 -s $OUTRES -preset $QUAL \
-acodec libmp3lame -ar 44100 -threads 4 -qscale 8 -b 712000 -bufsize 8192k -minrate 5120k -maxrate 8192k -ac 2 \
-f flv "rtmp://live.justin.tv/app/$STREAM_KEY"
Ama şöyle bir hata veriyor.
[1]emre@emre-desktop:~ > ./twitch.sh
avconv version 0.8.10-6:0.8.10-0ubuntu0.13.10.1, Copyright (c) 2000-2013 the Libav developers
built on Feb 6 2014 20:53:28 with gcc 4.8.1
[x11grab @ 0x238ffe0] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 1366 height: 768
[x11grab @ 0x238ffe0] shared memory extension found
[x11grab @ 0x238ffe0] Estimating duration from bitrate, this may be inaccurate
Input #0, x11grab, from ':0.0':
Duration: N/A, start: 1397426376.054982, bitrate: 1007124 kb/s
Stream #0.0: Video: rawvideo, bgra, 1366x768, 1007124 kb/s, 30 tbr, 1000k tbn, 30 tbc
[alsa @ 0x239c380] capture with some ALSA plugins, especially dsnoop, may hang.
[alsa @ 0x239c380] Estimating duration from bitrate, this may be inaccurate
Input #1, alsa, from 'pulse':
Duration: N/A, start: 1397426376.073843, bitrate: N/A
Stream #1.0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
Incompatible pixel format 'bgra' for codec 'libx264', auto-selecting format 'yuv420p'
[buffer @ 0x234e5e0] w:1366 h:768 pixfmt:bgra
[avsink @ 0x23c1660] auto-inserting filter 'auto-inserted scaler 0' between the filter 'src' and the filter 'out'
[scale @ 0x23b98a0] w:1366 h:768 fmt:bgra -> w:1366 h:768 fmt:yuv420p flags:0x4
./twitch.sh: satır 15: 2984 Parçalama arızası avconv -f x11grab -s $INRES -r "$FPS" -i :0.0 -f alsa -ac 2 -i pulse -vcodec libx264 -s $OUTRES -preset $QUAL -acodec libmp3lame -ar 44100 -threads 4 -qscale 8 -b 712000 -bufsize 8192k -minrate 5120k -maxrate 8192k -ac 2 -f flv "rtmp://live.justin.tv/app/$STREAM_KEY"