Skip to content

Reading technical details with ffmpegFrameGrabber #1900

@Tengyyy

Description

@Tengyyy

I have found the methods that return technical information about media to be a bit inconsistent.
Firstly, the getVideoCodecName() method always returns null, but getVideoCodec() returns an int. How can I get the codec name as a string like it is in the console output:
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn
I'm talking about the h264 (High) string.

Secondly, the getVideoBitrate() and getAudioBitrate() methods work on mp4 and mp3 files, but not on some others. I have also noticed that these methods return a correct value when the bitrate also gets exposed on the stream line in the console output.

This is part of a console output from an flv file:
Duration: 00:24:19.53, start: 0.037000, bitrate: 451 kb/s
Stream #0:0: Video: h264 (High), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn
Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s

As you can see Stream #0.0 (video stream) does not show a bitrate and calling getVideoBitrate() will return 0.
Stream#0.1 (audio stream) does show a bitrate here of 128kb/s and calling getAudioBitrate() will work as intended.
However the first line shows a bitrate of 451kb/s. So how can I get access to that value?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions