How to record only audio OR only video from RTMP stream in Red5

184 views
Skip to first unread message

Sneha Patil

unread,
Jan 20, 2015, 3:05:31 AM1/20/15
to red5in...@googlegroups.com
I have a client that publishes RTMP to Red5 server (both audio and video). I want to record only audio OR only video from the published stream. Is there any API in Red5 which allows to record in such a way?

My Red5 vesion is 1.0
And, in 'org.red5.server.api.stream.IBroadcastStream' class, I couldn't find a method which can mute OR drop the video/audio from RTMP stream.

Please Help.

Rajdeep Rath

unread,
Jan 20, 2015, 3:53:18 AM1/20/15
to red5in...@googlegroups.com
To record 

To mute
Use client side Apis to drop mic

To record audio only or video only

Use client side api to drop mic or camera
Or
Record entire stream and use  ffmpeg to extract what you want


Regards
Rajdeep Rath 
--

---
You received this message because you are subscribed to the Google Groups "red5" group.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sneha Patil

unread,
Jan 20, 2015, 5:51:49 AM1/20/15
to red5in...@googlegroups.com
Hi Rajdeep,

Thank you for your reply.

I don't want to mute camera/microphone on client side. Its only for recording purpose that I want to drop either audio or video.

It seems only option is to record everything and then extract required media.

Thanks again.
To unsubscribe from this group and stop receiving emails from it, send an email to red5interest+unsubscribe@googlegroups.com.

Mondain

unread,
Jan 20, 2015, 9:51:33 AM1/20/15
to red5in...@googlegroups.com
You could implement your own RecordingListener and add / remove them from your streams. These listeners would be coded in such a way that they ignore the audio or video when writing the files. The listeners would be added on your command, via your client or some other means by gaining access to the ClientBroadcastStream. Here is the area that you check the data type coming in: https://github.com/Red5/red5-server-common/blob/master/src/main/java/org/red5/server/stream/RecordingListener.java#L247

To unsubscribe from this group and stop receiving emails from it, send an email to red5interest...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Sneha Patil

unread,
Jan 21, 2015, 5:00:35 AM1/21/15
to red5in...@googlegroups.com
Hi Mondain,
That sounds interesting. But, I couldn't find the RecordingListener in Red5 1.0 source code.
Could you please help me pointing such Listener in 1.0?

Thanks,
Sneha.

Sneha Patil

unread,
Jan 21, 2015, 5:04:01 AM1/21/15
to red5in...@googlegroups.com
version 1.0.1

Rajdeep Rath

unread,
Jan 21, 2015, 5:05:32 AM1/21/15
to red5in...@googlegroups.com
 try to use the latest or at least above 1.0.2 for best results 

Sneha Patil

unread,
Jan 21, 2015, 5:08:54 AM1/21/15
to red5in...@googlegroups.com
Yes. But, Its a legacy code. So, I want to implement it with 1.0.1 version only. Is it possible with 1.0.1?

Mondain

unread,
Jan 21, 2015, 8:06:42 AM1/21/15
to red5in...@googlegroups.com
In a pre 1.0.1 version you'd have to write your own impl of ClientBroadcastStream in lieu of implementing the listener stuff yourself. It shouldn't be too difficult to upgrade to the latest stuff to be perfectly honest.

Sneha Patil

unread,
Jan 21, 2015, 8:21:50 AM1/21/15
to red5in...@googlegroups.com
Ok. Thank you Mondain. That will be helpful.

Mondain

unread,
Jan 21, 2015, 9:59:37 AM1/21/15
to red5in...@googlegroups.com
When moving to the newer versions, this page might be helpful to trackdown pesky start up issues https://code.google.com/p/red5/wiki/ServerWontStart

Sneha Patil

unread,
Jan 22, 2015, 3:11:23 AM1/22/15
to red5in...@googlegroups.com
Great. Thanks so much!

Rajdeep Rath

unread,
Jan 23, 2015, 4:44:09 AM1/23/15
to red5in...@googlegroups.com
Hey Sheha, you can try one more thing. If you can trigger ffmpeg (with librtmp) from red5 broadcast start method, you can make it capture the live stream and write a mp3/mp4/Flv what ever you want..on the fly. Thus you will be saving time on post record extraction as this would be similar to live recording with almost a delay of 10 sec.
Reply all
Reply to author
Forward
0 new messages