Javacv: Constant unnecessary logging

Created on 3 Mar 2019  路  1Comment  路  Source: bytedeco/javacv

I keep getting this output:

Input #0, mpegts, from 'java.io.BufferedInputStream@3e34ace1':
  Duration: N/A, start: 8688.015000, bitrate: N/A
  Program 1 
    Stream #0:0[0x100]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz, stereo, fltp, 147 kb/s
    Stream #0:1[0x101]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, unknown/bt470bg/unknown, progressive), 1280x720, 59.94 tbr, 90k tbn, 2k tbc
    Stream #0:2[0x102]: Data: timed_id3 (ID3  / 0x20334449)
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol
Invalid return value 0 for stream protocol

from the code below:

public static ArrayList<BufferedImage> tsConverterToBufferedImageArray(String urlString) {
        var images = new ArrayList<BufferedImage>();
        FFmpegFrameGrabber grabber = null;
        InputStream inputStream = null;
        try {
            var converter = new Java2DFrameConverter();
            var url = new URL(urlString);
            var urlConnection = url.openConnection();
            inputStream = urlConnection.getInputStream();
            grabber = new FFmpegFrameGrabber(inputStream);
            grabber.start();
            var i = 0;
            Frame frame = null;
            while (null != (frame = grabber.grabImage())) {
                if (i == 0 || i == 29 || i == 59 || i == 89 || i == 119) {
                    var image = converter.convert(frame);
                    var copyImage = deepCopy(image);
                    if (copyImage == null) {
                        continue;
                    }
                    images.add(copyImage);
                }
                i++;
            }
            grabber.stop();
        } catch (IOException e) {
            System.out.println(e.getMessage());
            e.printStackTrace();
        } finally {
            try {
                grabber.close();
                inputStream.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return images;
    }

And I am unsure how to turn off that logging, or what would be the best way to avoid those from being printed out. Not sure. Thanks in advance.

Edit: There doesn't seem to be anything going on wrong that would indicate any issues either just FYI this is all working as expected, and well.

question

Most helpful comment

I had been searching on this for awhile now, like weeks in between just ignoring the excessive logs in the meantime while working on larger portions of my application. But while waiting and still searching right now, I did actually find the solution here.

https://stackoverflow.com/questions/18295717/making-ffmpeg-javacv-less-verbose-in-java

av_log_set_level(AV_LOG_PANIC);

Success :)

>All comments

I had been searching on this for awhile now, like weeks in between just ignoring the excessive logs in the meantime while working on larger portions of my application. But while waiting and still searching right now, I did actually find the solution here.

https://stackoverflow.com/questions/18295717/making-ffmpeg-javacv-less-verbose-in-java

av_log_set_level(AV_LOG_PANIC);

Success :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

newstarbka picture newstarbka  路  5Comments

Bahramudin picture Bahramudin  路  3Comments

The-Crocop picture The-Crocop  路  5Comments

SenudaJayalath picture SenudaJayalath  路  3Comments

myScoopAndroidCamera picture myScoopAndroidCamera  路  4Comments