mixing live audio + vod to ONE stream...?

Hi everyone,

I’ve searching around this forum, and although I’ve found similar questions, I haven’t found exactly this question so I post it here:

Transmitting audio live from an auction, and have previously uploaded a lots of videos of each product to be sold.

Now I’m transmitting one audio stream and let the client app (flash in a browser) listen to the audio, while selecting the video he want’s to watch.

Want to change this and mix the live audio with the correct product video, so the client only recieve ONE audio/video stream.

I think it’s clear that wowza can’t do this directly (or?), but is there any other way with ffmpeg or similar?

I’ve found similar examples, but don’t know if it’s possible to mix a LIVE stream with VOD videos…

thank you in advance for any hint!

/best

/javier

similar post:

Wowza multiple Live audio with video streaming.

with this soolution:

ffmpeg -itsoffset -5 -i “rtmp://127.0.0.1/live/StreamA.sdp live=1” -i “rtmp://127.0.0.1/live/StreamB.sdp live=1” -vcodec copy -acodec copy -shortest -f flv -map 0:0 -map 1:0 rtmp://127.0.0.1/live/StreamC.sdp

The result of this is a new stream, StreamC which has thevideoof StreamA + theAudioof StreamB. the itsoffset is a parameter you can play with to give your translator some delay.

I’m replying myself, as this could be usefull for someone…

If anyone has something to add, please do.

I’ve successfully mixed one audio stream (live) and one video stream (vod) into one stream (live) with ffmpeg:

The idea is to take a live audio stream, and creating a live stream from VOD through a playlist that is modified from the clientside…

These two is converted to ONE live audio/video stream, that is delivered to the clients.

  1. added support for ModuleStreamControl to wowza (installing WowzaServerAddOnCollection…)

  2. installed ffmpeg on the server

  3. created wowza application “livemix” and added:

streamcontroller

ModuleStreamControl

com.wowza.wms.plugin.collection.module.ModuleStreamControl

  1. creating a stream dynamically from this example: https://www.wowza.com/downloads/forums/collection/client/StreamClassControl.zip

as explained in this article: “How to dynamically control Stream class streams” https://www.wowza.com/docs/how-to-control-stream-class-streams-dynamically-modulestreamcontrol

resulting stream: rtmp://[server]:1935/livemix/video

in my case I add a mp4 located on the wowza server

  1. audio: from a client transmitting with Flash Media Live Encoder audio only (mp3)

resulting stream: rtmp//[server]:1935/livemix/audio

  1. on the server started:

ffmpeg -i “rtmp://127.0.0.1/livemix/video” -i “rtmp://127.0.0.1/livemix/audio” -vcodec copy -acodec copy -shortest -f flv -map 0:0 -map 1:1 rtmp://127.0.0.1/livemix/mix

resulting stream: rtmp://[server]:1935/livemix/mix

this is the final stream that clients should connect to!

Things to investigate:

  • mp4 video + mp3 video resulting rtmp stream works in a flash player

  • what about html5 video tag?

  • ios devices?

  • android?

…to be continued!

best

/j

Javier,

You might also manage this in the RTMP client. You can have multiple NetStreams on one NetConnection, or multiple NetConnections. It might be be better to have multiple NetConnections, and have them connected before ready to start a NetStream.

Richard

Take a look at the Wowza FlashRTMPPlayer examples, in the examples folder that ships with Wowza.

And you might be able to do this with off-the-shelf player like JW Player or Flowplayer. They have a javascript API that could help coordinate playback.

Richard

We fallback on recommending RTSP for Android because of the fragmented feature/version support.

Richard

I just found this thread because i`m having the same issue. Its possible for me to combine the two stream using the following command line

avconv -i "rtsp://stream01.xxxx.nl:80/meerpaaldagen/camera1001large.stream" -i "rtmp://stream01.xxxx.nl:80/meerpaaldagen/audio.stream" -vcodec copy -acodec copy -shortest -f flv -map 0:0 -map 1:1 rtmp://stream01.xxxxx.nl:80/meerpaaldagen/camera1001largeaudio

But when i change the video input to rtmp it is no longer working

avconv version 0.8.6-4:0.8.6-0ubuntu0.12.04.1, Copyright © 2000-2013 the Libav developers

built on Apr 2 2013 17:02:36 with gcc 4.6.3

[flv @ 0x17627a0] negative cts, previous timestamps might be wrong

I want to use RTMP because it seems to better. When i`m using RTSP i get green spot and drops in the video stream

Hi jenciso,

Thanks for giving the helpful information.

For the iOS, following link will help you to upload live stream from iphone to wowza,

http://blog.themidnightcoders.com/index.php/2011/07/07/ios-applications-wowza-media-server-integration-with-rtmp/

Similarly, I also able to upload stream from android as well with rtmp.

But the main problem is in playing the uploaded stream in android, iphone. Like, rtmp is flash and we can successfully able to play rtmp video in above flash player. But most devices of android, iOS are not supporting flash. rtmp is not officially supported in android, iOS, http://developer.android.com/guide/appendix/media-formats.html.

Kindly, share any help you find in this case.

Thanks.

Hi Richard,

Yes, RTSP seems best option for playing the video in android devices.

We successfully able to stream live video from android to wowza with RTMP. And we can also see the live video from the example of FlashRTMPPlayer, it works fine. But the main problem is that then its not possible to view the same video in another android device with RTSP because we are uploading through RTMP.

At wowza, can we re-stream live video from RTMP to RTSP? ffmpeg will be useful for this?

Thanks Rechard, answer of this question will help to many developers.

Bhargav.

We fallback on recommending RTSP for Android because of the fragmented feature/version support.

Richard

Richard,

thank you for your answer.

This seems like chinese for me (and I’m not!) but I’ll google your ideas and will return for more :wink:

thanks again!

/j

Best Richard,

I’ve taken some time to review your answer…

I believe my final goal wasn’t clear in my first post:

I’m currently having a website receiving two separated streams: one live audio stream, and one vod video stream (the client listen to the auction live, and selects witch product video to watch).

While this may not be best practice, it does work with flash in a browser in a common pc.

However on a mobile platform I found several troubles:

-old android have flash / newer android and ios doesn’t

-html5 doesn’t behave exactly the same in all devices

-can’t have two separated

So, the idea was to bring ONE stream, mixing the live audio plus a dynamic playlist of the products, so at least it is possible to listen and watch the correspondent image at the same time.

It seams possible through ffmpeg - tested succesfully, but don’t know if the server runs smoothly with a lot of watchers, or if ffmpeg can run constantly (as a service?), or if there is some memory leaks… or whatever…

Back to your answer:

You might also manage this in the RTMP client. You can have multiple NetStreams on one NetConnection, or multiple NetConnections. It might be be better to have multiple NetConnections, and have them connected before ready to start a NetStream.

Does this solve my first goal?

When you talk about NetStreams and NetConnection, you are assuming I transmit and receive in flash. Correct?

I do transmit with Flash Media Live Encoder, but i want to receive both in flash and in html5

/thanks for any suggestion!

/best regards

/javier

Hi bhargav!

thank you for your post…

It’s not what i was looking for though: I want to stream TO mobile devices (not FROM them).

In the ios/androids without flash we are trying to have a html5 video tag, so it’s not rtmp nor rtsp - we’re using http stream cupertino …

/best

/javier