Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QT & FFMPEG encrypt & decrypt Video offline



  • 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:

    ffmpeg -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
    

    for 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 :

    ffplay SampleVideo_1280x720_1mb_encrypted.mp4 -decryption_key
    76a6c65c5ea762046bd749a2e632ccbb
    

    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++.
    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.
    There is no explanation on how to use it. Frown | :(
    I did not find a sample.. Frown | :(

    thanks in advance.


  • Lifetime Qt Champion

    Hi
    Could you not look at ffplay source code and see how it does ?



  • Since the encryption and decryption are purely by FFMPEG API and have nothing to do with Qt, I think it should be more efficient to ask that in some FFMPEG-related forums.



  • @mrjj said in QT & FFMPEG encrypt & decrypt Video offline:

    Hi
    Could you not look at ffplay source code and see how it does ?

    Hi mate.
    I saw it, but I could not understand how it did it.
    Call different functions and library .

    @Bonnie said in QT & FFMPEG encrypt & decrypt Video offline:

    Since the encryption and decryption are purely by FFMPEG API and have nothing to do with Qt, I think it should be more efficient to ask that in some FFMPEG-related forums.

    so can you tell use Why Qt support FFMPEG For Media Engine ? like this
    [link text]https://doc.qt.io/archives/qtextended4.4/ffmpeg.html(link url)
    Such a situation can happen to any library that works with Qt!
    Both are open source, both based on C ++
    There is no barrier when a project can be created with these conditions.
    And if you understand the essence of the question, you can write the relevant program in the GUI interface.

    Good luck..



  • @Dara-Alavi
    It's a very old archived documentation. There's no Qt Extended anymore.
    Anyway, if you insist, good luck with that then :)



  • @Bonnie said in QT & FFMPEG encrypt & decrypt Video offline:

    It's a very old archived documentation. There's no Qt Extended anymore.
    Anyway, if you insist, good luck with that then :)

    It may be an old document, but it still works! FFMPEG & QT they does not get old, I insist on solving my problems, not running away from them. Good luck you too.


  • Lifetime Qt Champion

    Hi,

    As shown in that example, you usually wrap the C API to integrate it with your C++ code.

    Like the engine you saw in that old example, you have to implement a class that will encapsulate the calls to the ffmpeg API.

    Follow the logic of the ffmpeg application and implement the various steps in your class.


Log in to reply