Unable to read get right video streaming values when using Python VLC C-Type bindings

This forum is about all development around libVLC.
sanoop
New Cone
New Cone
Posts: 1
Joined: 09 Aug 2017 07:29

Unable to read get right video streaming values when using Python VLC C-Type bindings

Postby sanoop » 09 Aug 2017 07:34

I am trying to achieve following.

1) I have an apple HLS media server installed in remote server
2) On another server I am using Python VLC as my client and trying to do a video streaming.
3) Streaming works fine. But while streaming I am not able to get media values like "Bit rate", "frame rate (fps)", get_stats etc. It is returning zero/wrong values.

Any help will be appreciated. I am sharing the code below.

Code: Select all

def videoStream(mediaDir): Instance = vlc.Instance("--no-video") player = Instance.media_player_new() #URL=("https://192.168.106.16/mediaContent/" + mediaDir + "/mediaFilePlaylist.m3u8") URL=("http://192.168.106.16/mediaContent/" + mediaDir + "/sample.mp4") #media = Instance.media_new('http://192.168.106.16/mediaContent/media-1/mediaFilePlaylist.m3u8') media = Instance.media_new(URL) media.get_mrl() player.set_media(media) player.play() time.sleep(10) status=player.is_playing() while status==1: print('State: %s' % player.get_state()) #print('media: %s' % bytes_to_str(media.get_mrl())) #print('Current time: %s/%s' % (player.get_time(), media.get_duration())) print('Rate: %s' % player.get_rate()) print('FPS: %s' % player.get_fps()) #print('Video Statistics: %s' % media.get_stats()) #print player.get_position() #print player.get_time() #print media.get_stats(vlc.mediaStats) time.sleep(5)
Output

Code: Select all

State: State.Playing Rate: 1.0 FPS: 0.0

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Unable to read get right video streaming values when using Python VLC C-Type bindings

Postby Jean-Baptiste Kempf » 09 Aug 2017 17:39

I am not sure this is supported for HLS.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 7 guests