2

我将一些 h264 文件转换为 mp4,现在我想将它们转换回 h264。但我没有找到相关的文档。

谁能给我一个提示?mp4 文件中没有音频部分。我只需要 h264 文件。

这是我用来将 h264 文件转换为 mp4 文件的代码。

                Movie m = new Movie();
                m.addTrack(h264Track);
                Log.v(TAG, "add track to the m");
                File f =new File("/storage/sdcard0/qcom/h264_output.mp4");

                Container out = new DefaultMp4Builder().build(m);
                 Log.v(TAG, "create out");
                try {
                    Log.v(TAG, "fos");
                    FileOutputStream fos = new FileOutputStream(f);
                    Log.v(TAG, "write the mp4 file");
                    FileChannel fc = fos.getChannel();
                    out.writeContainer(fc);
                    fos.close();


                } catch (FileNotFoundException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
4

0 回答 0