dburckh / media3avi Goto Github PK
View Code? Open in Web Editor NEWLibrary with improved AVI support for Jetpack Media3 (ExoPlayer)
License: MIT License
Library with improved AVI support for Jetpack Media3 (ExoPlayer)
License: MIT License
I'd suggest using Jitpack to publish the artifact instead of Github repository, as there you don't need credentials and it's quite easy to setup.
Currently playing an MP4V file with B frames stutters because the code uses the default linear clock in VideoStreamHandler. We need to enhance Mp4VStreamHandler to detect the B frames and fix the timing. This would be similar to the PicClock logic in AvcStreamHandler.
Hi, I use this library to play MJPEG stream: http://webcam1.vilhelmina.se/mjpg/video.mjpg but failed.
Log here:
internalError [eventTime=8.78, mediaPos=0.00, window=0, period=0, loadError
androidx.media3.exoplayer.source.UnrecognizedInputFormatException: None of the available extractors (JpegExtractor, FlvExtractor, FlacExtractor, WavExtractor, FragmentedMp4Extractor, Mp4Extractor, AmrExtractor, PsExtractor, OggExtractor, TsExtractor, MatroskaExtractor, AdtsExtractor, Ac3Extractor, Ac4Extractor, AviExtractor, Mp3Extractor, JpegExtractor) could read the stream.
at androidx.media3.exoplayer.source.BundledExtractorsAdapter.init(BundledExtractorsAdapter.java:101)
at androidx.media3.exoplayer.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1018)
at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:414)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
]
I have used JpegExtractor
for MJPEG but not working, MJPEG stream's response header is like Content-Type=[multipart/x-mixed-replace; boundary=myboundary]
that's a multipart response.
Looks like we are missing a MJpegExtractor
to handle this.
The current Clock objects are all based on chunk count. This works perfectly for video as the chunk count is 1:1 with the frames. It also works well with audio streams with a constant chunk size. Unfortunately, for audio streams with variable chunk sizes, it breaks badly.
My current thought is to create a BitrateClock bases on the number of bytes that have passed in the stream. Chunk sizes are available in both base and OpenDML indices. This change would require an update to the SeekMap. My current thought is to store the audio stream time offset from the video time in the SeekMap instead of the audio chunkIndex.
Caused by: androidx.media3.exoplayer.upstream.Loader$UnexpectedLoaderException: Unexpected ArithmeticException: divide by zero
at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:435)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)
Caused by: java.lang.ArithmeticException: divide by zero
at com.homesoft.exo.extractor.avi.ChunkIndex.getChunkSubset(ChunkIndex.java:122)
at com.homesoft.exo.extractor.avi.AudioStreamHandler.setSeekStream(AudioStreamHandler.java:62)
at com.homesoft.exo.extractor.avi.AviExtractor.buildSeekMap(AviExtractor.java:153)
at com.homesoft.exo.extractor.avi.AviExtractor.parseIdx1(AviExtractor.java:337)
at com.homesoft.exo.extractor.avi.AviExtractor$RiffReader.read(AviExtractor.java:567)
at com.homesoft.exo.extractor.avi.AviExtractor.read(AviExtractor.java:406)
at androidx.media3.exoplayer.source.BundledExtractorsAdapter.read(BundledExtractorsAdapter.java:129)
at androidx.media3.exoplayer.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1040)
at androidx.media3.exoplayer.upstream.Loader$LoadTask.run(Loader.java:414)
I added the media3-avi library to my project. It plays most of *.avi files, except one (I attached it to this issue).
When I included source in my project build failed:
main\java\com\homesoft\exo\extractor\avi\BoxReader.java:9: error: package com.homesoft.exo.avi does not exist
import com.homesoft.exo.avi.BuildConfig;
BoxReader.java:68: error: cannot find symbol
if (BuildConfig.DEBUG && position > getEnd()) {
Where do I find this package? Thanks.
info
libavutil 57. 13.100 / 57. 13.100
libavcodec 59. 15.102 / 59. 15.102
libavformat 59. 10.100 / 59. 10.100
libavdevice 59. 1.100 / 59. 1.100
libavfilter 8. 21.100 / 8. 21.100
libswscale 6. 1.102 / 6. 1.102
libswresample 4. 0.100 / 4. 0.100
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from '/storage/emulated/0/BaiduNetdisk/我的资源/深入浅出计算机组成原理《更新中》等多个文件/应用软件开发技术(VB.NET)/30.avi':
Duration: 00:38:27.00, start: 0.000000, bitrate: 93 kb/s
Stream #0:0: Video: mpeg4 (XVID / 0x44495658), yuv420p, 800x600 [SAR 1:1 DAR 4:3], 69 kb/s, 10 fps, 10 tbr, 10 tbn
Stream #0:1: Audio: wmav2 (a[1][0][0] / 0x0161), 22050 Hz, mono, fltp, 19 kb/s
At least one output file must be specified
Is it because wmav2 not supported ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.