Can't play mp4 video in my Android app

后端 未结 3 816
春和景丽
春和景丽 2021-02-04 21:21

I very want to play mp4 video in my android app. I even wrote a bit of code for it:

String sourceUrl = \"http://tvstream.cn.ru/storage/1kanal/20120530/\"
                


        
3条回答
  •  眼角桃花
    2021-02-04 21:39

    Probably your file is using an unsupported profile, notice that official media formats page only lists Baseline Profile as supported for H.264 AVC.

    Try transcoding the video specifying Baseline Profile as suggested in this stackoverflow question, i.e. if your container is MP4 run:

    ffmpeg -i yourfile.mp4 -c:v libx264 -profile:v baseline -level 1 yourfile_BaselineProfile.mp4
    

    If this works it's not a issue in your code, you just have to use supported formats.

提交回复
热议问题