findWithinHorizo​​n

findWithinHorizo​​n

我想从视频文件中获取音频比特率并将其保存。
是否可以使用ffmpeg从视频文件中单独获取音轨比特率?
如果可能的话该怎么做?...任何建议将不胜感激。

最佳答案

也许这会帮助您:

    @Override
    public void onProgress(String message) {

        Log.e("ryeure", "onProgress: ");


        String findWithinHorizon = new Scanner(message).findWithinHorizon(Pattern.compile(".?fltp,\\s([0-9]*)\\skb/s"), 0);

        Log.e("ryeure", "onProgress: findwithinhorizon---" + findWithinHorizon);


        if (findWithinHorizon != null) {
            String intValue = findWithinHorizon.replaceAll("[^0-9]", "");

            result_audioBitrate = Integer.parseInt(intValue) * 1000;
        }

    }

    @Override
    public void onFailure(String message) {

        Log.e("ryeure", "onFailure: onfailure--" + result_audioBitrate);


        audio_origin_bitrate.setText("Origin bitrate : " + result_audioBitrate + " kb/s");
        audio_new_bitrate.setText("New bitrate : " + result_audioBitrate + " kb/s");
    }

关于android - 如何在Android中从视频文件中分离音频流比特率?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/58946807/

10-13 04:54