【问题标题】:“only position independent executables (PIE) are supported”“仅支持与位置无关的可执行文件 (PIE)”
【发布时间】:2015-08-17 04:32:30
【问题描述】:

我正在使用 FFMPEG 支持库将一堆图像转换为视频。它适用于早期版本的棒棒糖。但是在棒棒糖中它会产生以下错误。 ***error: only position independent executables (PIE) are supported.*** 我知道棒棒糖中的 PIE 安全限制已更改,但我不知道如何修复它。

据我所知,它可能有两种可能的解决方案,

任何一个

我们需要将 FFMPEG 库资产重新定位到 SDCard,并且我们必须从我们的编码中引用它们,如果这是答案,那么要遵循的所有步骤是什么?

Android lollipop 的 FFMPEG 库中是否有任何更新。

如果两者都错了,你能给我提供正确的解决方案吗?

非常感谢...

这是我的代码

   try {
            String[] ffmpegCommand = {"/data/data/com.mobvcasting.mjpegffmpeg/ffmpeg", "-r", ""+p.getPreviewFrameRate(), "-b", "1000000", "-vcodec", "mjpeg", "-i", 
                    Environment.getExternalStorageDirectory().getPath() + "/req_images/frame_%05d.jpg", Environment.getExternalStorageDirectory().getPath() + "/req_images/video.mov"};

            ffmpegProcess = new ProcessBuilder(ffmpegCommand).redirectErrorStream(true).start();            

            OutputStream ffmpegOutStream = ffmpegProcess.getOutputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(ffmpegProcess.getInputStream()));

            String line;

            Log.v(LOGTAG,"***Starting FFMPEG***");
            while ((line = reader.readLine()) != null)
            {
                Log.v(LOGTAG,"***"+line+"***");
            }
            Log.v(LOGTAG,"***Ending FFMPEG***");


        } catch (IOException e) {
            e.printStackTrace();
        }

        if (ffmpegProcess != null) {
            ffmpegProcess.destroy();        
        }

【问题讨论】:

    标签: android ffmpeg


    【解决方案1】:

    您不需要 ffmpeg “更新”。 PIE 是一个编译时间设置。您可以使用 PIE 选项集自己编译它。

    CFLAGS="-fPIE -pie"

    在此处查看更多信息: https://github.com/danielkop/android-ffmpeg/commit/616a099151fb6be05b559adc4c9ed95afacd92c2

    【讨论】:

    • 谢谢萨特玛丽。你的意思是,我必须使用 NDK 编译 FFMPEG?
    猜你喜欢
    • 1970-01-01
    • 2014-09-09
    • 2015-04-19
    • 1970-01-01
    • 2015-01-17
    • 2015-08-10
    • 2020-05-03
    • 2019-02-23
    • 1970-01-01
    相关资源
    最近更新 更多