google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.74k stars 6.03k forks source link

com.google.android.exoplayer2.source.UnrecognizedInputFormatException with MP4 stream #8506

Closed maverick-sahil closed 3 years ago

maverick-sahil commented 3 years ago

Trying to play mp4 stream from url https://stage.example.com/api/media/play/med-cf7e41bf-4698-1234-xxxx-9b2f1?type=video/mp4 using media using ProgressiveMediaSource but getting

com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (MatroskaExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, Ac3Extractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor, AmrExtractor, Ac4Extractor, FlacExtractor) could read the stream.

If I try using HlsMediaSource getting

com.google.android.exoplayer2.source.UnrecognizedInputFormatException: Input does not start with the #EXTM3U header.

What should be the appropriate MediaSource here?

maverick-sahil commented 3 years ago

I was able to successfully test my stream on https://www.radiantmediaplayer.com/test-your-streaming-url.html but its not working in exoplayer

Screen Shot 2021-01-26 at 3 27 35 PM

marcbaechinger commented 3 years ago

Is the url https://stage.example.com/api/media/play/med-cf7e41bf-4698-1234-xxxx-9b2f1?type=video/mp4 what you wanted to post? stage.example.com doesn't seem to be a resolvable host name.

Please provide us with a url to the stream you are trying to play, so we can test with your content.

maverick-sahil commented 3 years ago

https://jiomeetstage.jiomeet.com/api/media/play/med-a2a5a11e-b798-4f55-bc83-bd213f5c7594?type=video/mp4

Update: Its working now after adding custom header defaultRequestProperties.set("Range", "bytes=0-") to DefaultHttpDataSourceFactory

marcbaechinger commented 3 years ago

Ok, glad it works. Not sure why you need to add a range header. I can not really help. When trying with the URL above I get a HTTP/200 with a json file saying it is actually a 404. The web player above can't play they file either, saying "This content is currently not available".

I'm closing this issue. Please re-open if you want to look me into this again and you think the URL should work.

curl --verbose "https://jiomeetstage.jiomeet.com/api/media/play/med-a2a5a11e-b798-4f55-bc83-bd213f5c7594?type=video/mp4"

< HTTP/1.1 200 OK
< Server: nginx
< Date: Wed, 27 Jan 2021 08:49:31 GMT
< Content-Type: application/json; charset=utf-8
< Content-Length: 66
< Connection: keep-alive
< Vary: Accept-Encoding
< X-Frame-Options: SAMEORIGIN
< Strict-Transport-Security:: max-age=31536000
< X-Frame-Options: sameorigin
< X-Request-Id: ddd414b4002fdc7935a93ca89d5979ec
< X-Response-Time: 0.004
< X-Frame-Options: SAMEORIGIN
< X-Request-Start: 1611737371.078
< X-Content-Type-Options: nosniff
< Strict-Transport-Security: max-age=31536000; includeSubDomains
< 
* Connection #0 to host jiomeetstage.jiomeet.com left intact
{"customCode":400,"message":"NOTFOUND","errors":"Media Not Found"}