Coder Social home page Coder Social logo

Comments (5)

tanersener avatar tanersener commented on July 20, 2024 1

You can also look at the Https tab of Android test application under the ffmpeg-kit-test project. It has an example for getting MediaInformation from session using an ExecuteCallback.

from ffmpeg-kit.

VivekThummar52 avatar VivekThummar52 commented on July 20, 2024 1

It Worked, Thank you very much for your help and effort, you always helped me and never disappointed!!

from ffmpeg-kit.

tanersener avatar tanersener commented on July 20, 2024

Could you be more specific please? I don't understand what is this issue about.

from ffmpeg-kit.

VivekThummar52 avatar VivekThummar52 commented on July 20, 2024

Let me explain, in older version i'm using given code for getting audio file information such as audio/video bitrate, format, sample rate, etc..

        GetMediaInformationCallback mediaInformationCallback = mediaInformation -> {
            if (mediaInformation != null && mediaInformation.getStreams() != null) {
                if (mediaInformation.getFormat() != null) {
                    txt_infoFormat.setText(mediaInformation.getFormat());
                }

                for (StreamInformation stream : mediaInformation.getStreams()) {
                    if (stream.getBitrate() != null) {
                        txt_infoBitrate.setText("" + stream.getBitrate() + "kbps");
                    } else {
                        if (txt_infoBitrate != null) {
                            txt_infoBitrate.setText("-");
                        }
                    }
                    if (stream.getChannelLayout() != null) {
                        txt_infoChannel.setText(stream.getChannelLayout());
                    }
                    if (stream.getSampleRate() != null) {
                        txt_infoFrequency.setText("" + stream.getSampleRate() + "Hz");
                    }
                }
            }
        };

        AsyncGetMediaInformationTask asyncGetMediaInformationTask = new AsyncGetMediaInformationTask(mediaInformationCallback);
        asyncGetMediaInformationTask.execute(audioLocation);

But in this repo i can't find similar to this methods, i searched for my requirement but i just found the same but it is for execution time, what i want is suppose i have different activity where i shows output file's info, which i converted using ffmpeg, by clicking on file i display pop-up and show above given file infos by given code..

from ffmpeg-kit.

tanersener avatar tanersener commented on July 20, 2024

In FFmpegKit, sessions created by running FFprobeKit.getMediaInformation encapsulate MediaInformation object. Because of that, you no longer need a separate callback named GetMediaInformationCallback. You can set an ExecuteCallback and get MediaInformation from the session using ((MediaInformationSession) session).getMediaInformation().

It is still possible to use AsyncGetMediaInformationTask if you prefer to do so. But again, to get the MediaInformation you need to use the session created.

from ffmpeg-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.