-
-
Notifications
You must be signed in to change notification settings - Fork 759
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
How to play multiple files with RtspServerFromFile #1487
Comments
Hello, Currently it is not supported. To do that you need stop stream totally and start again with the new video file. Should I develop the way to do it but only supported files with the same configuration? |
For now, you can try join all files in one (you will need find a library for it) and then use the result in the library to stream |
I'm sorry, I didn't take into account the problem of different bitrates, but are files with the same bitrate OK? |
This is a good approach, but it consumes storage space. |
Yes, but this is the only way for now. I will mark this issue as enhancement and develop the way to stream multiples files but only if that files are identical in config (video and audio). The files will require:
I'm not sure if throw a crash in prepareVideo or prepareAudio if you are using different files with different config or just return false in the method. |
Yes, I think it's a better idea.I can't think of any other better solution. Thanks! |
Hello, This feature was added to RootEncoder in the last commit. Usage example:
genericFromFile.setLoopMode(false)
override fun onVideoDecoderFinished() {
genericFromFile.replaceVideoFile(path)
genericFromFile.replaceAudioFile(path)
//resync file to avoid audio and video sync issues (recommended because video or audio could take different time to start)
genericFromFile.reSyncFile()
} |
Hello, |
reSyncFile is optional but I recommend you use it if you can after change the file. val vTime = genericFromFile.getVideoTime()
val aTime = genericFromFile.getAudioTime()
if (abs(vTime - aTime) >= 0.5) { //async by 0.5s
genericFromFile.reSyncFile()
} 0.5 is a random value (in seconds), you should check the values and use a value that adjust to you. |
I have four mp4 files: record1.mp4, record2.mp4, record3.mp4, record4.mp4
Currently I want to implement it, given a fileList=[record1.mp4,record2.mp4]
Use RtspServerFromFile to ignore the first 15 seconds from record1.mp4 and start the output stream. After record1.mp4 has finished playing, continue to record2.mp4.
How should it be implemented and prepareVideo again?
The text was updated successfully, but these errors were encountered: