Using libav to create h264/mpegts stream to RTMP Server

1,083 views
Skip to first unread message

roxlu

unread,
Jul 22, 2012, 6:41:46 PM7/22/12
to c-rtmp...@googlegroups.com
I'm working on a proof of concept where I use libav to encode raw RGB24 frames into a
H264 video and stream it using mpegts to RTMP Server. I've got the bare bones of the 
application working but it needs some more work.

Before reinventing the wheel I was wondering if others might have used a similar approach
to provide RTMP server with a video stream? I found that quite a lot of people have been 
doing/wanting to do "webcam" to "rtmpserver".

Anyone who might be interested and willing to discuss/share, please reply.

Diederick

bgpl

unread,
Jul 22, 2012, 7:33:36 PM7/22/12
to c-rtmp...@googlegroups.com

I've recently done jpeg to h264, streaming using mpegts to RTMP server. I used gstreamer (and had a ffmpeg pipeline going as well, which for some reason didnt work so well for me in terms of startup latency - but I didnt spend much time debugging). I think it should be pretty easy to adapt to an input of raw RGB24 frames.

There seem to be numerous sites on the web providing gstreamer pipelines. For example:

http://www.pieroland.net/bytes/index.php?option=com_content&view=article&id=34:gstreamer-common-commands&catid=16:various-commands&Itemid=27


ximagesrc ! videoscale ! video/x-raw-rgb,width=1280,height=720,name=capsfilter0 ! ffmpegcolorspace ! x264enc threads=2 tune=zerolatency intra-refresh=false speed-preset=ultrafast bitrate=4000 name=x264 \
mpegtsmux name=tsMux \
x264. ! tsMux. \
tsMux. ! queue ! udpblocker ! udpsink host=\"192.168.0.10\" port=3244 async=false name=udpsinker

I think you could replace all the way upto (but not including) ffmpegcolorspace and provide your inputs. Your output sink would be the port where crtmpserver is listening on udp. (I set it up in the config file as port 10000 on localhost).

Anyway, that's what I did, and it worked fine. Hope it helps in some way.

Diederick Huijbers

unread,
Jul 23, 2012, 7:22:01 AM7/23/12
to c-rtmp...@googlegroups.com
Hi bgpl, 

Thanks a lot for the info.

I'm using the libav c-library to get that working. If someone has done this before
and would like to share, please do :-)

Best

任也

unread,
Aug 6, 2012, 12:32:30 PM8/6/12
to c-rtmp...@googlegroups.com

acceptor inboundUdpTs or inboundTcpTs , then set a localstreamname to the acceptor

在 2012-8-7 上午12:29,"Vishal Desai" <desaiv...@gmail.com>写道:
Can you guys help me? How did you use mpegts to send data to RTMP Server.

thanks,
vishal

You received this message because you are subscribed to "C++ RTMP Server" mailing list.
To post to this group, send email to c-rtmp...@googlegroups.com
To unsubscribe from this group, send email to
c-rtmp-serve...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/c-rtmp-server?hl=en

Vishal Desai

unread,
Aug 6, 2012, 12:36:40 PM8/6/12
to c-rtmp...@googlegroups.com
Do you think I should be able to get data from camcorder attached to the laptop.

How about also get from cell phone camcorder to RTMP?

thanks,
vishal

任也

unread,
Aug 6, 2012, 12:41:37 PM8/6/12
to c-rtmp...@googlegroups.com

you need a codec software

Vishal Desai

unread,
Aug 6, 2012, 12:42:26 PM8/6/12
to c-rtmp...@googlegroups.com
which codec software..?

thanks,
vishal

任也

unread,
Aug 6, 2012, 12:45:41 PM8/6/12
to c-rtmp...@googlegroups.com

you need to transform data from camera to digital data, you can try ffmpeg.

Vishal Desai

unread,
Aug 6, 2012, 12:47:44 PM8/6/12
to c-rtmp...@googlegroups.com
using digital data, can I use ffmpeg to send data to rtmp server url.

thanks,
vishal

任也

unread,
Aug 6, 2012, 12:52:35 PM8/6/12
to c-rtmp...@googlegroups.com

no, read crtmpserver.lua carefully, send to the port rtmpd listening. i will go to sleep, just have a try and good luck

Reply all
Reply to author
Forward
0 new messages