3

I have been trying for a while to record an RTSP stream with libVLC in python. I have a basic command that works with cvlc, but I am unable to do the same with libVLC.

Here is the cvlc command:

cvlc -I dummy rtsp://admin@192.168.31.56/0/av0 --sout="#transcode{vcodec=h264,acodec=mp3,vb=500,fps=30.0}:std{mux=mp4,dst=test.mp4,access=file}";

Here is where I am with python:

import vlc

rtsp_server = 'rtsp://admin@192.168.31.56/0/av0'
i = vlc.Instance("--sout=#transcode{vcodec=h264,acodec=mp3,vb=500,fps=30.0}:std{mux=mp4,dst=test.mp4,access=file}")
player = i.media_player_new()
player.set_mrl(rtsp_server)
player = vlc.MediaPlayer(rtsp_server)
player.play()

0 Answers0