0

I want to download a m3u8 hls video on android. i am using this https://github.com/WritingMinds/ffmpeg-android-java github project. my code run perfect with some file like this

#EXTM3U
#EXT-X-VERSION:5
#EXT-X-STREAM-INF:BANDWIDTH=560000,RESOLUTION=560x320
chunklist_w1370359847_b560000.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=280000,RESOLUTION=280x160
chunklist_w1370359847_b280000.m3u8

but when i want to get some others like

#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=307200
http://example.com/hls.m3u8?mwk=8337411690192241322178516954798640895&s=67456834233263474843895996561490854813
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=3584000
http://example.com/hls.m3u8?mwk=8337411690192241322178516954798640895&s=67917168793981422148373769951238010028
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=2457600
http://example.com/hls.m3u8?mwk=8337411690192241322178516954798640895&s=58718242671779879146351545392642701787
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=1228800
http://example.com/hls.m3u8?mwk=8337411690192241322178516954798640895&s=76033982771160137261725364336240341356
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=614400
http://example.com/hls.m3u8?mwk=8337411690192241322178516954798640895&s=8799167971211576392205612488036401876
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=65536
http://example.com/hls.m3u8?mwk=8337411690192241322178516954798640895&s=84365905843905491151101581870671639752

, i received Protocol not found error. my url is http and i use bellow command

String.format("-i %s -acodec %s -bsf:a aac_adtstoasc -vcodec %s %s", mM3u8Url, "copy", "copy", dir.toString() + "/" + mContentId + ".mp4");
M.Movaffagh
  • 1,284
  • 5
  • 20
  • 33

1 Answers1

0

Maybe your m3u8 is encrypt.Could you find "#EXT-X-KEY:METHOD=AES-128" in your m3u8 which mean you need decode it.

fabelYu
  • 41
  • 1
  • No absolutely there is no problem with encryption because i can play it with VLC Player – M.Movaffagh Jul 13 '17 at 17:35
  • Because VLC can automatic decryption m3u8. I meat the same error,because the m3u8 was encypted by AES-128. First,you need make sure,whether is encypted,try to find "#EXT-X-KEY:" Then,find a way to decode. – fabelYu Jul 14 '17 at 04:18