2
I am trying to stream my desktop screen to a HLS server (nginx RTMP module), but I don't know how to go about this. I have tried
ffmpeg -f x11grab -i :0.0 -f hls http://192.168.1.68/tmp/hls
but this returns
ffmpeg version N-60313-g6d7119d Copyright (c) 2000-2014 the FFmpeg developers
built on Feb 2 2014 16:01:55 with gcc 4.7 (Debian 4.7.3-4)
configuration: --enable-indev=alsa --enable-gpl --enable-x11grab --enable-libpulse --enable-libopus --enable-libmp3lame --enable-libvpx --enable-libx264 --enable-pthreads
libavutil 52. 63.100 / 52. 63.100
libavcodec 55. 49.101 / 55. 49.101
libavformat 55. 29.100 / 55. 29.100
libavdevice 55. 7.100 / 55. 7.100
libavfilter 4. 1.102 / 4. 1.102
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
[x11grab @ 0x2823900] device: :0.0 -> display: :0.0 x: 0 y: 0 width: 640 height: 480
[x11grab @ 0x2823900] shared memory extension found
Input #0, x11grab, from ':0.0':
Duration: N/A, start: 1391370026.581568, bitrate: 294617 kb/s
Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 640x480, 294617 kb/s, 29.97 tbr, 1000k tbn, 29.97 tbc
[tcp @ 0x28854c0] Failed to resolve hostname 192.168.10.ts: Name or service not known
Output #0, hls, to 'http://192.168.1.68/tmp/hls':
Metadata:
encoder : Lavf55.29.100
Stream #0:0: Video: mpeg2video, yuv420p, 640x480, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
Stream mapping:
Stream #0:0 -> #0:0 (rawvideo -> mpeg2video)
Could not write header for output file #0 (incorrect codec parameters ?): Input/output error
My nginx.conf
contains:
rtmp {
server {
listen 1935;
chunk_size 4096;
application live
{
live on;
record off;
hls on;
hls_path /tmp/hls;
hls_fragment 12s;
}
}
}
Please include the complete
ffmpeg
console output. – llogan – 2014-02-02T19:20:02.250@LordNeckbeard Full output added – Adam Chance – 2014-02-02T19:42:35.747
1
[tcp @ 0x28854c0] Failed to resolve hostname 192.168.10.ts: Name or service not known
looks suspect. Also, does it work if you output to a local file (output.m3u8
)? – llogan – 2014-02-02T19:49:38.837@LordNeckbeard Outputting to a local file appears to be fine – Adam Chance – 2014-02-02T20:26:57.510