pedroSG94 / vlc-example-streamplayer

Example code how to play a stream with VLC
GNU General Public License v3.0
229 stars 93 forks source link

Get current playing content media info #23

Open Dayananda opened 5 years ago

Dayananda commented 5 years ago

Hey,

How to get media info such as codec, fps, resolution, bitrate? I tried player.getCurrentVideoTrack(). but no result. I am getting only codec info. rest all set to zero.

Please tell me how to get those information

pedroSG94 commented 5 years ago

Hi, Video info is setted by developer in prepareVideo method. Where you can select fps, resolution, bitrate, etc. Before that any parameters is setted to Video encoder. If you are using preapreVideo without params, this is default values setted: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/rtplibrary/src/main/java/com/pedro/rtplibrary/base/Camera1Base.java#L218 Same in audio. If you want know more info about codec like name you can use method used by library to get your encoders and get info about it with MediaCodecInfo with this method: https://github.com/pedroSG94/rtmp-rtsp-stream-client-java/blob/master/encoder/src/main/java/com/pedro/encoder/video/VideoEncoder.java#L505

Where:

On Tue, Dec 11, 2018 at 12:40 PM Dayananda notifications@github.com wrote:

Hey,

How to get media info such as codec, fps, resolution, bitrate? I tried player.getCurrentVideoTrack(). but no result. I am getting only codec info. rest all set to zero.

Please tell me how to get those information

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/pedroSG94/vlc-example-streamplayer/issues/23, or mute the thread https://github.com/notifications/unsubscribe-auth/AQvljIw14NyL1YKdMGdrSSlhqFnREgy9ks5u35mzgaJpZM4ZNOjQ .