-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can i play encrypted .mp4 files generated by ffmpeg ? #2139
Comments
If it's encrypted with If you want to do actual DRM and hide the keys from the end user, then you'll need to contact Widevine/Microsoft/Apple about running a Widevine/PlayReady/FairPlay license server. Does this answer your question? |
Hi , thank you for your quick response , yes i don't need a license server and i have tried the drm configuration. when i try to play my video i get the following error message |
I was able to reproduce your results with ffmpeg 4.1.3. I tried re-encoding audio & video, I tried audio-only, I tried video-only, and I tried with flags to output fragmented mp4. I got it to work with Shaka Packager for encryption, and playing back through a DASH manifest: packager \
input=SampleVideo_1280x720_1mb.mp4,stream=video,output=video.mp4 \
input=SampleVideo_1280x720_1mb.mp4,stream=audio,output=audio.mp4 \
--enable_raw_key_encryption \
--keys key_id=a7e61c373e219033c21091fa607bf3b8:key=76a6c65c5ea762046bd749a2e632ccbb \
--clear_lead 0 \
--mpd_output dash.mpd This plays through DASH & MediaSource w/ ClearKey for decryption, but if I try to play back one of the individual files (video.mp4 or audio.mp4) with src=, playback seems to fail. I'm not sure why yet. When this fails, |
I've found that there is a bug in DrmEngine which suppresses errors for src= content with ClearKey. With that fixed, I then see that ClearKey setup fails with src= due to a lack of codec information on the content. If I hack in some hard-coded codec info, I then get garbled playback. The same exact files work correctly through MediaSource. So, even with bugs fixed in Shaka Player, it appears you won't be able to play back encrypted content in Chrome without using MediaSource. We'll fix what bugs we can, but I would advise you to pursue DASH or HLS encrypted content instead of plain mp4. |
We've fixed the bug that suppressed an EME failure for ClearKey content with src= playback. But the other issues still stand, and point to the conclusion that you will need to use MediaSource to be able to play back encrypted content, and that with Shaka Player, that would mean DASH or HLS. If you choose to use MediaSource directly instead of Shaka Player, you may still be able to play this encrypted content without DASH or HLS. I hope the information is helpful. Let us know if we can do anything else for you. |
Because src= content lacks codec information, ClearKey setup fails. However, because there was no DrmInfo prior to the ClearKey settings being applied, the variable hadDrmInfo was false, which led to a suppression of the resulting DRM error. Instead, we should count ClearKey settings toward hadDrmInfo. So now, ClearKey settings are applied before we calculate hadDrmInfo. Closes #2139 Change-Id: I14d5bfe63fd2ce1a461ae7ef8c2fee7f42bb1b3e
i use this command to encrypt my video
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
can i play the output file in shaka player ? if so can you please provide examples or links to docs ?
The text was updated successfully, but these errors were encountered: