[FFmpeg-user] Please streaming over nginx
Moritz Barsnick
barsnick at gmx.net
Wed Aug 7 15:22:58 EEST 2019
On Wed, Aug 07, 2019 at 15:50:32 +0700, Phat Nguyentan wrote:
> Hi Moritz Barsnick,
> Thank you so much to help me. Please check this link:
> https://drive.google.com/open?id=1KpIVkt9WA0O2CDU3E9BjuSxPhcik8gto
A friendly hint: Instead of creating 12 MB of videos, you could have
just copied the text from the console (after the demonstration) and
pasted it into the email, or into text documents to attach. It makes
it much easier for everyone to look at it.
> Clip 1> Run ffmpeg on ubuntu and nginx server on ubuntu:
> - command: ffmpeg -loglevel verbose -re -i /dev/video0 -vcodec libx264
> -acodec libmp3lame -ar 44100 -ac 1 -f flv rtmp://192.168.1.11:1935/hls/movie
> - result: move-01.ts (and movie.m3u8 later),
Understood. This is how we expect it to work.
> Clip 2> Run ffmpeg on openwrt:
> - command: ffmpeg -loglevel verbose -re -i /dev/video0 -vcodec libx264
> -acodec libmp3lame -ar 44100 -ac 1 -f flv rtmp://192.168.1.11:1935/hls/movie
> - result: Unknown encoder 'libx264'
Which is pretty obvious.
> - command: ffmpeg -loglevel verbose -re -i /dev/video0 -acodec libmp3lame
> -ar 44100 -ac 1 -f flv rtmp://192.168.1.11:1935/hls/movie
> - result: working ( but nginx can not create move-01.ts and movie.m3u8
> later).
Here, ffmpeg uses the "flv1" codec. Apparently, nginx has a problem
with that. Doesn't nginx have any log messages? /vog/log/httpd/ or
/var/log/apache/ or /var/log/nginx/? If it can't produce output from an
input, it should complain somewhere.
This documentation page:
https://github.com/arut/nginx-rtmp-module/wiki/Getting-started-with-nginx-rtmp#publishing-with-ffmpeg
says:
RTMP supports only a limited number of codecs. The most popular
RTMP video codecs are H264, Sorenson-H263 (aka flv) and audio
codecs AAC, MP3, Nellymoser, Speex. If your video is encoded with
these codecs (the most common pair is H264/AAC) then you do not
need any conversion. Otherwise you need to convert video to one of
supported codecs.
According to that, openwrt's ffmpeg encode to "flv1" should be just
fine! You could try "-vcodec h263" instead, but that's not quite flv,
IIUC.
Furthermore, you will notice another issue: ffmpeg on openwrt/mylinkit
encodes your 640x480 video with 30 fps at a rate of ~5 fps (0.158x).
That is *much* too slow for streaming. I assume the openwrt processor
(is this a router? a settop box?) is just not capable of encoding any
reasonable video. Sometimes, encoding can be tweaked to be faster
(while less efficient), but I don't see where we can gain a factor of
6. (I don't know the FLV1 flags - in x264, we can get it relatively
fast with a profile.)
> Please help me.
Good luck,
Moritz
More information about the ffmpeg-user
mailing list