通过 ffmpeg“即时”解密在 vlc 中播放加密电影

问题描述 投票:0回答:3

我想在 macOS 上通过 ffmpeg 解密来播放 vlc 中的加密电影,如下所示。 我的电影大小是 200-1000MB。 (数百个文件)

我的问题是解密太慢; 300MB 的电影需要 5 分钟才能开始播放。 我的猜测是ffmpeg首先解密300MB的全部内容,然后VLC播放它。 我的问题:是否可以在解密时“即时”播放电影? (一旦解密就播放解密的块,不要等到整部电影都被解密后再播放,这样它就开始播放,比如延迟 10 秒。)


ffmpeg -decryption_key 0 -i "movie.locked.mp4" -f matroska | /Applications/VLC.app/Contents/MacOS/VLC - --fullscreen --quiet --play-and-exit

非常感谢! 祝你有美好的一天!

macos encryption ffmpeg vlc on-the-fly
3个回答
0
投票
I don't think the pipe to vlc is the problem. I use a small
utility to decrypt videos and also send it with the pipe 
method to vlc and the video starts after a few seconds.

You can download it (source included) from:

http://onlib.de/pub/pfv/pfv.zip

or execute the batch code at the end of this posting to generate
the executable pfv.exe.

There is also a demo file:

http://onlib.de/pub/pfv/demo.pfv  (33 MByte)

with a few small encrypted videos embedded. 

--------------------------------------------------------------

Privacy For Videos (aes256 encryption for videos)

This utility can be use to display encrypted videos in
combination with the VLC media player:

usage: pfv.exe number : password1 : password2 : inputfile >outputfile

password is a 43 character string with the characters A-Z a-z 0-9 / +
Any other character is ignored. If less characters are provided, the
string is padded with +. Therefore you should not use a password which
ends with a +, because, for example, the two passwords "abc" and "abc++++"
are both extended to "abc++++++++++++++++++++++++++++++++++++++++"
and therefore "abc++++" is not more secure than "abc". The binary
256 bit key for aes is generated by base64 decoding the given 43
character password.

To encrypt a video file "video1.mp4" with the password "hello world"
(note: the space in the password is ignored, so "helloworld" or
"hello_world" would be the same), use:

pfv.exe :: hello world : video1.mp4 >video1.pfv

The file size of the output file is increased to a multiple
of 1 MByte.

Note: if you repeat this command, you will get a different
binary, but it still is a valid encrypted version of the video.


To decrypt this encrypted video use:

pfv.exe : hello world :: video1.pfv >video2.mp4

video1.mp4 and video2.mp4 are then identical files.


To directly play an encrypted video use:

pfv.exe : hello world :: video1.pfv | C:\path_to_vlc\vlc.exe -


To re-encrypt a video with a different password without first
decrypting it (no decrypted version of the video is temporarily
stored on the disk), use:

pfv.exe : old password : new password : inputfile > outputfile


If you have more encrypted videos, for example:

video1.pfv (encrypted with password "pass1")
video2.pfv (encrypted with password "pass1")
video3.pfv (encrypted with password "pass2")
video4.pfv (encrypted with password "pass1")

you can copy them all into one big file (but there
is a 4 GByte limit for FAT filesystems):

copy /b video1.pfv + video2.pfv + video3.pfv + video4.pfv all.pfv

To play vidoe1 use:
pfv.exe : pass1 :: all.pfv | C:\path_to_vlc\vlc.exe -

To play vidoe2 use:
pfv.exe 2 : pass1 :: all.pfv | C:\path_to_vlc\vlc.exe -

To play vidoe3 use:
pfv.exe : pass2 :: all.pfv | C:\path_to_vlc\vlc.exe -

To play vidoe4 use:
pfv.exe 3 : pass1 :: all.pfv | C:\path_to_vlc\vlc.exe -

The number specifies which of the videos encrypted with 
the given password should be decrypted. If the number
is 0 or omitted, 1 is used (video4 is the 3. video 
encrypted with pass1 in the input file).

If you use ">outfile" instead of "|vlc -" you can 
extract the video from the multi-video file (encrypted
or unencrypted depending on a given second password).

The program is pretty slow, but a standard PC should be
be able to decode at least Full HD videos.



If you put this batch on your desktop,

@echo off
set /p p=Password: 
set p=&cls&pfv :%p%::%1|C:\path_to_vlc\vlc.exe -

you can use the mouse to drop a encrypted video on it.
It then asks for the password and plays the video.


If you use multi video files, use this batch:

@echo off
set /p p=Number:Password: 
set p=&cls&pfv %p%::%1|D:\Programme\vlc\vlc.exe -

In this case you must enter the number and password
separated by a ":", for example: 3:mypassword

--------------------------------------------------------------------

The demo file demo.pfv contains 3 videos and a zip file:

video 1:  a cat video
          password "only cats no dogs"
video 2:  a qr code video 
          password "hack me if you can"
video 3:  a picture slide show video 
          password again "only cats no dogs"
zip file: a zip file with some original pictures of the slide show
          password  "who cares"

to play video 1 use:
pfv :only cats no dogs::demo.pfv| C:\path_to_vlc\vlc.exe -

to play video 2 use:
pfv :hack me if you can::demo.pfv| C:\path_to_vlc\vlc.exe -

to play video 3 use:
pfv 2:only cats no dogs::demo.pfv| C:\path_to_vlc\vlc.exe -

to extract the zip file use:
pfv :who cares::demo.pfv > cats.zip

If you decode the qr code video, you will get a zip file
with some pictures. The password for the pictures is:
"The quick brown fox jump"

--------------------------------------------------------------------

Here the binary of pfv.exe (just execute the batch below to
generate the binary):


@echo off
certutil -f -decode %~f0 pfv.exe>nul
goto :eof

-----BEGIN CERTIFICATE-----
TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi
b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgaGlzIHByb2dyYW0gcmVx
dWlyZXMgV2luMzIuDQokAFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwADAAA
AAAAAAAAAAD6EAAAABAAAAAwAQAAAEAAABAAAAACAAAEAAAAAAAAAAQAAAAAAAAA
ADABAAACAAAAAAAAAwAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA
JBAAACgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAkAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALnRleHQAAAAAEQEAABAAAAAMAAAAAgAA
AAAAAAAAAAAAAAAAIAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCEAAAlBAAAKIQAACyEAAA
wBAAANQQAADgEAAA7BAAAAAAAABaEAAAAAAAAAAAAABMEAAAABAAAAAAAAAAAAA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CBAAL0EAAAA
uQQAAADBwAis1+L5UE118LkEAAAAid9Yq+L8wwsGAQwHAg0IAw4JBA8KBQADBgkM
DwIFCAsOAQQHCg0Aiz2wGkAAuQQAAABRizWYIEAAuQQAAADB4wi9AwAAAKyKFC/o
MAAAADDDTXny4uiJH4PHBFni1MMCAQEDAwIBAQEDAgEBAQMCDgkNCwsOCQ0NCw4J
CQ0LDiX/AAAAdB6B4v8AAAB0FoqAlB9AAAKClB9AAIPQAIqAlB5AAMMxwMMAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
-----END CERTIFICATE-----


0
投票

肯定没有病毒,我也没有 下载 zip 文件时收到警告。

压缩包内容为:

    3.584 pfv.exe             binary of the program 
   45.525 pfv.mac             source code
    9.486 readme.txt          text posted above
  167.704 windela.c           source code of the assembler
  205.582 windela.txt         documentation of the 486 assemnler (German)
  160.597 windela_e.txt       documentation of the 486 assemnler (English)
  121.856 windela32.exe       binary of the assembler

我现在也将源代码复制为服务器上的文本文件: http://onlib.de/pub/pfv/pfv.mac.txt

你也可以通过上面的方式生成二进制pfv.exe 发布批处理程序。

汇编程序 (windela.*) 仅在您需要时才需要 更改源代码并组装它。


0
投票

无法下载 pfv.zip,因为 windows 防御者检测到它是恶意的。制作pfv.exe 来自 certutil 命令是可能的,但 pfv.exe 是 立即被Windows Defender删除。

很奇怪。在这里 Windows 防御者没有 抱怨,因为在 exe文件是由汇编程序源代码“手工制作”的 代码(甚至是 exe 头)也没有任何东西 投诉。

这个pfv.exe是用assenmber做的吗?我可以 问你为什么?

几年前我写了一个小工具来加密 单个文件:

http://onlib.de/pub/assembler/aes32.zip

我使用汇编程序因为我想要一个小文件 大小,因为它是最好的语言 了解 AES 加密的细节。

现在我知道了,VLC 视频播放器可以读取 来自 stdin 的视频所以我做了一个小修改 到这个程序,所以现在它有点快,而且 可以在一个文件中存储多个视频。

也可以将它移植到 macOS,如 原来的问题? (汇编代码必须是 非常依赖于机器架构,而你的 代码可能无法在 macOS 上运行。)

应该有很多免费的 C 实现 AES算法。如果您不需要该功能 将更多视频存储在一个文件中,然后您拥有的一切 改变是,不写入输出文件,而是 到标准输出。

pfv.mac.txt 似乎是 macOS 的代码。

不,“.mac”只是对 我使用的第一个汇编程序,PDP11 中的一个。

我怎样才能汇编代码?非常感谢!

它不适用于 Apple,它是 Intel 386 代码。

© www.soinside.com 2019 - 2024. All rights reserved.