How to make Red 5 media server stream different formats of files? - streaming

I need to stream both audio and video files from the Red 5 server. By default Red 5 only supports flash, but I need to add support for other file types too.
I need to dynamically (on the run time) transcode the media file in one format to desired formats as per client request. Is it possible ? How to go for it ? I have been reading of vlcj project, but dont know how to integrate them.
If audio / video transcoding is not possible in Red 5, is there any other open source alternative I can look forward to ?
Any help will be really appreciated...
Thanks !

Check out the StreamableFileFactory bean inside your red5-common.xml, to see what kind of files can be streamed by default (flv, mp3, mp4, m4a). If you copy any of these files in your red5 service's streaming directory, it will be able to play it.
If the source you need to stream is in different format (like youtube uploads), then the best way for you to go is ffmpeg.
You build it to your server, then
from inside your red5
service check whether there are any
unsupported files in your streaming
directory (should be a scheduled job), and
if so, use ffmpeg with the proper
parameters to convert the new files
to streamable formats.
that's it.

Related

Download Result of Source Destination (Web Audio API)

I'm building a tool to edit audio with the Web Audio API.
Here is where I'm stuck:
...
source
.connect(gainNode)
.connect(analyser)
.connect(analyser2)
.connect(audioCtx.destination);
};
What I've written (which ends with the code above) successfully allows the user to upload a file, apply effects, and listen to it on play(). How would I then allow the user to click a button to export the results to a WAV file?
I've tried several methods online that have not worked for my use case.
Please let me know if more code is needed. Thank you for taking a look!
If you want a WAV file, I think you have to do that yourself. WAV files are quite simple. In this case, you'll need to add either a ScriptProcessorNode or AudioWorkletNode just before the destination to capture all the audio and convert it to a WAV file that can be downloaded.
If a compressed file is ok, you can look into MediaRecorder to save the data for you.
I ended up solving this by writing an entirely different script to download the file using OfflineAudioContext.
My original script plays the audio with effects, and the second script downloads it with the same effects. Now to figure out why there is latency on the effects while using OfflineAudioContext.

Merge multiple fragments of video and mux it to normal video format

i want to ask if there is any option to just merge multiple fragments downloaded from HBO GO app and mux it to some normal format like mkv or mp4??? Because these fragments has no file type. Some script, program, guide ??? It looks like this
for video: Fragments(video=0), Fragments(video=10000000), Fragments(video=20000000), Fragments(video=30000000), Fragments(video=40000000), Fragments(video=50000000)
...for audio Fragments(audio_eng_st_dub=0), Fragments(audio_eng_st_dub=20201361), Fragments(audio_eng_st_dub=40402721), Fragments(audio_eng_st_dub=60604082)
...for text is simillar.
youtube-dl doesnt support HBO GO direct download so if anybody can help me with it ???
Thank you
They are probably fragmented mp4, You can just concat them with the init fragment and many players can play it.
However HBO use DRM, so you will never be able to play these files.

How to encode files using ID3v2.3?

I am trying to get files ready for Http Live Streaming. I am then trying to embed ID3 metadata into the ts streams so a jwplayer plugin can read the timed metadata.
However, I am pretty sure the plugin only reads id3v2.3 and not id3v2.4 which id3taggenerator creates.
Does anyone know how I can either convert the tags to the older version, or create ones from that and then insert them into the files?
Thanks.

How to programmatically output fragmented mp4 file using libavformat?

I want to use mp4 file format for live streaming, which is not possible with an unfragmented mp4 file, as the moov atom is generally written at the end of the file. I need to generate a fragmented mp4 file to transfer it over a network for live streaming. I am using libavformat. The problem is, I can write unfragmented mp4 files easily with libavformat, but I don't know how to write a fragmented mp4 file. So, how to write a fragmented mp4 file using libavformat?
I don't think you are looking for fragmented mp4 (FYI a fragmented mp4 is usually called .ismv) ISMV requires a media server and specialized client to stream.
I think what you are looking for is faststart. This simply moves the moov atom to the start of the file. ffmpeg comes with a qt-faststart utility that will do this for you. Check you distrobution.
You can use Bento4 library to do this easily. Download from here http://www.bento4.com/downloads/ and use the binary mp4fragment.
mp4fragment sourcefile destinatiofile

Record audio, add effects, then save result to a audio file

I am having trouble doing what the title said. My goal is to be able to add any desired effects to your recording, save the modified audio, then send that to a server.
I have searched the fourms and came across these threads:
viewtopic.php?f=7&t=13029&p=45362&hilit=saving#p45362
viewtopic.php?f=7&t=12660&p=44586&hilit=saving#p44586
viewtopic.php?f=7&t=13178&p=45746&hilit=saving#p45746
After reading those, I see it is possible to save the modified audio, but can it only be saved as a wav? Like I said after it is saved it will be sent to a server, so size is a big deal and wavs are relatively big compared to other formats. Ignoring that fact, I tried to implement FMOD_OUTPUTTYPE_WAVWRITER and I cannot get that to work; are there any good examples of using it? I looked though the examples in the library but I didn't see any..
But the basic structure of the app is to record, turn some switches off and on to see what filters you want, preview it, then press a button "Save" that will save it. What would this save function consist of?
Any help appreciated, thanks.
Using FMOD_OUTPUTTYPE_WAVWRITER is fairly straight forward, you set the type via System::setOutput, specify the output file via System::init extradriverdata. The extradriverdata should be an absolute path to a writable area of the device such as the documents directory. After you have finished playing, call System::release and the file will be complete.
The other option for recording wave data with effects is by creating a custom DSP and connecting it to the channel playing the recorded data. You will then get regular callbacks giving you float data that you must write out to disk yourself. You can find examples of DSPs and writing wav files in the dsp_custom and recordtodisk examples respectively.
Finally note that FMOD doesn't come with the facility to write compressed audio to disk, you will need another API to achieve this goal.
You can save as an AAC file via the ExtAudioFile API.