How to publish a movie from FFmpeg to MonaServer

1,737 views
Skip to first unread message

Thomas Jammet

unread,
Mar 1, 2015, 6:22:45 AM3/1/15
to monas...@googlegroups.com



As FFmpeg support RTMP it's easier than Gstreamer to publish a video to MonaServer (see How to publish live stream from Gstreamer to MonaServer).

Here is a sample of an FFmpeg command with the well known Big Buck Bunny video, it publishes the stream to MonaServer with the name "movie" :

ffmpeg -re -i big_buck_bunny_480p_surround-fix.avi -ar 22050 -ab 56k -acodec mp3 -r 25 -f flv -b:v 400k -s 640x480 "rtmp://127.0.0.1/movie"

Then if you want to see the result just play the movie at the RTMP address (rtmp://127.0.0.1/movie) or the RTMFP address (rtmfp://127.0.0.1/movie), you can use our VideoPlayer sample.

Obviously you can change the FFmpeg parameters to fit your needs.

EDIT: In some build of FFmpeg (with librtmp) you will need to publish to an existing application , so :
 - create a directory in www (say "MonaClients")
 - and run the following ffmpeg command :
ffmpeg -re -i big_buck_bunny_480p_surround-fix.avi -ar 22050 -ab 56k -acodec mp3 -r 25 -f flv -b:v 400k -s 640x480 "rtmp://127.0.0.1/MonaClients/movie"


yuanjing...@gmail.com

unread,
Mar 25, 2015, 2:39:15 AM3/25/15
to monas...@googlegroups.com
hi
I published stream with RTMP, and i could see the video with RTMFP. but could not use P2P, Did I need some Settings ?

在 2015年3月1日星期日 UTC+8下午7:22:45,Thomas Jammet写道:



As FFmpeg support RTMP it's easier than Gstreamer to publish a video to MonaServer (see How to publish live stream from Gstreamer to MonaServer).

Here is a sample of a FFmpeg command with the well known Big Buck Bunny video, it publish the stream to MonaServer with the name "movie" :

Thomas Jammet

unread,
Apr 8, 2015, 10:34:54 AM4/8/15
to yuan jingjing, monas...@googlegroups.com

Hi Yuan,

So in theory what you want is not possible, you need to publish into a RTMFP Netgroup to do P2P multicast.

If you are interested we can talk about alternatives in private,

Thanks you for your interest.

--
You received this message because you are subscribed to the Google Groups "MonaServer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to monaserver+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/monaserver/a6ecd604-a3a1-43c0-9fc7-30d49af169ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

huang...@gmail.com

unread,
Jun 13, 2015, 11:39:39 AM6/13/15
to monas...@googlegroups.com, yuanjing...@gmail.com
Hi Thomas,

We are very interested in this topic. Can we have a chat?

Thanks a  lot,
Sean

Sergey Zakharov

unread,
Jan 10, 2017, 8:30:59 AM1/10/17
to MonaServer
Hi,

can I publish several movies to MonaServer simultaneously and manage it like clients (onConnection, onDisconnect) with help of ffmpeg?

Thomas Jammet

unread,
Jan 21, 2017, 8:43:47 AM1/21/17
to MonaServer
Hi Sergey,

Sorry I do not understand your request. You can publish as many movies as you want, you just have to change the name of the stream in ffmpeg command.

If you want to close a client whenever you want you can build a function like this one (the parameter is the peer ID) :
   
    function client:closeClient(id)
        INFO
("Trying to close client ", id)
       
local cli = clients[id]    
       
if cli then
            cli
.writer:close()
           
return "done"
       
else
            error
("Unable to find the client")
       
end
   
end

And then you can call it from where you want. Is it what you need?

I hope it will help you,

Regards
Reply all
Reply to author
Forward
0 new messages