Android videoView gives me Alert “Sorry,This video cannot be played”?

后端 未结 4 1103
难免孤独
难免孤独 2020-12-21 16:02
My Code::

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        VideoView vi         


        
4条回答
  •  粉色の甜心
    2020-12-21 16:39

    To expand further on my comment, I had fought a lot with different encodings/formats/etc until I got the one that worked on all android devices (at least all that I tested). Using ffmpeg, here's what finally worked:

    /usr/bin/ffmpeg -i inputfile.ext -y -s 320x240 -vcodec libx264 -vpre medium -vpre baseline -acodec libfaac output.mp4
    

提交回复
热议问题