unable to transfer .ts file from hls - webcam

I'm using Raspberry Pi4 and webcam to deliver real-time video on the web.
unknownpgr/node-webcam-streaming: nodejs(with ffempg) webcam live streaming server/client (github.com)
I'm using a clone of the file that this person wrote, but if the .ts file exceeds a certain number (10), it's no longer created, and Chrome doesn't send the .ts file.Only m3u8 is transmitted, so it is streamed for about 1 minute and 30 seconds, and after that, it is not streamed.
I don't know why...
I'd appreciate your help.

Related

make it impossible to download the audio files

So guys, how do I prevent users from downloading audio files on my web app (running springboot in backend) by accessing the s3 url !
I want to make it impossible to download the audio files in my website ! Any suggestions pls ?
I assume you mean that you want to make it impossible to download the audio files, but still allow streaming them for playback.
You can't.
If it can be played, it can be downloaded. Simple as that.
At best, you can sign your S3 URLs so that they expire after a short period of time. This gives you control over who accesses your audio files, and prevents them from showing up in searches, or linked to from other sites. You can also look into Encrypted Media Extensions, but it's not all that useful for audio since audio is trivially digitally captured on the output.

How to play live FLV stream?

I am capturing video from webcam in my PC and in the fly convert it to FLV (using ffmpeg).
As a result I have a continuously growing .FLV file.
And now I would like to play it as a live stream.
I was trying VLC but it plays the file no longer than the duration read from file on initialization.
What player can I use for live playing FLV?
I am working on Ubuntu 16.04.
Thank you in advance for your answers!
You cannot play live FLV directly but there is a tricky protocol popular among Chinese live streaming platform called "http-flv" that would play live flv within http framework.
Why http-flv?
Latency for HLS / Dash is long. It is about 10 to 20+ seconds.
Http-flv reduces end-to-end the latency to ~5 seconds. It could be played on browsers with MSE support.
How it works?
FLV is a simple container that "supports" file-based progressive streaming because one could get partial byte range in a flv video and still play it ( for mp4, you would need meta like moov etc for playback. )
For file server, host a growing flv file and remove the HTTP response header "content length" so that when client request the file, it does not know the response body size. It would keep the connection and receive videos segments until connection ends.
On client side, use flv.js to fetch only the latest segments for a flv file and perform the playback.
A lot of other tricks that would make the pipeline work.
There are a lot of source online you could play around with. Here are some references:
https://github.com/Bilibili/flv.js/
https://github.com/winshining/nginx-http-flv-module
A blog about how to achieve this: https://www.yanxurui.cc/posts/server/2017-11-25-http-flv/

Why so many partial content requests in Firefox when streaming mp4 video on Apache?

Edit: Turns out this is actually a Firefox bug.
I have several videos on my Apache 2.2 server encoded with ffmpeg using -movflags faststart and they stream fine. However seeking past the buffer line takes an extraordinary amount of time with Firefox (about 30 seconds or more to buffer) whereas Chrome has no problem at all.
Chrome shows one network request for the mp4 with partial content, but Firefox always shows hundreds of 206 partial content requests in succession when playing the mp4 (open for detail):
Most interesting is how there is one large request after all the small ones. This is the point where the video actually begins playing, and it transferred 26MB out of 1.3MB? I am not sure what is going on here.
Can anyone make sense of this? Compare what I am getting in output to this mp4 file here. It doesn't happen on that file.

All the examples of WebRTC are video chat, is it possible to send any type of video over WebRTC?

So I want to be able to send a normal video from a video file (AVI or any other) through WebRTC, can that be done? The only examples I see of WebRTC are video chats, so I feel as if its only geared towards webcam and chats.
So my question is, technically can sending normal video from a video file (not webcam) over WebRTC be done?
Try: "Pre-recorded media streaming" --- Documentation and Source Code.
This experiment uses MediaSource API to render Blobs in <video> element. This experiment has some issues need to be fixed e.g. it can't send longer WebM videos.
You can try this experiment as well.
The codecs typically used in AVI are not directly supported by WebRTC clients, but if you are writing your own standalone client then of course it could read an AVI or other video file and transcode it to VP8 video and Opus audio (or whatever other codecs you were able to negotiate), and transmit it via RTP. If you are trying to do video transcoding in JavaScript in a browser then that will be very slow.

Progressive download and streaming of video content using Amazon S3

Does Amazon S3 support progressive download? I just want my videos start playing before its fully loaded.
I don't need real streaming yet.
Yes it does is the simple answer.
You'll need to encode your videos in a format that supports playback before the entire file is downloaded and your video player will need to support that too. But those requirements are no different from any other file server.