Exoplayer can't play mpegts streams transmitted by ffmpeg properly ... demuxing problem?
@tonihei is already working on this.
Since Jan 27, 2025.
- Dominant language
- Java
- Stars
- 3k
- Forks
- 955
- Avg merge
- 12d 14h
- Merged PRs (30d)
- 2
Description
Version
Media3 release branch
More version details
1.5.1
Also tested 1.6.-alpha01 and main (@25Jan25)
Devices that reproduce the issue
- RK3399 running Android 10
- Samsung Galaxy S23+ running Android 14
Devices that do not reproduce the issue
Nil
Reproducible in the demo app?
Yes
Reproduction steps
(Reproduced in own application but also in Demo app with a few extra lines of code added to allow a UdpDataSource and specify TsExtractorFlags);
Transmit an mp4 file (I used bigbunny) across nw as follows:
ffmpeg -re -stream_loop -1 -i c:/temp/bb_1080p60.mp4 -c:v copy -c:a copy -f mpegts -flush_packets 0 "udp://239.100.0.3:1234?pkt_size=1316"
(used both ffmpeg 6.1 and 7.1)
Play the stream in app using media uri of udp://239.100.0.3:1234
Expected result
Video should play smoothly. Audio should play smoothly.
Actual result
Video stops and starts with long pauses. Audio likewise, and the times when audio plays does not coincide when the video plays either. All indications are it's not demuxing the video reliably from the packet stream.
However, if you stream out the file using VLC instead of ffmpeg (selecting transport udp with no transcode) it works fine. Have been unable to determine what's different between the two streams - ffprobe reports same info on each. ffplay works fine too.
No errors logged in logcat during the pauses.
Media
Problem is really not media specific, but use this file:
https://download.blender.org/demo/movies/BBB/bbb_sunflower_1080p_60fps_normal.mp4.zip
Bug Report
- You will email the zip file produced by
adb bugreportto android-media-github@google.com after filing this issue.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.