Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is possible to add chunks instead entire file? #7

Open
publicocean0 opened this issue Jun 3, 2017 · 6 comments
Open

is possible to add chunks instead entire file? #7

publicocean0 opened this issue Jun 3, 2017 · 6 comments

Comments

@publicocean0
Copy link

how to pass chunks to fmpeg ?

@duanyao
Copy link
Owner

duanyao commented Jun 5, 2017

What is the concrete use case?

FFmpeg supports "concat:" protocol, which plays multiple URLs in sequence. Maybe codecbox.js can handle it if "concat:" protocol is enabled (not tried yet). However it seems the list of URLs has to be specified on start (i.e. not on the fly).

If each chunk is playable on its own, I think it is also possible to do a concatenated playback with multiple CodecBoxDecoder instances. If not, I also have a hard time to figure out how to handle it. FFmpeg supports HTTP Live Stream, but I still have no idea how to enable HTTP in emscripten.

@publicocean0
Copy link
Author

publicocean0 commented Jun 5, 2017

no, chunks are parts of a single long video. I think the challenge it here. Because video/audio for his nature a stream not blob. In many real case to load a video as blob can create a crash of a mobile browser for out of memory. This feature will permit to solve all problems about incompatibility for browsers.
I developped a player using mse (html5 tecnology using chunks) . Really there are many other making the same thing. First at all shaka player. It works in all browsers except safari and ie. My idea was do developer the MediaSource object in js using ffmpeg. In this way in all browsers will be possible to work in the same way in any context (dash or hls or other custom solutions). it will be the end of a hell for developers.
Anyway i want help you for understanding if we can receive a help from ffmpeg team for a free support for doing it.

it i understood correctly you use a specific function of the ffmpeg library for passing the entire file.
and you receive frames.
we have to find another function in the decoder for passing little chunks instead of file.

@duanyao
Copy link
Owner

duanyao commented Jun 5, 2017

I think we need to replace the http component of ffmpeg with a wrapper of XHR, and HLS should work.

@publicocean0
Copy link
Author

publicocean0 commented Jun 5, 2017

I realized for a my internal project a generic javascript prototype class for receiving stream, either with ajax , either with file from local , either with websocket ... or other data source. It would be a generic solution for developers.
i can also pass the implementation of this prototype for local file. Eventually we can implement version for ajax , it is the most used in a server, but the abstraction permits to working also for other dat source. I used it for testing my works before to use in a server. I can release this code freely if can be usefull for realizing a good and generic solution for all

@duanyao
Copy link
Owner

duanyao commented Jun 6, 2017

FFmpeg's IO is synchronous for both local files and network, as oppose to most IO APIs of the Web platform. Asynchronous APIs can not be a drop-in replacement of synchronous ones, so non-trivial part of FFmpeg's IO modules have to be rewritten(in C/C++) to adapt the Web platform. This is why this still has not happened (it is definitely doable, through). Blob is OK because there is a FileReaderSync, but synchronous XHR can only handle text data.

@publicocean0
Copy link
Author

uffff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants