[FFmpeg-trac] #9777(undetermined:new): -decryption_key does not work

FFmpeg trac at avcodec.org
Tue May 10 05:50:53 EEST 2022


#9777: -decryption_key does not work
-------------------------------------+-------------------------------------
             Reporter:  svnpenn      |                    Owner:  (none)
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------

Old description:

> Using a command like this fails:
>
> {{{
> PS D:\Desktop> ffmpeg -decryption_key 13d7c7cf295444944b627ef0ad2c1b3c -i
> infile.mp4 -c copy outfile.mp4
> ffmpeg version 5.0.1-essentials_build-www.gyan.dev Copyright (c)
> 2000-2022 the FFmpeg developers
>   built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
>   configuration: --enable-gpl --enable-version3 --enable-static
> --disable-w32threads --disable-autodetect --enable-fontconfig --enable-
> iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma
> --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-
> avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265
> --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx
> --enable-libass --enable-libfreetype --enable-libfribidi --enable-
> libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-
> llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc
> --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-
> libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-
> libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-
> amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-
> librubberband
>   libavutil      57. 17.100 / 57. 17.100
>   libavcodec     59. 18.100 / 59. 18.100
>   libavformat    59. 16.100 / 59. 16.100
>   libavdevice    59.  4.100 / 59.  4.100
>   libavfilter     8. 24.100 /  8. 24.100
>   libswscale      6.  4.100 /  6.  4.100
>   libswresample   4.  3.100 /  4.  3.100
>   libpostproc    56.  3.100 / 56.  3.100
> [mov,mp4,m4a,3gp,3g2,mj2 @ 000001fce0e5b240] leftover packet bytes after
> subsample processing
> [mov,mp4,m4a,3gp,3g2,mj2 @ 000001fce0e5b240] Could not find codec
> parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 384x216,
> 145 kb/s): unspecified pixel format
> Consider increasing the value for the 'analyzeduration' (0) and
> 'probesize' (5000000) options
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'infile.mp4':
>   Metadata:
>     major_brand     : isom
>     minor_version   : 1
>     compatible_brands: isomavc1dash
>     creation_time   : 2022-04-01T12:13:24.000000Z
>   Duration: 01:39:24.46, bitrate: 156 kb/s
>   Stream #0:0[0x1](und): Video: h264 (avc1 / 0x31637661), none, 384x216,
> 145 kb/s, SAR 1:1 DAR 16:9, 23.98 fps, 24k tbr, 24k tbn (default)
>     Metadata:
>       creation_time   : 2022-04-01T12:13:24.000000Z
>       handler_name    : ETI ISO Video Media Handler
>       vendor_id       : [0][0][0][0]
>       encoder         : Elemental H.264
>     Side data:
>       unknown side data type 24 (2088984 bytes)
> Output #0, mp4, to 'outfile.mp4':
>   Metadata:
>     major_brand     : isom
>     minor_version   : 1
>     compatible_brands: isomavc1dash
>     encoder         : Lavf59.16.100
>   Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 384x216 [SAR
> 1:1 DAR 16:9], q=2-31, 145 kb/s, 23.98 fps, 24k tbr, 24k tbn (default)
>     Metadata:
>       creation_time   : 2022-04-01T12:13:24.000000Z
>       handler_name    : ETI ISO Video Media Handler
>       vendor_id       : [0][0][0][0]
>       encoder         : Elemental H.264
>     Side data:
>       unknown side data type 24 (2088984 bytes)
> Stream mapping:
>   Stream #0:0 -> #0:0 (copy)
> Press [q] to stop, [?] for help
> [mov,mp4,m4a,3gp,3g2,mj2 @ 000001fce0e5b240] leftover packet bytes after
> subsample processing
> infile.mp4: Invalid data found when processing input
> }}}
>
> Input file is about 100 MB, output file is 262 bytes. Same command with
> mp4decrypt works:
>
> {{{
> mp4decrypt --key
> 28339ad78f734520da24e6e0573d392e:13d7c7cf295444944b627ef0ad2c1b3c
> infile.mp4
> outfile.mp4
> }}}
>
> I can upload the input file if need be.

New description:

 Using a command like this fails:

 {{{
 PS D:\Desktop> ffmpeg -decryption_key 13d7c7cf295444944b627ef0ad2c1b3c -i
 infile.mp4 -c copy outfile.mp4
 ffmpeg version 5.0.1-essentials_build-www.gyan.dev Copyright (c) 2000-2022
 the FFmpeg developers
   built with gcc 11.2.0 (Rev7, Built by MSYS2 project)
   configuration: --enable-gpl --enable-version3 --enable-static --disable-
 w32threads --disable-autodetect --enable-fontconfig --enable-iconv
 --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib
 --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth
 --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-
 libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-
 libass --enable-libfreetype --enable-libfribidi --enable-libvidstab
 --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm
 --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-
 d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt
 --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora
 --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb
 --enable-libopus --enable-libspeex --enable-libvorbis --enable-
 librubberband
   libavutil      57. 17.100 / 57. 17.100
   libavcodec     59. 18.100 / 59. 18.100
   libavformat    59. 16.100 / 59. 16.100
   libavdevice    59.  4.100 / 59.  4.100
   libavfilter     8. 24.100 /  8. 24.100
   libswscale      6.  4.100 /  6.  4.100
   libswresample   4.  3.100 /  4.  3.100
   libpostproc    56.  3.100 / 56.  3.100
 [mov,mp4,m4a,3gp,3g2,mj2 @ 000001fce0e5b240] leftover packet bytes after
 subsample processing
 [mov,mp4,m4a,3gp,3g2,mj2 @ 000001fce0e5b240] Could not find codec
 parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 384x216,
 145 kb/s): unspecified pixel format
 Consider increasing the value for the 'analyzeduration' (0) and
 'probesize' (5000000) options
 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'infile.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 1
     compatible_brands: isomavc1dash
     creation_time   : 2022-04-01T12:13:24.000000Z
   Duration: 01:39:24.46, bitrate: 156 kb/s
   Stream #0:0[0x1](und): Video: h264 (avc1 / 0x31637661), none, 384x216,
 145 kb/s, SAR 1:1 DAR 16:9, 23.98 fps, 24k tbr, 24k tbn (default)
     Metadata:
       creation_time   : 2022-04-01T12:13:24.000000Z
       handler_name    : ETI ISO Video Media Handler
       vendor_id       : [0][0][0][0]
       encoder         : Elemental H.264
     Side data:
       unknown side data type 24 (2088984 bytes)
 Output #0, mp4, to 'outfile.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 1
     compatible_brands: isomavc1dash
     encoder         : Lavf59.16.100
   Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 384x216 [SAR
 1:1 DAR 16:9], q=2-31, 145 kb/s, 23.98 fps, 24k tbr, 24k tbn (default)
     Metadata:
       creation_time   : 2022-04-01T12:13:24.000000Z
       handler_name    : ETI ISO Video Media Handler
       vendor_id       : [0][0][0][0]
       encoder         : Elemental H.264
     Side data:
       unknown side data type 24 (2088984 bytes)
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
 Press [q] to stop, [?] for help
 [mov,mp4,m4a,3gp,3g2,mj2 @ 000001fce0e5b240] leftover packet bytes after
 subsample processing
 infile.mp4: Invalid data found when processing input
 }}}

 Input file is about 100 MB, output file is 262 bytes. Same command with
 mp4decrypt works:

 {{{
 mp4decrypt --key
 28339ad78f734520da24e6e0573d392e:13d7c7cf295444944b627ef0ad2c1b3c
 infile.mp4
 outfile.mp4
 }}}

 I can upload the input file if need be.

--
Comment (by svnpenn):

 I found the answer here:

 https://stackoverflow.com/questions/66029486/decrypting-fragmented-mpeg-
 dash-using-ffmpeg

 It seems currently with FFmpeg, you must decrypt each fragment separately,
 and you must combine the init segment with each fragment before
 decrypting. Contrast with other tools, which can decrypt the whole file at
 once.
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9777#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list