-
Notifications
You must be signed in to change notification settings - Fork 6k
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
H.264/MP2T over HTTP #90
Comments
@juanpef FrameworkSampleSource doesn't support live streaming. For HLS see the example at https://github.com/google/ExoPlayer/blob/dev-hls/demo/src/main/java/com/google/android/exoplayer/demo/full/player/HlsRendererBuilder.java#L91 |
But I don't use HLS. I use h264 over HTTP. It would be the same use that the example? In that case, where can I fix the url? Thanks for your answer |
You're probably using a container format that isn't supported? See the "video" section of "core media formats" here: http://developer.android.com/guide/appendix/media-formats.html |
No, because I play thne content with a simple VideoView without any problem. |
I have played my content with a VideoView until now without problem. But now, with Exoplayer, I can't. We don’t use HLS, we stream the video as a H.264/MP2T over HTTP without any segmentation and I want to play it using Exoplayer. Is possible that this have not been implented yet? Thanks |
Tha url that we use is like http://server-ip:4022/rtp/239.0.0.77:8208 |
@juanpef if you just want to play a single standalone MPEG2TS file, then this is not supported. What you can do to work around:
IMHO, MPEG2TS is probably not the right container format to use for stand alone video files. |
@andudo Thanks four your answer. I am using this code: LoadControl loadControl = new DefaultLoadControl(new BufferPool(BUFFER_SEGMENT_SIZE)); With this other method: private HlsMasterPlaylist newSimpleMasterPlaylist(String mediaPlaylistUrl) { And it does not work. |
@juanpef newSimpleMasterPlaylist() is for the case where you only have a single media playlist URL and want to create a dummy master with it to reuse the same processing logic. |
@andudo, thanks for your answer. And in my case in which I just want to play one URL? Would it not be more easy without any playlist? |
@juanpef in your case with a single MPEG2TS file you can create a single media playlist and use the code you wrote above. without any playlist you'd also need to implement a ChunkSource for it, which shouldn't be hard. |
Lack of support for "video/mp2t" is a very significant omission for ExoPlayer. This means MPEG-TS is not supported. |
Could I use TsChunk.java for my purpose? In that case how can use it? Thanks |
This should be an out of the box feature. |
|
@ojw28 wheni was writing my comment, i asked my selfe the same question. But to answer your question, h264 streaming over http/udp is one of the most used cases. Nearly every surveillance system i came across was using h264 over http. For the test-case: |
Ideally just a test URL, that works, without us having to spend any time setting one up ourselves. |
One other question - Am I correct in thinking that you shouldn't expect seeking to work for this use case (since there's no index, either in the form of an external manifest or in the media stream itself)? |
We pushed a bunch of changes that should make this quite straightforward to do. But we're not going to prioritize the work without someone providing a test stream. If no-one is able to do so, then that really indicates that this feature isn't in significant demand. |
ojw28 i am ready to setup a wowza test-streaming for 30days, would this be ok? |
Just to check: This really is over HTTP and not RTSP right? If so then yes, if you set something up we'll take a look (no promises, since you never know what you'll find when you start trying to build something!). |
@ojw28 would it be easier, when i create a plain UDP connection? But then this would be a point-to-point connection and you need to pass me an ip. Where is the depacketization process in exoplayer happening? |
We have a UDP data source already as it happens. We'll push it to GitHub in the next week or so. I'm not sure whether it makes this easier or not. I suspect you really want RTSP, which we're not supporting. |
UDP is much more important for me then RTSP right now. Any Chance getting the UDP Data source before friday? I can test it as well before it goes to master and give some feedback. |
A UdpDataSource is now in dev. |
Thank you for the early package! Somehow i am getting an Exception "Unexpected Exception loading stream" What i did:
And i can see the stream it in other players like MxPlayer on my mobile device. |
|
|
I'm trying to play an MPEG2TS over HTTP stream (I added an entry with my video stream to the Demo app and it's played as DefaultUriDataSource). It starts playing but very often gets stuck with the same error:
|
Try buffering for 2 to 3 sec twice before playing and allow the buffer to
|
Increasing buffer time didn't help. Investigating further I can see that it looks like TS packets synchronisation problem. For some reason TsExtractor sometimes gets a broken TS packet (with wrong length != 188) and all the following packets are shifted. So it keeps getting packets that aren't starting with SYNC_BYTE (0x47) and ignore them. Sometimes it can by chance receive a packet that's still broken but starting with 0x47 and this can lead to the exception above. I'm not sure who's to blame, maybe it's even a server side problem, but anyway I'll try to add a resync procedure that will restore normal flow of packets (skipping only 1 or 2 of them). |
On the server side, if FFMPEG is being used to stream TS packets on UDP, add the following parameters: This will ensure that a TS packet is not spread across 2 UDP packets and a UDP packet loss doesn't trigger the TSExtractor to get an incomplete TS packet and go out of sync. (note that 1316 is a multiple of the TS packet size-188) On the client side the fix by algrid works. |
@ojw28 Do you have a demo for mpeg2ts over UDP (test case for UdpDataSource)? |
Closing due to staleness. We do not have a demo for mpeg2ts over UDP. Our handling of UDP is very much a "best effort", as opposed to being a primary use case that we support. |
I have the next code:
It works with a closed file like http://html5demos.com/assets/dizzy.mp4 but it does not work with a live streaming. What is the problem???
The text was updated successfully, but these errors were encountered: