Hello
All Freinds Please Help ME:
I want encrypt & decrypt Video file With FFMPEG oflfine mode in hard disk.
I encrypt a Video File (mp4 Extention) by ffmpeg.exe Tools by this Command:
ffor decryption : i want decrypt and play video file (encrypted.mp4) in my player source c++ (ffmpeg base) and now i dont wnat use decrypt file with command line with ffplay.exe *like this :Code:fmpeg -i SampleVideo_1280x720_1mb.mp4 -vcodec copy -acodec copy -encryption_scheme cenc-aes-ctr -encryption_key 76a6c65c5ea762046bd749a2e632ccbb -encryption_kid a7e61c373e219033c21091fa607bf3b8 SampleVideo_1280x720_1mb_encrypted.mp4
I do not need ffplay.exe because i downloaded FFMPEG dev and i have written my own player program Which is based on FFMPEG! with QT & C++.Code:ffplay SampleVideo_1280x720_1mb_encrypted.mp4 -decryption_key 76a6c65c5ea762046bd749a2e632ccbb
I dont want use ffplay.exe that exist static FFMPEG Folder. .
I want decrypt and play Encrypted File in my player program Through Programing code.
Now how to decrypt encrypted files using FFMPeg API with C++ Programing?
I searched a lot but did not find anything.
I look at ffplay source code it, but I could not understand how it did it.
Call different functions and library .
There is no explanation on how to use it. Frown |
I did not find a sample.. Frown |
thanks in advance.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
Try StreamFab Downloader and download streaming video from Youtube, Netflix, Amazon! Download free trial.
+ Reply to Thread
Results 1 to 3 of 3
Thread
-
-
@dara.alavi
i have written my own player program Which is based on FFMPEG!
Currently, I'm updating the entire Code to 'SDL2' to make the Player even faster.
how to decrypt encrypted files using FFMPeg API with C++ Programing?
I have no Idea about Decryption by Code (yet), because my Player doesn't use it, but maybe this helps You:
see [../libavcodec/avcodec.h] -> AV_PKT_DATA_ENCRYPTION_INFO:
"This side data contains encryption info for how to decrypt the packet.
..., use av_encryption_info_* methods to access."
I look at ffplay source code...Last edited by metis; 17th Feb 2021 at 07:32.
FFmpeg based FFPlay4Laz + FFGrab4Laz - RunFFmpeg. -
@dara.alavi
I did a little Research for You.
Decrypting is Part of FFmpeg's AVOptions, so what You need is av_opt_set().
Should be something like av_opt_set(YourCodecContext, "decryption_key", "YourDecryptionKey", AV_OPT_FLAG_DECODING_PARAM).
(I didn't try it out - Tell me/us, if it works.)
For CodeSamples for 'av_opt_set()', see here:
https://cpp.hotexamples.com/examples/-/-/av_opt_set/cpp-av_opt_set-function-examples.html
BTW: The FFmpeg-Sources for En-/Decryption are in:
[..\libavformat\isom.h], [..\libavformat\crypto.c] and [..\libavformat\mov.c].FFmpeg based FFPlay4Laz + FFGrab4Laz - RunFFmpeg.
Similar Threads
-
Using FFmpeg to encrypt video with DRM
By sampsoninc916 in forum Video Streaming DownloadingReplies: 5Last Post: 14th Nov 2020, 12:13 -
Capturing ffmpeg RAW or Lossless Video & Audio
By TubeBar in forum Video Streaming DownloadingReplies: 3Last Post: 24th May 2018, 02:11 -
Decrypt video?
By ghostrewel in forum Video Streaming DownloadingReplies: 0Last Post: 23rd Feb 2018, 08:14 -
Best Solutions to Encrypt Video?
By pone44 in forum Software PlayingReplies: 8Last Post: 18th Jun 2017, 17:42 -
Scramble/Encrypt/Protect MP4 or other popular types of video?
By gilius2k14 in forum Video ConversionReplies: 2Last Post: 6th Oct 2015, 10:47