Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
330 views
in Technique[技术] by (71.8m points)

How to play decrypted video in vlc from memory using libvlc python

I am using python3 bindings of the libvlc and what I wanted to do is that, I have one encrypted video and when I decrypt it, It store into a variable of type _io.BytesIO in python3 so this variable is in memory now and I want to play this video in vlc without saving it into any file.

My code for decryption the file

enc_file = open("example_enc.mp4.aes","rb")
dec_file = io.BytesIO()

decrypt_my_file(enc_file,dec_file) #This function will decrypt the file enc_file and store it to dec_file

The decrypted file is stored in dec_file, Now I want to play this video into vlc using libvlc python bindings, I have search in the internet and get to know about the libvlc_media_new_callbacks() which allow us to play the video from memory but I am not getting how to use it to play my video.

If I just store the contents of the variable dec_file into a file and run it from vlc, It is running successfully but I don't know how to play it only when it is stored in that variable.

Please help, Any help is appreciated.

question from:https://stackoverflow.com/questions/65883715/how-to-play-decrypted-video-in-vlc-from-memory-using-libvlc-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...