Question / Help rtmp exec push not working from encoder to stream server

robertkwild

New Member
hi all,

so i have configured my rtmp server on ubuntu 18 and it works perfect for applications such as OBS and playing back local mp4's via vlc

but im struggling getting it to play back my encoder

i have this in my nginx.conf section

# RTMP stream using exec push
application live {
live on;
record off;
exec ffmpeg -i rtmp://localhost/live/$name -threads 1 -c:v libx264 -profile:v baseline -b:v 350K -s 640x360 -f flv -c:a aac -ac 1 -strict -2 -b:a 56k rtmp://localhost/live360p/$name;
}
application live360p {
live on;
record off;
}

but its not working

have you any ideas why

ps - on my encoder box, when i do a test its all good (see pic)

thanks,
rob
 

Attachments

  • stream.PNG
    stream.PNG
    20.4 KB · Views: 65

robertkwild

New Member
i have ffmpeg

root@lon-p-rtmp02:~# ffmpeg -version
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.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-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --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-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
 

robertkwild

New Member
smashed it!!!!!!!!!


it was just a matter of upgrading the firmware on my encoding box


and now the stream is flawless via vlc


this is my config in nginx.conf


application live { live on; record off; exec /usr/bin/ffmpeg -i rtmp://localhost/live/$name -threads 1 -c:v libx264 -profile:v baseline -b:v 512K -s 640x360 -f flv -c:a aac -ac 1 -strict -2 -b:a 64k rtmp://localhost/hls/$name; }

application hls {
live on;
interleave on;
sync 300ms;
hls on;
hls_path /tmp/hls;
hls_fragment 15s;


}


as you can see ive changed the video/audio bitrate and resolution


and i have added a few hls options in there


but tbh i dont really understand all the option?
 

vapeahoy

Member
FFmpeg parameters and how they're configured will differ pending on what platform you're on and application level. The wiki and such as pretty good for ffmpeg. Some settings are named entirely different, it becomes a matter of simply trying them out and reading output. I gave up on rtmp for linux as a live streaming solution because staying current was simply too much of a hassle and broke things.
For nginx the options remain the same regardless.

Not sure i see the need for having a 360p stream, are you severly bandwidth limited? Or is this some raspberry pi solution? Just curious.
What i did was to setup different bathces for starting nginx, so 1 offline and 1 live, so can test things without needing to output to anywhere else then local. You can do that by simply having several nginx configuration files and then calling them as u see fit.
 
Top