{"action":"created","issue":{"url":"https://api.github.com/repos/mpv-player/mpv/issues/4579","repository_url":"https://api.github.com/repos/mpv-player/mpv","labels_url":"https://api.github.com/repos/mpv-player/mpv/issues/4579/labels{/name}","comments_url":"https://api.github.com/repos/mpv-player/mpv/issues/4579/comments","events_url":"https://api.github.com/repos/mpv-player/mpv/issues/4579/events","html_url":"https://github.com/mpv-player/mpv/issues/4579","id":240807855,"number":4579,"title":"mpv not able to play encrypted-mp4 (cenc-aes-ctr)","user":{"login":"sschnug","id":8052880,"avatar_url":"https://avatars1.githubusercontent.com/u/8052880?v=3","gravatar_id":"","url":"https://api.github.com/users/sschnug","html_url":"https://github.com/sschnug","followers_url":"https://api.github.com/users/sschnug/followers","following_url":"https://api.github.com/users/sschnug/following{/other_user}","gists_url":"https://api.github.com/users/sschnug/gists{/gist_id}","starred_url":"https://api.github.com/users/sschnug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sschnug/subscriptions","organizations_url":"https://api.github.com/users/sschnug/orgs","repos_url":"https://api.github.com/users/sschnug/repos","events_url":"https://api.github.com/users/sschnug/events{/privacy}","received_events_url":"https://api.github.com/users/sschnug/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-07-05T23:58:58Z","updated_at":"2017-07-06T14:57:24Z","closed_at":"2017-07-06T11:25:26Z","body":"Hi, new mpv-user here evaluating the player for some project of mine.\r\n\r\n**I'm having trouble playing encrypted-mp4 with mpv. Is there anything wrong (usage or misinterpretation of functionality) or is this a bug?**\r\n\r\n## Example\r\n\r\nLet's assume we got a sample-video: ```SampleVideo_1280x720_1mb.mp4``` (actual video does not matter).\r\n\r\n### Play original\r\n\r\n#### 1:\r\n```ffplay SampleVideo_1280x720_1mb.mp4```\r\n    -> OK\r\n#### 2:\r\n```mpv SampleVideo_1280x720_1mb.mp4```\r\n    -> OK\r\n\r\n### Encrypt\r\n\r\nLet's encrypt it using ffmpeg and cenc-aes-ctr:\r\n\r\n#### 3:\r\n```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```\r\n\r\n### Play encrypted:\r\n\r\n#### 4:\r\n```ffplay SampleVideo_1280x720_1mb_encrypted.mp4 -decryption_key 76a6c65c5ea762046bd749a2e632ccbb```\r\n    -> OK\r\n\r\n#### 5: shinchiro build\r\n```mpv --demuxer-lavf-cryptokey=76a6c65c5ea762046bd749a2e632ccbb SampleVideo_1280x720_1mb_encrypted.mp4```\r\n```mpv --demuxer-lavf-cryptokey=76A6C65C5EA762046BD749A2E632CCBB SampleVideo_1280x720_1mb_encrypted.mp4``` (just to be sure)\r\n    -> No -> looks it's beeing interpreted as unencrypted-stream or decryption is broken\r\n    -> tons of bitstream errors\r\n\r\n#### 6: lachs0r build\r\n```mpv --demuxer-lavf-cryptokey=76a6c65c5ea762046bd749a2e632ccbb SampleVideo_1280x720_1mb_encrypted.mp4```\r\n```mpv --demuxer-lavf-cryptokey=76A6C65C5EA762046BD749A2E632CCBB SampleVideo_1280x720_1mb_encrypted.mp4``` (just to be sure)\r\n    -> No -> looks it's beeing interpreted as unencrypted-stream or decryption is broken\r\n    -> tons of bitstream errors\r\n\r\n## Version info\r\nEverything tested on windows:\r\n\r\n- ffmpeg version N-86691-gc885356 Copyright (c) 2000-2017 the FFmpeg developers\r\n  - zeranoe windows build\r\n- ffplay version N-86691-gc885356 Copyright (c) 2003-2017 the FFmpeg developers\r\n  - zeranoe windows build\r\n- mpv 0.25.0-289-g69289aec6c (C) 2000-2017 mpv/MPlayer/mplayer2 projects \r\n  - Windows build by shinchiro\r\n- mpv 0.25.0 (C) 2000-2017 mpv/MPlayer/mplayer2 projects\r\n  - Windows build lachs0r\r\n\r\n**Edit:**\r\n- same behaviour on Linux (ubuntu 16.04 LTS) using:\r\n  - ```mpv 0.25.0-7bfeb8b-amended (C) 2000-2017 mpv/MPlayer/mplayer2 projects built on Sun Jun 25 04:29:14 UTC 2017``` installed through (non-Vapoursynth-PPA)\r\n\r\n## Log-file\r\n[log @ gist](https://gist.github.com/sschnug/1a63770779f8e6df3935d669d5eacc79)\r\n\r\n## Remarks\r\nChecking ```ffplay --help``` and searching for crypto-stuff, there are various entries and maybe this is the core of these problems.\r\n\r\nEntries:\r\n\r\n- **1:** AVFormatContext AVOptions:\r\n  -   cryptokey         <binary>     .D...... decryption key\r\n- **2:** crypto AVOptions:\r\n  -   decryption_key    <binary>     .D...... AES decryption key\r\n- **3:** mov,mp4,m4a,3gp,3g2,mj2 AVOptions:\r\n  -   decryption_key    <binary>     .D...... The media decryption key (hex)\r\n\r\nI suppose my ```ffplay```-command is using case 3, while ```mpv``` is using case 1. As the command i used for mpv is the only one i can imagine (only crypto-related) it's the only thing i tried.\r\n\r\nI'm not that familiar with ffmpeg/ffplay (at this module-level), but i can imagine, that internally *AVFormat* and *AVOptions* are treated very differently.\r\n"},"comment":{"url":"https://api.github.com/repos/mpv-player/mpv/issues/comments/313421541","html_url":"https://github.com/mpv-player/mpv/issues/4579#issuecomment-313421541","issue_url":"https://api.github.com/repos/mpv-player/mpv/issues/4579","id":313421541,"user":{"login":"wm4","id":1387750,"avatar_url":"https://avatars3.githubusercontent.com/u/1387750?v=3","gravatar_id":"","url":"https://api.github.com/users/wm4","html_url":"https://github.com/wm4","followers_url":"https://api.github.com/users/wm4/followers","following_url":"https://api.github.com/users/wm4/following{/other_user}","gists_url":"https://api.github.com/users/wm4/gists{/gist_id}","starred_url":"https://api.github.com/users/wm4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wm4/subscriptions","organizations_url":"https://api.github.com/users/wm4/orgs","repos_url":"https://api.github.com/users/wm4/repos","events_url":"https://api.github.com/users/wm4/events{/privacy}","received_events_url":"https://api.github.com/users/wm4/received_events","type":"User","site_admin":false},"created_at":"2017-07-06T14:57:23Z","updated_at":"2017-07-06T14:57:23Z","body":"Actually I think only `cryptokey` works. I used the option named @sschnug claimed to use though."}}
{"actor":{"display_login":"wm4"}}