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

Play TS file that is not completed #123

Open
fegauthier opened this issue Apr 11, 2023 · 8 comments
Open

Play TS file that is not completed #123

fegauthier opened this issue Apr 11, 2023 · 8 comments

Comments

@fegauthier
Copy link
Contributor

Hi!

I have an issue with ExoPlayer and maybe you guys know how to fix this.

My app currently record a stream to a file using FFmpeg. Let's say that the file is named Test.ts. The file is located to the internal storage of the device.

I'm using this player to play Test.ts during the record by FFmpeg. So let's say I start the playback when the file has 3 minutes of playback. The video stop after 3 minutes even if the file is now 6 minutes duration. Is there a config to keep playing the file even if at start the duration was 3?

It seems to work with VLC for Android, so I think it can be possible with ExoPlayer?

Thanks!

@fegauthier
Copy link
Contributor Author

google/ExoPlayer#2095

@jepiqueau
Copy link
Collaborator

@fegauthier may be you can try the recommandation from the Exoplayer developer and make a PR tohave it implemented in the plugin

@fegauthier
Copy link
Contributor Author

fegauthier commented Apr 12, 2023

@fegauthier may be you can try the recommandation from the Exoplayer developer and make a PR tohave it implemented in the plugin

I created a CustomDataSource from FileDataSource and every 10 seconds, I read the file to see if the length is greater. If yes, then I add the remainingBytes. It seems to work well. I will test it for a couple hours and surely do a PR for that :P

Thanks!

@jepiqueau
Copy link
Collaborator

@fegauthier Good. This datasource will be used only for ts file for the others movie types i assume the plugin will use the others datasources

@jepiqueau
Copy link
Collaborator

@fegauthier What is the extension for TS files? Does the iOS video player read them?

@fegauthier
Copy link
Contributor Author

I will probably add a flag in the initPlayer like inProgressStream. Which will use the CustomDataSource. Because this situation is not sticked to .TS files but every files that you can read while another process is currently writing it.

TS is for MPEG-TS. The extension file is .ts. I'm sure that iOS video player can read it. It's an old video format.

@jepiqueau
Copy link
Collaborator

@fegauthier i had a quick look in iOS AVplayer does not read the .ts file what i found is that you must put them in a m3u8 playlist , so this conversion may be done on a server-side or in your app and you can continue adding to the playlist even if you start reading. In that case it may work on all platform as an hlsvideo type.I do not know where you stand on your side.
So i do not think i will support this type of format.
Waiting your answer and i will close this.

@fegauthier
Copy link
Contributor Author

@fegauthier i had a quick look in iOS AVplayer does not read the .ts file what i found is that you must put them in a m3u8 playlist , so this conversion may be done on a server-side or in your app and you can continue adding to the playlist even if you start reading. In that case it may work on all platform as an hlsvideo type.I do not know where you stand on your side. So i do not think i will support this type of format. Waiting your answer and i will close this.

I don't know how it works on the Apple side because I don't use it. ExoPlayer support this type of behavior with CustomDataSource, but there's another limitation... We cannot seek the file while it's growing... I didn't find any solution at this time. On my side, I'm using ExoPlayer to read file directly (mkv, ts, mp4, etc.). I'm not using it for with hls

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