Ubuntu 10.04 LTS
nginx-1.2.7
./configure —sbin-path=/usr/sbin/nginx —conf-path=/etc/nginx/nginx.conf —pid-path=/var/run/nginx.pid —add-module=../nginx-rtmp-module —with-debug
nginx.conf
user nobody;
worker_processes 1;
error_log /var/log/nginx/error.log;
events {
worker_connections 1024;
}
rtmp_auto_push on;
rtmp {
server {
listen 1935;
access_log /var/log/nginx/access.log;
chunk_size 4000;
# TV mode: one publisher, many subscribers
application mytv {
# enable live streaming
live on;
allow publish all;
allow play all;
}
ffmpeg create as described in https://ffmpeg.org/trac/ffmpeg/wiki/UbuntuCompilationGuideLucid
Strange problem:
If I am try stream from any different (non-local) server — all ok.
ffmpeg -i udp:233.163.114.53:5106 -s 512×288 -aspect 16:9 -profile baseline -b 500k -vcodec libx264 -acodec libmp3lame -ar 44100 -ab 64k -ac 2 -deinterlace -coder 0 -f flv ‘rtmp://ip_of_nginx:1935/mytv/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test’
[libx264 @ 0x2585d80] 264 — core 125 r2 d9d2288 — H.264/MPEG-4 AVC codec — Copyleft 2003-2012 — http://www.videolan.org/x264.html — options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24 lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to ‘rtmp://***:1935/mytv/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test’:
Metadata:
encoder : Lavf54.21.100
Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 512×288 [SAR 1:1 DAR 16:9], q=-1—1, 500 kb/s, 1k tbn, 25 tbc
Stream #0:1: Audio: mp3 ([2][0][0][0] / 0x0002), 44100 Hz, stereo, s16, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video -> libx264)
Stream #0:1 -> #0:1 (mp2 -> libmp3lame)
Press [q] to stop, [?] for help
frame= 179 fps= 67 q=32766.0 Lsize= 507kB time=00:00:07.65 bitrate= 542.6kbits/s
video:439kB audio:60kB subtitle:0 global headers:0kB muxing overhead 1.697551%
If I am try stream to any server (wowza) from local server (nginx server) all ok.
ffmpeg -i udp:233.163.114.53:5106 -s 512×288 -aspect 16:9 -profile baseline -b 500k -vcodec libx264 -acodec libmp3lame -ar 44100 -ab 64k -ac 2 -deinterlace -coder 0 -f flv ‘rt/ip_of_wowza:1935/live/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test’
[libx264 @ 0x29e8ce0] 264 — core 130 r2 c832fe9 — H.264/MPEG-4 AVC codec — Copyleft 2003-2013 — http://www.videolan.org/x264.html — options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to ‘rtmp://****:1935/live/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test’:
Metadata:
encoder : Lavf55.0.100
Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 512×288 [SAR 1:1 DAR 16:9], q=-1—1, 500 kb/s, 1k tbn, 25 tbc
Stream #0:1: Audio: mp3 ([2][0][0][0] / 0x0002), 44100 Hz, stereo, s16p, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video -> libx264)
Stream #0:1 -> #0:1 (mp2 -> libmp3lame)
Press [q] to stop, [?] for help
Failed to update header with correct duration.e=00:00:06.79 bitrate= 351.1kbits/s
[flv @ 0x2a7e7c0] Failed to update header with correct filesize.
frame= 149 fps= 79 q=-2.0 Lsize= 419kB time=00:00:07.52 bitrate= 456.8kbits/s
video:356kB audio:55kB subtitle:0 global headers:0kB muxing overhead 1.821196%
But.
If I am try stream from local server to local nginx:
ffmpeg -i udp:233.163.114.53:5106 -s 512×288 -aspect 16:9 -profile baseline -b 500k -vcodec libx264 -acodec libmp3lame -ar 44100 -ab 64k -ac 2 -deinterlace -coder 0 -f flv ‘rtmp://127.0.0.1:1935/mytv/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test’
ffmpeg version git-2013-03-23-785b849 Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 23 2013 18:44:11 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
configuration: —enable-gpl —enable-libfaac —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libtheora —enable-libvorbis —enable-libvpx —enable-libx264 —enable-nonfree —enable-version3
libavutil 52. 22.101 / 52. 22.101
libavcodec 55. 1.100 / 55. 1.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 48.100 / 3. 48.100
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[mpegts @ 0x33ca360] Unable to seek back to the start
[mpeg2video @ 0x33f0e20] Invalid frame dimensions 0x0.
Last message repeated 26 times
[mpegts @ 0x33ca360] max_analyze_duration 5000000 reached at 5016000 microseconds
[mpegts @ 0x33ca360] Estimating duration from bitrate, this may be inaccurate
Input #0, mpegts, from ‘udp:233.163.114.53:5106’:
Duration: N/A, start: 61190.166156, bitrate: 192 kb/s
Program 5300
Metadata:
service_name : ?KHL
service_provider: ?N3
Stream #0:0[0x141]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720×576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x191]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
Please use -profile:a or -profile:v, -profile is ambiguous
Please use -b:a or -b:v, -b is ambiguous
rtmp://127.0.0.1:1935/mytv/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test: Input/output error
nginx 29461 root 7u IPv4 186593 0t0 TCP *:1935 (LISTEN)
nginx 29461 root 8u IPv4 186594 0t0 TCP *:http-alt (LISTEN)
nginx 29462 nobody 7u IPv4 186593 0t0 TCP *:1935 (LISTEN)
nginx 29462 nobody 8u IPv4 186594 0t0 TCP *:http-alt (LISTEN)
iptables -L -n -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Howto troubleshoot this problem.
Thanks.
Содержание
- Secure links nginx with rtmp not working Input/output error #221
- Comments
- user nobody;
- local ffmpeg = Input/output error #158
- Comments
- user nobody;
- ffmpeg stuck at startup; Input/Output error #1052
- Comments
- Openwrt Input/output error #739
- Comments
Secure links nginx with rtmp not working Input/output error #221
but not working can you please help me to solve this
all flash video in /var/video path
my nginx -V output
nginx version: nginx/1.2.4
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
TLS SNI support enabled
configure arguments: —add-module=/home/rtmp/nginx-rtmp-module —with-http_secure_link_module
user nobody;
error_log logs/error.log debug;
events <
worker_connections 1024;
>
http <
include mime.types;
default_type application/octet-stream;
rtmp <
server <
listen 1935;
#ping 30s;
#notify_method get;
ffplay Debug is
configuration: —prefix=/usr —enable-static —enable-shared —enable-gpl —enable-nonfree —enable-postproc —enable-avfilter —enable-pthreads -$
libavutil 52. 40.100 / 52. 40.100
libavcodec 55. 19.100 / 55. 19.100
libavformat 55. 12.102 / 55. 12.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 81.103 / 3. 81.103
libswscale 2. 4.100 / 2. 4.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100
socket(): Address family not supported by protocol
socket(): Address family not supported by protocol
ALSA lib pulse.c:229:(pulse_connect) PulseAudio: Unable to connect: Connection refused
[rtmp @ 0x7fad000013e0] Handshaking. vq= 0KB sq= 0B f=0/0
[rtmp @ 0x7fad000013e0] Type answer 3
[rtmp @ 0x7fad000013e0] Server version 13.14.10.13
[rtmp @ 0x7fad000013e0] Proto = rtmp, path = /myapp/517872191_2?e=1374942450&st=UxfdmJrsCc8sbD9KHOjbuA, app = myapp, fname = 517872191_2?e=1374942$
[rtmp @ 0x7fad000013e0] Server bandwidth = 5000000sq= 0B f=0/0
[rtmp @ 0x7fad000013e0] Client bandwidth = 5000000sq= 0B f=0/0
[rtmp @ 0x7fad000013e0] New incoming chunk size = 4096
[rtmp @ 0x7fad000013e0] Creating stream.
Last message repeated 1 times 0KB vq= 0KB sq= 0B f=0/0
[rtmp @ 0x7fad000013e0] Sending play command for ‘517872191_2?e=1374942450&st=UxfdmJrsCc8sbD9KHOjbuA’
rtmp://localhost:1935/myapp/517872191_2?e=1374942450&st=UxfdmJrsCc8sbD9KHOjbuA: Input/output error
The text was updated successfully, but these errors were encountered:
Источник
local ffmpeg = Input/output error #158
Ubuntu 10.04 LTS
nginx-1.2.7
./configure —sbin-path=/usr/sbin/nginx —conf-path=/etc/nginx/nginx.conf —pid-path=/var/run/nginx.pid —add-module=../nginx-rtmp-module —with-debug
user nobody;
worker_processes 1;
error_log /var/log/nginx/error.log;
events <
worker_connections 1024;
>
rtmp_auto_push on;
rtmp <
server <
listen 1935;
access_log /var/log/nginx/access.log;
chunk_size 4000;
# TV mode: one publisher, many subscribers
application mytv <
# enable live streaming
live on;
allow publish all;
allow play all;
>
Strange problem:
If I am try stream from any different (non-local) server — all ok.
ffmpeg -i udp:233.163.114.53:5106 -s 512×288 -aspect 16:9 -profile baseline -b 500k -vcodec libx264 -acodec libmp3lame -ar 44100 -ab 64k -ac 2 -deinterlace -coder 0 -f flv ‘rtmp://ip_of_nginx:1935/mytv/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test’
[libx264 @ 0x2585d80] 264 — core 125 r2 d9d2288 — H.264/MPEG-4 AVC codec — Copyleft 2003-2012 — http://www.videolan.org/x264.html — options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=24 lookahead_threads=4 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to ‘rtmp://***:1935/mytv/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test’:
Metadata:
encoder : Lavf54.21.100
Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 512×288 [SAR 1:1 DAR 16:9], q=-1—1, 500 kb/s, 1k tbn, 25 tbc
Stream #0:1: Audio: mp3 ([2][0][0][0] / 0x0002), 44100 Hz, stereo, s16, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video -> libx264)
Stream #0:1 -> #0:1 (mp2 -> libmp3lame)
Press [q] to stop, [?] for help
frame= 179 fps= 67 q=32766.0 Lsize= 507kB time=00:00:07.65 bitrate= 542.6kbits/s
video:439kB audio:60kB subtitle:0 global headers:0kB muxing overhead 1.697551%
If I am try stream to any server (wowza) from local server (nginx server) all ok.
ffmpeg -i udp:233.163.114.53:5106 -s 512×288 -aspect 16:9 -profile baseline -b 500k -vcodec libx264 -acodec libmp3lame -ar 44100 -ab 64k -ac 2 -deinterlace -coder 0 -f flv ‘rt/ip_of_wowza:1935/live/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test’
[libx264 @ 0x29e8ce0] 264 — core 130 r2 c832fe9 — H.264/MPEG-4 AVC codec — Copyleft 2003-2013 — http://www.videolan.org/x264.html — options: cabac=0 ref=3 deblock=1:0:0 analyse=0x1:0x111 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=0 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to ‘rtmp://****:1935/live/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test’:
Metadata:
encoder : Lavf55.0.100
Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 512×288 [SAR 1:1 DAR 16:9], q=-1—1, 500 kb/s, 1k tbn, 25 tbc
Stream #0:1: Audio: mp3 ([2][0][0][0] / 0x0002), 44100 Hz, stereo, s16p, 64 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg2video -> libx264)
Stream #0:1 -> #0:1 (mp2 -> libmp3lame)
Press [q] to stop, [?] for help
Failed to update header with correct duration.e=00:00:06.79 bitrate= 351.1kbits/s
[flv @ 0x2a7e7c0] Failed to update header with correct filesize.
frame= 149 fps= 79 q=-2.0 Lsize= 419kB time=00:00:07.52 bitrate= 456.8kbits/s
video:356kB audio:55kB subtitle:0 global headers:0kB muxing overhead 1.821196%
But.
If I am try stream from local server to local nginx:
ffmpeg -i udp:233.163.114.53:5106 -s 512×288 -aspect 16:9 -profile baseline -b 500k -vcodec libx264 -acodec libmp3lame -ar 44100 -ab 64k -ac 2 -deinterlace -coder 0 -f flv ‘rtmp://127.0.0.1:1935/mytv/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test’
ffmpeg version git-2013-03-23-785b849 Copyright (c) 2000-2013 the FFmpeg developers
built on Mar 23 2013 18:44:11 with gcc 4.4.3 (Ubuntu 4.4.3-4ubuntu5.1)
configuration: —enable-gpl —enable-libfaac —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libtheora —enable-libvorbis —enable-libvpx —enable-libx264 —enable-nonfree —enable-version3
libavutil 52. 22.101 / 52. 22.101
libavcodec 55. 1.100 / 55. 1.100
libavformat 55. 0.100 / 55. 0.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 48.100 / 3. 48.100
libswscale 2. 2.100 / 2. 2.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 2.100 / 52. 2.100
[mpegts @ 0x33ca360] Unable to seek back to the start
[mpeg2video @ 0x33f0e20] Invalid frame dimensions 0x0.
Last message repeated 26 times
[mpegts @ 0x33ca360] max_analyze_duration 5000000 reached at 5016000 microseconds
[mpegts @ 0x33ca360] Estimating duration from bitrate, this may be inaccurate
Input #0, mpegts, from ‘udp:233.163.114.53:5106’:
Duration: N/A, start: 61190.166156, bitrate: 192 kb/s
Program 5300
Metadata:
service_name : ?KHL
service_provider: ?N3
Stream #0:0[0x141]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p, 720×576 [SAR 64:45 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x191]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, s16p, 192 kb/s
Please use -profile:a or -profile:v, -profile is ambiguous
Please use -b:a or -b:v, -b is ambiguous
rtmp://127.0.0.1:1935/mytv/ flashver=FMLE/3.020(compatible;20FMSc/1.0) live=true playpath=live_test: Input/output error
nginx 29461 root 7u IPv4 186593 0t0 TCP *:1935 (LISTEN)
nginx 29461 root 8u IPv4 186594 0t0 TCP *:http-alt (LISTEN)
nginx 29462 nobody 7u IPv4 186593 0t0 TCP *:1935 (LISTEN)
nginx 29462 nobody 8u IPv4 186594 0t0 TCP *:http-alt (LISTEN)
iptables -L -n -v
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
Howto troubleshoot this problem.
Thanks.
The text was updated successfully, but these errors were encountered:
Источник
ffmpeg stuck at startup; Input/Output error #1052
Hello,
I have stream server using nginx 1.12.0, nginx-rtmp-module 1.1.11 and ffmpeg 3.2.5-1
bpo8+1. When I connect to nginx using OBS everything goes fine, but ffmpeg often stuck at startup, but hardly ever doesn’t goes stuck and everything works fine.
My command for ffmpeg:
FFmpeg output before it goes stuck
Nginx receive play command, because I can find it in access log.
Situation is same with this very simple command that should ends with error there is needed atleast one output.
When I kill ffmepg with CTRL+C I get Input/Output error.
There shouldn’t be any problem with RTMP stream, because it plays normally in VLC.
In my PC everything worked fine, but in server of my company I get this error.
The text was updated successfully, but these errors were encountered:
Solved. Problem was with nginx 1.12.0, 1.10.3 is ok.
@PapiCZ
If you still monitor this thread, I have the same issues you had, but unfortunately going to nginx 1.10.3 did not fix it.
Would you care to give your ffmpeg build version ? I am wondering if this has to do with ffmpeg or nginx or rtmp module.
an exec to ffmpeg is simply unusable as a result, extremely frustrating .
Here is output of ffmpeg -version
I use it with nginx rtmp module 1.1.11.
Thanks a lot. Figured out the reason of the errors: multi workers was on auto instead of 1.
@pkviet Thanks! I had the same problem. ffmpeg would sometimes start and process the stream correctly but often it would just fail. Setting worker_processes to 1 fixed it.
This issue disappeared when I compiled the module statically in nginx.
I am getting input/output error when I am using FFmpeg. Ngnix is working fine status come ok for NGINX and snapped code is below please help me out
Источник
Openwrt Input/output error #739
I have successfully cross-compiled nginx-1.9.6 with PCRE-libs and nginx-rtmp-module.
and ffmpeg-2.6.2 with rtmp muxer/demuxer option.
Under Openwrt ffmpeg can successfully feed remote i386 nginx server with nginx-rtmp-module:
root@OpenWrt:/overlay/ffmpeg# /usr/bin/ffmpeg -v 99 -i rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp -vcodec copy -an -f flv rtmp://10.8.0.9:1
935/mycamera2/stream
ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r46450)
configuration: —enable-cross-compile —cross-prefix=mips-openwrt-linux-uclibc- —arch=mips —target-os=linux —prefix=/usr —pkg-config=pkg-config —enable-shared —enable-static —enable-small —enable-pthreads —enable-zlib —disable-runtime-cpudetect —disable-doc —disable-debug —enable-gpl —enable-version3 —disable-altivec —disable-amd3dnow —disable-amd3dnowext —disable-mmx —disable-mmxext —disable-sse —disable-sse2 —disable-sse3 —disable-ssse3 —disable-sse4 —disable-sse42 —disable-avx —disable-xop —disable-fma3 —disable-fma4 —disable-avx2 —disable-vfp —disable-neon —disable-inline-asm —disable-yasm —disable-mips32r2 —disable-mipsdspr1 —disable-mipsdspr2 —disable-mipsfpu —disable-dxva2 —disable-lzma —disable-vaapi —disable-vda —disable-vdpau —disable-outdevs —enable-encoder=flv —enable-demuxer=rtsp —enable-muxer=rtsp
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Splitting the commandline.
Reading option ‘-v’ . matched as option ‘v’ (set logging level) with argument ’99’.
Reading option ‘-i’ . matched as input file with argument ‘rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp’.
Reading option ‘-vcodec’ . matched as option ‘vcodec’ (force video codec (‘copy’ to copy stream)) with argument ‘copy’.
Reading option ‘-an’ . matched as option ‘an’ (disable audio) with argument ‘1’.
Reading option ‘-f’ . matched as option ‘f’ (force format) with argument ‘flv’.
Reading option ‘rtmp://10.8.0.9:1935/mycamera2/stream’ . matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 99.
Successfully parsed a group of options.
Parsing a group of options: input file rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp.
Successfully parsed a group of options.
Opening an input file: rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp.
[rtsp @ 0x476180] SDP:
v=0
o=- 1449859054269924 1449859054269924 IN IP4 192.168.4.10
s=Media Presentation
e=NONE
b=AS:5050
t=0 0
a=control:rtsp://192.168.4.10:554/Streaming/Channels/2/?tcp
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:5000
a=recvonly
a=control:rtsp://192.168.4.10:554/Streaming/Channels/2/trackID=1?tcp
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=Z01AHppmCg//NQEBAUAAAPoAABOIAQ==,aO48gA==
a=Media_header:MEDIAINFO=494D4B48010100000400010000000000000000000000000000000000000000000000000000000000;
a=appversion:1.0
[rtsp @ 0x476180] video codec set to: h264
[rtsp @ 0x476180] RTP Profile IDC: 42 Profile IOP: 0 Level: 29
[rtsp @ 0x476180] RTP Packetization Mode: 1
[rtsp @ 0x476180] Extradata set to 0x46e740 (size: 34)
[udp @ 0x478050] end receive buffer size reported is 131072
[udp @ 0x4890f0] end receive buffer size reported is 131072
[rtsp @ 0x476180] hello state=0
[h264 @ 0x478a10] Current profile doesn’t provide more RBSP data in PPS, skipping
Last message repeated 3 times
[rtsp @ 0x476180] All info found
rfps: 9.916667 0.012803
rfps: 10.000000 0.009867
Last message repeated 1 times
rfps: 10.083333 0.011538
Last message repeated 1 times
rfps: 10.166667 0.017815
rfps: 14.833333 0.017997
rfps: 14.916667 0.011809
Last message repeated 1 times
rfps: 15.000000 0.010227
rfps: 15.083333 0.013251
rfps: 24.833333 0.009082
Last message repeated 1 times
rfps: 24.916667 0.002261
Last message repeated 1 times
rfps: 25.000000 0.000046
Last message repeated 1 times
rfps: 25.083333 0.002438
Last message repeated 1 times
rfps: 25.166667 0.009435
Last message repeated 1 times
rfps: 40.000000 0.010679
rfps: 50.000000 0.000186
Last message repeated 1 times
rfps: 60.000000 0.009427
Last message repeated 1 times
rfps: 240.000000 0.017637
rfps: 59.940060 0.010947
rfps: 14.985015 0.010172
Last message repeated 1 times
Input #0, rtsp, from ‘rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp’:
Metadata:
title : Media Presentation
Duration: N/A, start: 0.700067, bitrate: N/A
Stream #0:0, 28, 1/90000: Video: h264, yuv420p(tv, bt709, left), 320×240, 1/20, 10 fps, 25 tbr, 90k tbn, 20 tbc
Successfully opened the file.
Parsing a group of options: output file rtmp://10.8.0.9:1935/mycamera2/stream.
Applying option vcodec (force video codec (‘copy’ to copy stream)) with argument copy.
Applying option an (disable audio) with argument 1.
Applying option f (force format) with argument flv.
Successfully parsed a group of options.
Opening an output file: rtmp://10.8.0.9:1935/mycamera2/stream.
[rtmp @ 0x4aec70] Handshaking.
[rtmp @ 0x4aec70] Type answer 3
[rtmp @ 0x4aec70] Server version 13.14.10.13
[rtmp @ 0x4aec70] Proto = rtmp, path = /mycamera2/stream, app = mycamera2, fname = stream
[rtmp @ 0x4aec70] Server bandwidth = 5000000
[rtmp @ 0x4aec70] Client bandwidth = 5000000
[rtmp @ 0x4aec70] New incoming chunk size = 4096
[rtmp @ 0x4aec70] Releasing stream.
[rtmp @ 0x4aec70] FCPublish stream.
[rtmp @ 0x4aec70] Creating stream.
[rtmp @ 0x4aec70] Sending publish command for ‘stream’
Successfully opened the file.
Output #0, flv, to ‘rtmp://10.8.0.9:1935/mycamera2/stream’:
Metadata:
title : Media Presentation
encoder : Lavf56.25.101
Stream #0:0, 0, 1/1000: Video: h264 ([7][0][0][0] / 0x0007), yuv420p(left), 320×240 (0x0), 1/90000, q=2-31, 10 fps, 25 tbr, 1k tbn, 90k tbc
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[flv @ 0x4eb240] Non-monotonous DTS in output stream 0:0; previous: 0, current: -500; changing to 0. This may result in incorrect timestamps in the output file.
[flv @ 0x4eb240] Non-monotonous DTS in output stream 0:0; previous: 0, current: -380; changing to 0. This may result in incorrect timestamps in the output file.
[flv @ 0x4eb240] Non-monotonous DTS in output stream 0:0; previous: 0, current: -299; changing to 0. This may result in incorrect timestamps in the output file.
[flv @ 0x4eb240] Non-monotonous DTS in output stream 0:0; previous: 0, current: -180; changing to 0. This may result in incorrect timestamps in the output file.
[flv @ 0x4eb240] Non-monotonous DTS in output stream 0:0; previous: 0, current: -100; changing to 0. This may result in incorrect timestamps in the output file.
[NULL @ 0x478a10] Current profile doesn’t provide more RBSP data in PPS, skipping
[NULL @ 0x478a10] Current profile doesn’t provide more RBSP data in PPS, skipping
Last message repeated 2 times
[NULL @ 0x478a10] RTP: missed 16 packets
[NULL @ 0x478a10] Current profile doesn’t provide more RBSP data in PPS, skipping
[NULL @ 0x478a10] RTP: missed 1 packets7kB time=00:00:07.42 bitrate= 52.4kbits/s
[NULL @ 0x478a10] Current profile doesn’t provide more RBSP data in PPS, skipping
[NULL @ 0x478a10] Current profile doesn’t provide more RBSP data in PPS, skipping
[flv @ 0x4eb240] Failed to update header with correct duration.
[flv @ 0x4eb240] Failed to update header with correct filesize.
frame= 90 fps= 32 q=-1.0 Lsize= 59kB time=00:00:09.50 bitrate= 50.5kbits/s
video:57kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.658389%
Input file #0 (rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp):
Input stream #0:0 (video): 90 packets read (57867 bytes);
Total: 90 packets (57867 bytes) demuxed
Output file #0 (rtmp://10.8.0.9:1935/mycamera2/stream):
Output stream #0:0 (video): 90 packets muxed (57867 bytes);
Total: 90 packets (57867 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x4ae670] Statistics: 0 seeks, 92 writeouts
[rtmp @ 0x4aec70] UnPublishing stream.
[rtmp @ 0x4aec70] Deleting stream.
Received signal 2: terminating.
So ffmpeg in Openwrt is good for rtmp feeding.
But ffmpeg in Openwrt can not feed local nginx (Openwrt):
/usr/bin/ffmpeg -v 99 -i rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp -vcodec copy -an -f flv rtmp://127.0.0.1:1935/mycamera2/stream
ffmpeg version 2.6.2 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r46450)
configuration: —enable-cross-compile —cross-prefix=mips-openwrt-linux-uclibc- —arch=mips —target-os=linux —prefix=/usr —pkg-config=pkg-config —enable-shared —enable-static —enable-small —enable-pthreads —enable-zlib —disable-runtime-cpudetect —disable-doc —disable-debug —enable-gpl —enable-version3 —disable-altivec —disable-amd3dnow —disable-amd3dnowext —disable-mmx —disable-mmxext —disable-sse —disable-sse2 —disable-sse3 —disable-ssse3 —disable-sse4 —disable-sse42 —disable-avx —disable-xop —disable-fma3 —disable-fma4 —disable-avx2 —disable-vfp —disable-neon —disable-inline-asm —disable-yasm —disable-mips32r2 —disable-mipsdspr1 —disable-mipsdspr2 —disable-mipsfpu —disable-dxva2 —disable-lzma —disable-vaapi —disable-vda —disable-vdpau —disable-outdevs —enable-encoder=flv —enable-demuxer=rtsp —enable-muxer=rtsp
libavutil 54. 20.100 / 54. 20.100
libavcodec 56. 26.100 / 56. 26.100
libavformat 56. 25.101 / 56. 25.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.102 / 5. 11.102
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Splitting the commandline.
Reading option ‘-v’ . matched as option ‘v’ (set logging level) with argument ’99’.
Reading option ‘-i’ . matched as input file with argument ‘rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp’.
Reading option ‘-vcodec’ . matched as option ‘vcodec’ (force video codec (‘copy’ to copy stream)) with argument ‘copy’.
Reading option ‘-an’ . matched as option ‘an’ (disable audio) with argument ‘1’.
Reading option ‘-f’ . matched as option ‘f’ (force format) with argument ‘flv’.
Reading option ‘rtmp://127.0.0.1:1935/mycamera2/stream’ . matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument 99.
Successfully parsed a group of options.
Parsing a group of options: input file rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp.
Successfully parsed a group of options.
Opening an input file: rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp.
[rtsp @ 0x722180] SDP:
v=0
o=- 1449859729814985 1449859729814985 IN IP4 192.168.4.10
s=Media Presentation
e=NONE
b=AS:5050
t=0 0
a=control:rtsp://192.168.4.10:554/Streaming/Channels/2/?tcp
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:5000
a=recvonly
a=control:rtsp://192.168.4.10:554/Streaming/Channels/2/trackID=1?tcp
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=420029; packetization-mode=1; sprop-parameter-sets=Z01AHppmCg//NQEBAUAAAPoAABOIAQ==,aO48gA==
a=Media_header:MEDIAINFO=494D4B48010100000400010000000000000000000000000000000000000000000000000000000000;
a=appversion:1.0
[rtsp @ 0x722180] video codec set to: h264
[rtsp @ 0x722180] RTP Profile IDC: 42 Profile IOP: 0 Level: 29
[rtsp @ 0x722180] RTP Packetization Mode: 1
[rtsp @ 0x722180] Extradata set to 0x71a740 (size: 34)
[udp @ 0x724050] end receive buffer size reported is 131072
[udp @ 0x7350f0] end receive buffer size reported is 131072
[rtsp @ 0x722180] hello state=0
[h264 @ 0x724a10] Current profile doesn’t provide more RBSP data in PPS, skipping
Last message repeated 3 times
[rtsp @ 0x722180] All info found
rfps: 9.916667 0.012950
rfps: 10.000000 0.009908
rfps: 10.083333 0.011472
Last message repeated 1 times
rfps: 10.166667 0.017639
rfps: 14.833333 0.018249
rfps: 14.916667 0.011902
Last message repeated 1 times
rfps: 15.000000 0.010161
Last message repeated 1 times
rfps: 15.083333 0.013023
rfps: 24.833333 0.009605
rfps: 24.916667 0.002519
Last message repeated 1 times
rfps: 25.000000 0.000039
Last message repeated 1 times
rfps: 25.083333 0.002162
rfps: 25.166667 0.008890
Last message repeated 1 times
rfps: 40.000000 0.010490
Last message repeated 1 times
rfps: 50.000000 0.000154
Last message repeated 1 times
rfps: 60.000000 0.009635
rfps: 240.000000 0.015901
rfps: 59.940060 0.011615
Last message repeated 1 times
rfps: 14.985015 0.010134
Last message repeated 1 times
Input #0, rtsp, from ‘rtsp://user:user@192.168.4.10:554/Streaming/Channels/2?tcp’:
Metadata:
title : Media Presentation
Duration: N/A, start: 0.696689, bitrate: N/A
Stream #0:0, 28, 1/90000: Video: h264, yuv420p(tv, bt709, left), 320×240, 1/20, 10 fps, 25 tbr, 90k tbn, 20 tbc
Successfully opened the file.
Parsing a group of options: output file rtmp://127.0.0.1:1935/mycamera2/stream.
Applying option vcodec (force video codec (‘copy’ to copy stream)) with argument copy.
Applying option an (disable audio) with argument 1.
Applying option f (force format) with argument flv.
Successfully parsed a group of options.
Opening an output file: rtmp://127.0.0.1:1935/mycamera2/stream.
[rtmp @ 0x7d7060] Handshaking.
[rtmp @ 0x7d7060] Type answer 3
[rtmp @ 0x7d7060] Server version 13.14.10.13
[rtmp @ 0x7d7060] Proto = rtmp, path = /mycamera2/stream, app = mycamera2, fname = stream
rtmp://127.0.0.1:1935/mycamera2/stream: Input/output error
Debug nginx log:
2015/12/11 15:42:03 [debug] 4126#0: epoll: fd:10 ev:0001 d:0134FB78
2015/12/11 15:42:03 [debug] 4126#0: accept on 0.0.0.0:1935, ready: 0
2015/12/11 15:42:03 [debug] 4126#0: posix_memalign: 0131F260:4096 @16
2015/12/11 15:42:03 [debug] 4126#0: *4 accept: 127.0.0.1:51232 fd:3
2015/12/11 15:42:03 [info] 4126#0: *4 client connected ‘127.0.0.1’
2015/12/11 15:42:03 [debug] 4126#0: *4 malloc: 01385B18:18432
2015/12/11 15:42:03 [debug] 4126#0: *4 setting chunk_size=128
2015/12/11 15:42:03 [debug] 4126#0: *4 posix_memalign: 01320280:4096 @16
2015/12/11 15:42:03 [debug] 4126#0: *4 handshake: start server handshake
2015/12/11 15:42:03 [debug] 4126#0: *4 handshake: allocating buffer
2015/12/11 15:42:03 [debug] 4126#0: *4 recv: fd:3 -1 of 1537
2015/12/11 15:42:03 [debug] 4126#0: *4 recv() not ready (11: Resource temporarily unavailable)
2015/12/11 15:42:03 [debug] 4126#0: *4 event timer add: 3: 60000:2426604613
2015/12/11 15:42:03 [debug] 4126#0: *4 epoll add event: fd:3 op:1 ev:80002001
2015/12/11 15:42:03 [debug] 4126#0: timer delta: 316137
2015/12/11 15:42:03 [debug] 4126#0: worker cycle
2015/12/11 15:42:03 [debug] 4126#0: epoll timer: 60000
2015/12/11 15:42:03 [debug] 4126#0: epoll: fd:3 ev:0001 d:0134FC69
2015/12/11 15:42:03 [debug] 4126#0: *4 event timer del: 3: 2426604613
2015/12/11 15:42:03 [debug] 4126#0: *4 recv: fd:3 1537 of 1537
2015/12/11 15:42:03 [debug] 4126#0: *4 epoll del event: fd:3 op:2 ev:00000000
2015/12/11 15:42:03 [debug] 4126#0: *4 handshake: stage 2
2015/12/11 15:42:03 [debug] 4126#0: *4 handshake: peer version=2.124.0.9 epoch=0
2015/12/11 15:42:03 [debug] 4126#0: *4 handshake: digest found at pos=494
2015/12/11 15:42:03 [debug] 4126#0: *4 send: fd:3 1537 of 1537
2015/12/11 15:42:03 [debug] 4126#0: *4 handshake: stage 3
2015/12/11 15:42:03 [debug] 4126#0: *4 send: fd:3 1536 of 1536
2015/12/11 15:42:03 [debug] 4126#0: *4 handshake: stage 4
2015/12/11 15:42:03 [debug] 4126#0: *4 recv: fd:3 1536 of 1536
2015/12/11 15:42:03 [debug] 4126#0: *4 handshake: stage 5
2015/12/11 15:42:03 [debug] 4126#0: *4 handshake: done
2015/12/11 15:42:03 [debug] 4126#0: *4 event timer add: 3: 60000:2426604615
2015/12/11 15:42:03 [debug] 4126#0: *4 ping: wait 60000ms
2015/12/11 15:42:03 [debug] 4126#0: *4 recv: fd:3 -1 of 146
2015/12/11 15:42:03 [debug] 4126#0: *4 recv() not ready (11: Resource temporarily unavailable)
2015/12/11 15:42:03 [debug] 4126#0: *4 epoll add event: fd:3 op:1 ev:80002001
2015/12/11 15:42:03 [debug] 4126#0: timer delta: 2
2015/12/11 15:42:03 [debug] 4126#0: worker cycle
2015/12/11 15:42:03 [debug] 4126#0: epoll timer: 60000
2015/12/11 15:42:03 [debug] 4126#0: epoll: fd:3 ev:0001 d:0134FC69
2015/12/11 15:42:03 [debug] 4126#0: *4 recv: fd:3 146 of 146
2015/12/11 15:42:03 [debug] 4126#0: *4 RTMP bheader fmt=0 csid=3
2015/12/11 15:42:03 [debug] 4126#0: *4 RTMP mheader fmt=0 amf_cmd (20) time=0+0 mlen=-1795162112 len=0 msid=0
2015/12/11 15:42:03 [info] 4126#0: *4 too big message: 15728640, client: 127.0.0.1, server: 0.0.0.0:1935
2015/12/11 15:42:03 [debug] 4126#0: *4 finalize session
2015/12/11 15:42:03 [debug] 4126#0: *4 post event 0131F2E4
2015/12/11 15:42:03 [debug] 4126#0: timer delta: 40
2015/12/11 15:42:03 [debug] 4126#0: posted event 0131F2E4
2015/12/11 15:42:03 [debug] 4126#0: *4 delete posted event 0131F2E4
2015/12/11 15:42:03 [debug] 4126#0: *4 close session
2015/12/11 15:42:03 [info] 4126#0: *4 disconnect, client: 127.0.0.1, server: 0.0.0.0:1935
2015/12/11 15:42:03 [info] 4126#0: *4 deleteStream, client: 127.0.0.1, server: 0.0.0.0:1935
2015/12/11 15:42:03 [debug] 4126#0: *4 record: close_stream
2015/12/11 15:42:03 [debug] 4126#0: *4 event timer del: 3: 2426604615
2015/12/11 15:42:03 [debug] 4126#0: *4 free: 01320280, unused: 3822
2015/12/11 15:42:03 [debug] 4126#0: *4 close connection
2015/12/11 15:42:03 [debug] 4126#0: *4 reusable connection: 0
2015/12/11 15:42:03 [debug] 4126#0: *4 free: 01385B18
2015/12/11 15:42:03 [debug] 4126#0: *4 free: 0131F260, unused: 2496
2015/12/11 15:42:03 [debug] 4126#0: worker cycle
2015/12/11 15:42:03 [debug] 4126#0: epoll timer: -1
Alsow have file dump from command » tcpdump -i lo tcp port 1935 -w rtmp1.dmp»
The text was updated successfully, but these errors were encountered:
Источник
Решено. Проблема была с nginx 1.12.0, 1.10.3 в порядке.
@PapiCZ
Если вы по-прежнему отслеживаете этот поток, у меня те же проблемы, что и у вас, но, к сожалению, переход на nginx 1.10.3 не помог их.
Не хотели бы вы дать свою версию сборки ffmpeg? Мне интересно, связано ли это с модулем ffmpeg, nginx или rtmp.
exec для ffmpeg в результате просто непригоден для использования, что очень расстраивает …
Вот вывод ffmpeg -version
ffmpeg version 3.2.5-1 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (Debian 6.3.0-18) 20170516
configuration: --prefix=/usr --extra-version=1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libebur128 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 34.101 / 55. 34.101
libavcodec 57. 64.101 / 57. 64.101
libavformat 57. 56.101 / 57. 56.101
libavdevice 57. 1.100 / 57. 1.100
libavfilter 6. 65.100 / 6. 65.100
libavresample 3. 1. 0 / 3. 1. 0
libswscale 4. 2.100 / 4. 2.100
libswresample 2. 3.100 / 2. 3.100
libpostproc 54. 1.100 / 54. 1.100
Я использую его с модулем nginx rtmp 1.1.11.
Большое спасибо. Выяснили причину ошибок: multi worker был на auto вместо 1.
@pkviet Спасибо! У меня такая же проблема. ffmpeg иногда запускал и обрабатывал поток правильно, но часто просто выходил из строя. Установка worker_processes в 1 исправила это.
Эта проблема исчезла, когда я статически скомпилировал модуль в nginx.
Я получаю ошибку ввода / вывода, когда использую FFmpeg. Ngnix работает нормально, статус подходит для NGINX, и код привязки ниже, пожалуйста, помогите мне
./stream1.sh
ffmpeg -re -i sample.mp4 -vcodec copy -loop -1 -c: a aac -b: a 160k -ar 44100 -strict -2 -f flv rtmp: 198.168.0.0/live/1234567890
ffmpeg версия 2.8.15 Авторские права (c) 2000-2018 разработчики FFmpeg
построено с помощью gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
конфигурация: —prefix = / usr —bindir = / usr / bin —datadir = / usr / share / ffmpeg —incdir = / usr / include / ffmpeg —libdir = / usr / lib64 —mandir = / usr / share / man —arch = x86_64 —optflags = ‘- O2 -g -pipe -Wall -Wp, -D_FORTIFY_SOURCE = 2 -fexceptions -fstack-protector-strong —param = ssp-buffer-size = 4 -grecord -gcc-Switches -m64 -mtune = generic ‘—extra-ldflags =’ — Wl, -z, relro ‘—enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libvo-amrwbenc —enable -version3 —enable-bzlib —disable-crystalhd —enable-gnutls —enable-ladspa —enable-libass —enable-libcdio —enable-libdc1394 —enable-libfdk-aac —enable-nonfree — -disable-indev = jack —enable-libfreetype —enable-libgsm —enable-libmp3lame —enable-openal —enable-libopenjpeg —enable-libopus —enable-libpulse —enable-libschroedinger —enable- libsoxr —enable-libspeex —enable-libtheora —enable-libvorbis —enable-libv4l2 —enable-libx264 —enable-libx265 —enable-libxvid —enable-x11grab —enable-avfilter —enable- avresample —enable-postproc —e nable-pthreads —disable-static —enable-shared —enable-gpl —disable-debug —disable-stripping —shlibdir = / usr / lib64 —enable-runtime-cpudetect
libavutil 54.31.100 / 54.31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Вход # 0, mov, mp4, m4a, 3gp, 3g2, mj2, из sample.mp4:
Метаданные:
major_brand: isom
minor_version: 512
совместимые_бренды: isomiso2avc1mp41
кодировщик: Lavf56.40.101
Продолжительность: 00: 45: 30.48, начало: 0.000000, битрейт: 525 кб / с
Поток № 0: 0 (отмена): Видео: h264 (Main) (avc1 / 0x31637661), yuv420p (tv, bt709), 1280×720 [SAR 1: 1 DAR 16: 9], 391 кб / с, 25 кадров в секунду, 25 tbr , 12800 ТБН, 50 ТБН (по умолчанию)
Метаданные:
handler_name: VideoHandler
Поток # 0: 1 (und): Аудио: aac (LC) (mp4a / 0x6134706D), 44100 Гц, стерео, fltp, 128 кбит / с (по умолчанию)
Метаданные:
handler_name: SoundHandler
rtmp:198.168.0.0/live/1234567890: Input/output error
Была ли эта страница полезной?
0 / 5 — 0 рейтинги
Some context: I have an Nginx server (with rtmp-module) on a Ubuntu-16.04 VM. I’m using it to receive an input rtmp stream from my PC. FFmpeg is then used in the VM to take this input and relay to multiple destinations after transcoding, overlaying a lower third, and changing the volume.
FFmpeg version: ffmpeg version N-92147-gf85fa10 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609 configuration: —pkg-config-flags=—static —extra-cflags=-I/home/btech11/ffmpeg_build/include —extra-ldflags=-L/home/btech11/ffmpeg_build/lib —extra-libs=’-lpthread -lm’ —enable-gpl —enable-libass —enable-libfdk-aac —enable-libfreetype —enable-libmp3lame —enable-libopus —enable-libvorbis —enable-libvpx —enable-libx264 —enable-libx265 —enable-libzmq —enable-librtmp —enable-network —enable-nonfree libavutil 56. 19.101 / 56. 19.101 libavcodec 58. 32.100 / 58. 32.100 libavformat 58. 18.104 / 58. 18.104 libavdevice 58. 4.105 / 58. 4.105 libavfilter 7. 33.100 / 7. 33.100 libswscale 5. 2.100 / 5. 2.100 libswresample 3. 2.100 / 3. 2.100 libpostproc 55. 2.100 / 55. 2.100
FFmpeg command: /usr/local/bin/ffmpeg -nostdin -thread_queue_size 512 -i rtmp://127.0.0.1:1935/stream1/input -i /usr/local/nginx/scripts/images/lowerthird.png -af azmq,volume=2 -c:a libfdk_aac -filter_complex ‘zmq=bind_address=tcp://127.0.0.1:5556,overlay=0:H’ -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 50 -b:v 6000k -maxrate 6M -minrate 6M -bufsize 6M -f flv rtmp://a.rtmp.youtube.com/live2/[my key] -y
Problem: Ffmpeg quits after a random duration between 15-30 minutes with this error.
av_interleaved_write_frame(): End of file [flv @ 0x25fffc0] Failed to update header with correct duration. [flv @ 0x25fffc0] Failed to update header with correct filesize. Error writing trailer of rtmp://a.rtmp.youtube.com/live2/[my key]: End of file frame=36101 fps= 25 q=11.0 Lsize= 1066356kB time=00:24:04.37 bitrate=6048.0kbits/s speed= 1x video:1042015kB audio:22620kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.161639% [libx264 @ 0x2600c80] frame I:743 Avg QP: 6.67 size:269470 [libx264 @ 0x2600c80] frame P:35336 Avg QP:10.16 size: 24546 [libx264 @ 0x2600c80] frame B:22 Avg QP:15.04 size: 8699 [libx264 @ 0x2600c80] consecutive B-frames: 99.9% 0.0% 0.0% 0.0% [libx264 @ 0x2600c80] mb I I16..4: 29.9% 4.3% 65.8% [libx264 @ 0x2600c80] mb P I16..4: 3.0% 1.1% 2.3% P16..4: 27.1% 1.8% 1.5% 0.0% 0.0% skip:63.1% [libx264 @ 0x2600c80] mb B I16..4: 1.8% 0.6% 0.3% B16..8: 8.7% 3.0% 0.6% direct: 6.1% skip:78.9% L0:39.6% L1:52.4% BI: 8.0% [libx264 @ 0x2600c80] 8x8 transform intra:14.1% inter:12.1% [libx264 @ 0x2600c80] coded y,uvDC,uvAC intra: 53.5% 51.1% 27.5% inter: 10.4% 12.7% 2.0% [libx264 @ 0x2600c80] i16 v,h,dc,p: 52% 38% 6% 4% [libx264 @ 0x2600c80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 34% 27% 2% 0% 0% 0% 1% 1% [libx264 @ 0x2600c80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 51% 28% 12% 1% 1% 2% 1% 2% 1% [libx264 @ 0x2600c80] i8c dc,h,v,p: 48% 23% 22% 7% [libx264 @ 0x2600c80] Weighted P-Frames: Y:0.4% UV:0.3% [libx264 @ 0x2600c80] kb/s:5915.49 Conversion failed!
I’ve also tried it with a codec copy command to try and eliminate the problem: /usr/local/bin/ffmpeg -nostdin -thread_queue_size 512 -i rtmp://127.0.0.1:1935/stream1/input -c copy -f flv rtmp://a.rtmp.youtube.com/live2/[my key] -y
The stream seems to work for longer but errors out after an hour with below error. The second time I ran this command however, the stream worked for 2 hrs 40 minutes, before I had to quit to get some other work done.
av_interleaved_write_frame(): End of filekB time=01:07:20.22 bitrate=3166.5kbits/s speed= 1x [flv @ 0x2c21e40] Failed to update header with correct duration. [flv @ 0x2c21e40] Failed to update header with correct filesize. Error writing trailer of rtmp://a.rtmp.youtube.com/live2/[my key]: End of file frame=101001 fps= 25 q=-1.0 Lsize= 1561874kB time=01:07:20.55 bitrate=3166.6kbits/s speed= 1x video:1479592kB audio:77420kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.312238% Conversion failed!
Third command I tried was with acodec copy but vcodec applied: /usr/local/bin/ffmpeg -nostdin -thread_queue_size 512 -i rtmp://127.0.0.1:1935/stream1/input -i /usr/local/nginx/scripts/images/lowerthird.png -acodec copy -filter_complex ‘zmq=bind_address=tcp://127.0.0.1:5556,overlay=0:H’ -vcodec libx264 -pix_fmt yuv420p -preset veryfast -r 25 -g 50 -b:v 6000k -maxrate 6M -minrate 6M -bufsize 6M -f flv rtmp://a.rtmp.youtube.com/live2/[my key] -y
Errored out in 3 minutes the first time and 19 minutes th second time I tried. Error output:
Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, stereo, fltp, 163 kb/s av_interleaved_write_frame(): End of fileB time=00:03:07.45 bitrate=6072.8kbits/s speed=1.02x [flv @ 0x3303200] Failed to update header with correct duration. [flv @ 0x3303200] Failed to update header with correct filesize. Error writing trailer of rtmp://a.rtmp.youtube.com/live2/[my key]: End of file frame= 4653 fps= 25 q=20.0 Lsize= 139504kB time=00:03:07.94 bitrate=6080.7kbits/s speed=1.02x video:135616kB audio:3684kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.146554% [libx264 @ 0x3304100] frame I:99 Avg QP:10.71 size:163258 [libx264 @ 0x3304100] frame P:4553 Avg QP:14.70 size: 27059 [libx264 @ 0x3304100] frame B:1 Avg QP:26.37 size: 4978 [libx264 @ 0x3304100] consecutive B-frames: 100.0% 0.0% 0.0% 0.0% [libx264 @ 0x3304100] mb I I16..4: 31.1% 8.7% 60.2% [libx264 @ 0x3304100] mb P I16..4: 5.6% 2.6% 4.5% P16..4: 23.5% 2.5% 2.0% 0.0% 0.0% skip:59.3% [libx264 @ 0x3304100] mb B I16..4: 2.0% 2.4% 0.0% B16..8: 10.8% 1.1% 0.1% direct: 1.1% skip:82.4% L0:75.0% L1:24.0% BI: 1.0% [libx264 @ 0x3304100] 8x8 transform intra:18.8% inter:19.7% [libx264 @ 0x3304100] coded y,uvDC,uvAC intra: 49.8% 48.9% 18.3% inter: 10.2% 11.5% 1.8% [libx264 @ 0x3304100] i16 v,h,dc,p: 62% 28% 6% 5% [libx264 @ 0x3304100] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 43% 30% 22% 2% 0% 0% 0% 1% 2% [libx264 @ 0x3304100] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 61% 21% 12% 1% 1% 1% 1% 1% 1% [libx264 @ 0x3304100] i8c dc,h,v,p: 49% 21% 24% 7% [libx264 @ 0x3304100] Weighted P-Frames: Y:0.0% UV:0.0% [libx264 @ 0x3304100] kb/s:5990.48 Conversion failed!
Strangely enough, doing a vcodec copy did not throw any error even after 2 hours, 20 minutes of streaming. I’m doing a longer duration stream to further validate this. Will update this post with any info. The command I used was: /usr/local/bin/ffmpeg -nostdin -thread_queue_size 512 -i rtmp://127.0.0.1:1935/stream1/input -af azmq,volume=2 -c:a libfdk_aac -vcodec copy -f flv rtmp://a.rtmp.youtube.com/live2/[my key] -y UPDATE ON THE ABOVE VCODEC COPY: Just did another test and it errored out after 19 mins. So no go.
Possibilities I’ve eliminated: My bandwidth from the PC to the VM is between 40-80mbps upload and download. I’m able to stream fine from my PC using OBS to youtube for 7-8 hrs. Also when I either stop OBS on my PC or disconnect the internet on my PC, ffmpeg behaves very differently from the above errors. It freezes for a few seconds, and if the input comes back inthat time, picks up where it left off, So the above error. So I dont believe it’s a network issue from my system.
The error occurs with various destinations: youtube, facebook, even another endpoint on the same nginx server, so it’s not an issue with network from VM to youtube etc.
Another interesting thing I found, if I run two ffmpeg instances from the same input to two different youtube livestreams, they seem to error out independently. So doesnt seem to be an input issue at all.
Error DOES NOT occur while streaming out of a local mp4 file using codec copy, so it seems to be an error with an input rtmp stream. Or at least no error for a couple of hours of streaming. Not sure if that was just my good luck.
-
ronag
- New Cone
- Posts: 4
- Joined: 15 Feb 2015 09:32
RTMP with FFMPEG + NGINX Doesn’t play in VLC
I’ve got a RTMP stream setup with FFMPEG -> NGINX which I can play just fine with FFPLAY. However, it does not work with VLC.
Code: Select all
main debug: VLC media player - 2.1.5 Rincewind
main debug: Copyright © 1996-2014 the VideoLAN team
main debug: revision 2.1.4-59-g5f258d5
main debug: configured with ../extras/package/macosx/../../../configure '--prefix=/Users/fkuehne/Desktop/videolan/gits/vlc-2.1/release/vlc_install_dir' '--enable-macosx' '--enable-merge-ffmpeg' '--enable-growl' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-shout' '--enable-ncurses' '--enable-twolame' '--enable-realrtsp' '--enable-libass' '--enable-macosx-audio' '--enable-macosx-eyetv' '--enable-macosx-qtkit' '--enable-macosx-vout' '--disable-caca' '--disable-skins2' '--disable-xcb' '--disable-sdl' '--disable-samplerate' '--disable-macosx-dialog-provider' '--with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk' '--build=x86_64-apple-darwin10' '--with-macosx-version-min=10.6' 'build_alias=x86_64-apple-darwin10' 'CC=xcrun clang' 'CXX=xcrun clang++' 'OBJC=xcrun clang'
main debug: processing request item: rtmp://test.mydomain.hu/live, node: Playlist, skip: 0
main debug: resyncing on rtmp://test.mydomain.hu/live
main debug: rtmp://test.mydomain.hu/live is at 0
main debug: starting playback of the new playlist item
main debug: resyncing on rtmp://test.mydomain.hu/live
main debug: rtmp://test.mydomain.hu/live is at 0
main debug: creating new input thread
main debug: Creating an input for 'rtmp://test.mydomain.hu/live'
main debug: using timeshift granularity of 50 MiB, in path '/tmp'
main debug: `rtmp://test.mydomain.hu/live' gives access `rtmp' demux `' path `test.mydomain.hu/live'
main debug: creating demux: access='rtmp' demux='' location='test.mydomain.hu/live' file='(null)'
main debug: looking for access_demux module matching "rtmp": 14 candidates
main debug: no access_demux modules matched
main debug: creating access 'rtmp' location='test.mydomain.hu/live', path='(null)'
main debug: looking for access module matching "rtmp": 18 candidates
avcodec error: Failed to open rtmp://test.mydomain.hu/live: Input/output error
main debug: no access modules matched
main error: open of `rtmp://test.mydomain.hu/live' failed
main debug: dead input
main debug: changing item without a request (current 0/1)
main debug: nothing to play
What might be causing this problem?
Last edited by ronag on 15 Feb 2015 16:06, edited 1 time in total.
-
ronag
- New Cone
- Posts: 4
- Joined: 15 Feb 2015 09:32
Re: RTMP with FFMPEG + NGINX Doesn’t play in VLC
Postby ronag » 15 Feb 2015 16:03
Same problem with 2.2.
Code: Select all
core debug: VLC media player - 2.2.0-rc2 Weatherwax
core debug: Copyright © 1996-2015 the VideoLAN team
core debug: revision 2.2.0-rc2-213-g277f152
core debug: configured with ../extras/package/macosx/../../../configure '--prefix=/Users/buildbot/slave/vlc-stable-bin-osx-x86_64/build/build/vlc_install_dir' '--enable-macosx' '--enable-merge-ffmpeg' '--enable-growl' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-shout' '--enable-ncurses' '--enable-twolame' '--enable-realrtsp' '--enable-libass' '--enable-macosx-eyetv' '--enable-macosx-qtkit' '--enable-macosx-avfoundation' '--disable-skins2' '--disable-xcb' '--disable-caca' '--disable-sdl' '--disable-samplerate' '--disable-macosx-dialog-provider' '--build=x86_64-apple-darwin10' '--with-macosx-version-min=10.6' '--with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk' 'build_alias=x86_64-apple-darwin10' 'CC=xcrun clang' 'CFLAGS=-g' 'LDFLAGS=' 'CXX=xcrun clang++' 'OBJC=xcrun clang'
core debug: processing request item: rtmp://test.mydomain.hu/live, node: Playlist, skip: 0
core debug: resyncing on rtmp://test.mydomain.hu/live
core debug: rtmp://test.mydomain.hu/live is at 0
core debug: starting playback of the new playlist item
core debug: resyncing on rtmp://test.mydomain.hu/live
core debug: rtmp://test.mydomain.hu/live is at 0
core debug: creating new input thread
core debug: Creating an input for 'rtmp://test.mydomain.hu/live'
core debug: requesting art for rtmp://test.mydomain.hu/live
core debug: using timeshift granularity of 50 MiB, in path '/tmp'
core debug: looking for meta fetcher module matching "any": 1 candidates
core debug: `rtmp://test.mydomain.hu/live' gives access `rtmp' demux `' path `test.mydomain.hu/live'
lua debug: Trying Lua scripts in /Users/ronagy/Library/Application Support/org.videolan.vlc/lua/meta/fetcher
core debug: specified demux `any'
core debug: creating demux: access='rtmp' demux='any' location='test.mydomain.hu/live' file='(null)'
lua debug: Trying Lua scripts in /Applications/VLC.app/Contents/MacOS/share/lua/meta/fetcher
core debug: looking for access_demux module matching "rtmp": 14 candidates
core debug: no access_demux modules matched
core debug: creating access 'rtmp' location='test.mydomain.hu/live', path='(null)'
core debug: looking for access module matching "rtmp": 18 candidates
avcodec debug: CPU flags: 0x0007d3db
lua debug: Trying Lua playlist script /Applications/VLC.app/Contents/MacOS/share/lua/meta/fetcher/tvrage.luac
lua debug: skipping script (unmatched scope) /Applications/VLC.app/Contents/MacOS/share/lua/meta/fetcher/tvrage.luac
lua debug: Trying Lua scripts in /Applications/VLC.app/Contents/MacOS/share/share/lua/meta/fetcher
core debug: no meta fetcher modules matched
core debug: searching art for rtmp://test.mydomain.hu/live
core debug: looking for art finder module matching "any": 2 candidates
lua debug: Trying Lua scripts in /Users/ronagy/Library/Application Support/org.videolan.vlc/lua/meta/art
lua debug: Trying Lua scripts in /Applications/VLC.app/Contents/MacOS/share/lua/meta/art
lua debug: Trying Lua playlist script /Applications/VLC.app/Contents/MacOS/share/lua/meta/art/00_musicbrainz.luac
lua debug: skipping script (unmatched scope) /Applications/VLC.app/Contents/MacOS/share/lua/meta/art/00_musicbrainz.luac
avcodec error: Failed to open rtmp://test.mydomain.hu/live: Input/output error
lua debug: Trying Lua playlist script /Applications/VLC.app/Contents/MacOS/share/lua/meta/art/01_googleimage.luac
core debug: no access modules matched
core error: open of `rtmp://test.mydomain.hu/live' failed
lua debug: skipping script (unmatched scope) /Applications/VLC.app/Contents/MacOS/share/lua/meta/art/01_googleimage.luac
lua debug: Trying Lua playlist script /Applications/VLC.app/Contents/MacOS/share/lua/meta/art/02_frenchtv.luac
lua debug: skipping script (unmatched scope) /Applications/VLC.app/Contents/MacOS/share/lua/meta/art/02_frenchtv.luac
lua debug: Trying Lua playlist script /Applications/VLC.app/Contents/MacOS/share/lua/meta/art/03_lastfm.luac
lua debug: skipping script (unmatched scope) /Applications/VLC.app/Contents/MacOS/share/lua/meta/art/03_lastfm.luac
lua debug: Trying Lua scripts in /Applications/VLC.app/Contents/MacOS/share/share/lua/meta/art
core debug: no art finder modules matched
core debug: art not found for rtmp://test.mydomain.hu/live
macosx warning: variable stereo-mode doesn't exist or isn't handled
core debug: finished input
core debug: dead input
core debug: changing item without a request (current 0/1)
core debug: nothing to play
-
ronag
- New Cone
- Posts: 4
- Joined: 15 Feb 2015 09:32
Re: RTMP with FFMPEG + NGINX Doesn’t play in VLC
Postby ronag » 15 Feb 2015 16:06
And also with 3.0.
-
Jean-Baptiste Kempf
- Site Administrator
- Posts: 37488
- Joined: 22 Jul 2005 15:29
- VLC version: 4.0.0-git
- Operating System: Linux, Windows, Mac
- Location: Cone, France
- Contact:
Re: RTMP with FFMPEG + NGINX Doesn’t play in VLC
Postby Jean-Baptiste Kempf » 15 Feb 2015 16:16
avcodec error: Failed to open rtmp://test.mydomain.hu/live: Input/output error
-
ronag
- New Cone
- Posts: 4
- Joined: 15 Feb 2015 09:32
Re: RTMP with FFMPEG + NGINX Doesn’t play in VLC
Postby ronag » 15 Feb 2015 16:25
Yes, I can see that. But it works fine with ffplay.
Code: Select all
ffplay -i rtmp://test.mydomain.hu/live
ffplay version N-69574-g7dad2f7 Copyright (c) 2003-2015 the FFmpeg developers
built with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
configuration: --prefix=/usr/local --enable-gpl --enable-nonfree --enable-libx264
libavutil 54. 18.100 / 54. 18.100
libavcodec 56. 21.102 / 56. 21.102
libavformat 56. 19.100 / 56. 19.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 9.103 / 5. 9.103
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
[flv @ 0x7fb5b580e400] Stream discovered after head already parsed
[flv @ 0x7fb5b580e400] Stream discovered after head already parsed
Input #0, flv, from 'rtmp://test.mydomain.hu/live':B sq= 0B f=0/0
Metadata:
Server : NGINX RTMP (github.com/arut/nginx-rtmp-module)
displayWidth : 1280
displayHeight : 720
fps : 50
profile :
level :
Duration: 00:00:00.00, start: 2679.722000, bitrate: N/A
Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 63 kb/s
Stream #0:1: Data: none
Stream #0:2: Video: h264 (High), yuv420p, 1280x720, 50 fps, 50 tbr, 1k tbn, 100 tbc
2682.57 A-V: -2.386 fd= 14 aq= 13KB vq= 10KB sq= 0B f=0/0
So I’m wondering what the difference is?
Return to “General VLC media player Troubleshooting”
Who is online
Users browsing this forum: No registered users and 4 guests
Аудио и видео, серия 3: использование nginx для создания локальной потоковой службы
- Предисловие
- Фактическая операция
- Установка модуля nginx + nginx-rtmp
- Настроить приложение nginx rtmp
- Начать потоковую передачу ffmpeg push
- Испытание на растяжение
Предисловие
Аудио и видео серии:
Аудио и видео серия 1: потоковая передача ffmpeg + rtmp
Аудио и видео серия 2: ffmpeg декодирует H.264 в RGB
Друзья, которым интересно, могут посмотреть.
В предыдущем разделе мы использовали ffmpeg, чтобы вытащить видео Mango Channel и преобразовать его в rgb. Однако Mango Channel не работал должным образом, и карта была извлечена, поэтому я не знаю, проблема ли это в моем коде или сервере Mango Channel. Чтобы устранить это Когда возникает проблема, мы создадим локальный сервер nginx в этом разделе, будем использовать ffmpeg для локального push, а затем использовать наш собственный код и проигрыватель VLC для тестирования PK.
Почему вы хотите это сделать, потому что локальная потоковая передача и локальный прием могут гарантировать, что запущенный поток определенно будет плавным, так что если есть проблема с вашим кодом (например, он застрял), вы можете узнать об этом впервые, что эквивалентно устранению проблемы с сервером .
Фактическая операция
Установка модуля nginx + nginx-rtmp
Адрес загрузки nginx: http://nginx.org/en/download.html
Я сам скачал версию Mainline. Скачав и распаковав ее, я найдунастроить исполняемый файл, Подождите, мы будем использовать его для создания файлов Makefile.
Тогда вот описание параметра для компиляции nginx: http://nginx.org/en/docs/configure.html
Загрузка модуля nginx-rtmp: используйте команду git clone напрямую
git clone https://github.com/arut/nginx-rtmp-module.git
Поскольку нам нужно только реализовать потоковую передачу и никаких других модулей и сред не требуется, при компиляции нам нужно только установить nginx-rtmp-module и сертификат openssl.
Сначала посмотрим на openssl, где он находится.
Просмотрите команду openssl location:
which openssl
дисплей:/usr/local/openssl/bin/openssl
Удалите bin / openssl, в каталоге nginx используйте команду configure:
./configure --with-openssl=/usr/local/openssl/ --add-module=nginx-rtmp-module
нота,--with-openssl=
Заполните только что полученный путь openssl и удалите егоbin/openssl
。
--add-module=
заполнитьnginx-rtmp-module
маршрут.
Проблемы, обнаруженные при эксплуатации:
'/usr/local/openssl/.openssl/include/openssl/ssl.h' failed
Говорят, что каталог .openssl / не найден. Измените файл auto / lib / openssl / conf в каталоге nginx на правильный путь.
CORE_INCS="$CORE_INCS $OPENSSL/include"
CORE_DEPS="$CORE_DEPS $OPENSSL/include/openssl/ssl.h"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libssl.a"
CORE_LIBS="$CORE_LIBS $OPENSSL/lib/libcrypto.a"
Запускаем еще раз:
./configure --with-openssl=/usr/local/openssl/ --add-module=nginx-rtmp-module
make -j2
sudo make install
Установка завершена.
Настроить приложение nginx rtmp
sudo vim /usr/local/nginx/conf/nginx.conf
Измените nginx.conf и добавьте приложение rtmp
rtmp {
server {
listen 1935;
chunk_size 4096;
application rtmplive {
live on;
max_connections 1024;
allow publish all; # control access privilege
allow play all; # control access privilege
}
}
}
среди них:
Имя приложения — rtmplive;
Максимальное количество подключений — 1024;
размер отдельных данных chunk_size — 4096;
Порт прослушивания — 1935.
Откройте службу nginx (обратите внимание, что вам нужно использовать sudu, иначе разрешений будет недостаточно)
sudo /usr/local/nginx/sbin/nginx
Ошибка,bind() to 0.0.0.0:80 failed (98: Address already in use)
Причина в том, что nginx был включен, используйтеps -e | grep nginx
Проверьте, запущена ли служба nginx, если да, вы можете сначалаsudo kill -9 номер PID
Затем запустите nginx:
sudo /usr/local/nginx/sbin/nginx
Или вы можете перезагрузить программу nginx:
/usr/local/nginx/sbin/nginx -s reload
Здесь настроен nginx.
Начать потоковую передачу ffmpeg push
ffmpeg -re -i sss.mp4 -c copy -f flv rtmp://localhost:1935/live/rtmplive
Произошла ошибка:
rtmp://localhost:1935/live/mytv: Input/output error
На самом деле адрес неверный.
Приходите снова:
ffmpeg -re -i sss.mp4 -c copy -f flv rtmp://localhost:1935/rtmplive
Локальный толчок завершен.
Испытание на растяжение
Наконец-то пришло время для ПК,VLC плеерс участиемМой код (подробности см. В предыдущем разделе) ПК,Кто одержит победу?
Думаю, мой код победит.
VLC открывает сетевой поток, введитеrtmp://localhost:1935/live/mytv: Input/output error
Мой код также изменил адрес rtmp и включил его.
После получасового тестирования VLC сильно отставал, поэтому я перезапустил потоковую передачу VLC и обнаружил, что она все еще работает медленно.
Два часа спустя код все еще работает, сбоев нет, а скорость все еще выше, чем у VLC, я думаю, это примерно на несколько секунд быстрее.
Результаты теста следующие: левая сторона — мой код, а правая — проигрыватель VLC. Используя дисплей OPENCV, вы можете видеть, что следующая строка была написана слева, а правая часть еще не написана, очевидно, медленнее, чем левая.
Итак, окончательная победа принадлежит мне, хе-хе.
Что ж, этот раздел подошел к концу. Выполните эти основные задачи. Затем я могу изменить код в предыдущем разделе, чтобы он соответствовал последнему API без предупреждения, или представить систему ROS.
Если моя статья была вам полезна, ставьте лайки, комментируйте и подписывайтесь.