Mpeg-dash mpd file through REST request - mpeg-dash

My system requires a live mpeg dash stream,as well as a unique mpd file on each request. I've tried setting up the server with REST and websockets but neither seem to be recognised with dashjs player. Only if I reload the page, loading the mpd file directly (ie not as a response to the request itself).
I'm sure this is because i'm lacking some basic understand of http requests and websockets, but maybe someone can put me in the right direction?

Related

Can I stream a static image feed into a video with Node.js?

I want to create a small PoC where I can stream a static image source into a video. The idea behind that is that I have an (old) IP camera that only serves snapshots on an HTTP endpoint. When calling that endpoint, you get a static JPEG picture. Let's say, the URL I want to "convert" is: http://mycamera.local/live.jpg
Now, I want to create a script using Node.js to quickly call that URL over and over in order to form some sort of video stream. I'm not an expert into media encoding and stuff, but I guess that the variable refresh rate induced by HTTP latency, the camera's FPS... would make it a bit trickier to pipe images into a video response?
I thought I'd go with Express and Axios to serve and query HTTP content. I've also read that FFmpeg could play a role in there. But, I am open to any suggestion. I could even switch languages if that's required. This question is so specific I think, that any response would do.
A couple of requirements I cannot change:
The camera can only serve static pictures on a single endpoint.
I have no other protocol than HTTP on the camera.
I am not buying or modifying the existing hardware, even though I know there are very cheap units out there.
My server must serve a live video that could be streamed by VLC for instance.

Nodejs downloading tar.gz file with HTTP get

im a bit stuck with my project and I'am not finding the right answeres to my questions...
So first of all I have this client that is a linux machine and it pokes my server with curl trying to download this tar.gz file.
On the nodejs server my purpose is to download this tar.gz file from third-party server with HTTP get and pass it to my client. So I have few things that I dont understand.
Firstly: Is the file that i am downloading from the third party server in the http responses body or does the response have a body when downloading a file?
Secondly: I don't want to save the file to my server, so how do I stream it to the clients http response. Is there a fileStreams that i should use or is there just regular streams.
At the moment I'am trying to pipe the third party response to the clients responses body.
I've played around with the server and I've gotten some gibberish to my client. When I "file upload.tar.gz" I get that its data and not gzip. Is this the tar.gz file in different format? Am I doing wrong with the http request or is my stream piping causing this.
I would appreciate if someone could brief me a bit or point me to the right direction! :)

how to host mp3 file with koa framework

I'm coding API server to be used in mp3 app.
I've used koa-send, koa-static, and just setting mp3 file to response-body.
But, no matter what API the app uses, the app stops. When I sent the length of the MP3 file separately because the app did not seem to accept the length of the MP3 file, it worked on iOS but not on Android.
If I post the same MP3 file on S3 and send request to that URL, it worked well, so I can't understand what the problem is.
Also, if I play music on Safari using my API, it comes out as a live broadcast. (using other sites, it comes in the form of mp3)
If it's a problem that you don't know how long it's playing, why is it the same file, but not on other sites, and not on my API?
Other storage site:
My API:

How to play realtime binary stream through client speakers in HTML5

I need help playing a binary stream to a client's speakers using the client's web browser. The stream is being recorded from a client's web browser and is sent to a NodeJS server using BinaryJS. I have successfully streamed the binary data back to the client from the server, but cannot figure out how to play it. I am using NodeJs, BinaryJS, webAudio API, and HTML5. I have also been testing with Firefox. Has anybody done this before? Thanks in advance.
If this is an option for you, the simplest option would be to encode your data to a compressed format (say, mp3, ogg, opus, etc.), and simply put the URL in an <audio> tag.
This pages is a good introduction on how to stream mp3 from node.

Using an audio stream URL with wpaudio or any other such script

I have bunch of audio stream URLs, like this one:
http://popplers5.bandcamp.com/download/track?enc=mp3-128&id=1269403107&stream=1
(which, by the way, are from the incredible bandcamp . com)
I need to know how to use these with audio streaming scripts like the wpaudio plugin (wpaudio . com)
Most of these plugins require a link to an actual mp3 file. As you can see, the URL above is an audio stream, not an actual mp3. How do I put the two together?
If you visit that URL, your browser should start playing the audio stream. I basically need to be able to embed the audio stream into a web page.
Thanks!
You can use mplayer:
mplayer -dumpstream url
Check this page:
http://www.mplayerhq.hu/DOCS/HTML/en/streaming.html
for more information.
If this is not a live stream thing, as it looks like for the above file, you can use a simple wget:
wget "http://popplers5.bandcamp.com/download/track?enc=mp3-128&id=1269403107&stream=1" -O outfile.mp3
Be sure to check copyright/licensing of the content before you do anything with it.
You can use WPaudio or any of the others you want, no problem. There is absolutely no difference between that stream URL you posted, and a random MP3 file served up from somewhere. At least, not from your browser's perspective.
Your browser has no idea, and does not care, how the source server gets its content. It's all HTTP, and the only thing your browser cares about is content type. Here's what that looks like:
Content-Type: audio/mpeg
Same as it would be if you tossed an MP3 up there. No biggie.
Use WPaudio, or any other web MP3 player. They all will work fine.

Resources