I need to make this chain: JVC HM650--UDP-->localhost-->ffmpeg(copy stream)-->nginx-rtmp
On input I have UDP stream from camera (udp://@:35501) and I need it to publish to rtmp server (nginx with rtmp module). Apart everything works - I can play input on VLC, I can stream from FMLE to nginx etc. Except, this is my first time with ffmpeg and I can't get it work. So:
This is best i have got:
C:\ffmpeg\bin>ffmpeg -re -i udp://@:35501 -f flv "rtmp://192.168.1.17/live/live" -loglevel debug
ffmpeg version N-69972-g6c91afe Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.9.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnu
tls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-
libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-l
ibrtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --
enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --ena
ble-libxvid --enable-lzma --enable-decklink --enable-zlib
libavutil 54. 19.100 / 54. 19.100
libavcodec 56. 25.100 / 56. 25.100
libavformat 56. 23.100 / 56. 23.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 11.100 / 5. 11.100
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 '-re' ... matched as option 're' (read input at native frame rate) with argument '1'.
Reading option '-i' ... matched as input file with argument 'udp://@:35501'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'.
Reading option 'rtmp://192.168.1.17/live/live' ... matched as output file.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file udp://@:35501.
Applying option re (read input at native frame rate) with argument 1.
Successfully parsed a group of options.
Opening an input file: udp://@:35501.
[udp @ 0000000002c30760] end receive buffer size reported is 65536
[AVIOContext @ 0000000002c513c0] Statistics: 0 bytes read, 0 seeks
udp://@:35501: Immediate exit requested
Received signal 2: terminating.
C:\ffmpeg\bin>
What is wrong with ffmpeg configuration?
SOLUTION:
The ffmpeg
was listening on wrong version of UDP protocol:
Even IPv6 is disabled on network cards, internally in system, using @
allowed ffmpeg listen at UDPv6.
By using 127.0.0.1
tells ffmpeg to use clean UDP.
Thanks, @thomas to make me think differently!