moneytoo / Player

▶ Simple and lightweight, yet polished and powerful Android video player based on ExoPlayer
https://play.google.com/store/apps/details?id=com.brouken.player
The Unlicense
1.77k stars 188 forks source link

Snapdragon 730G can't play 4k 60fps in mp4 container. #308

Closed odkrys closed 2 years ago

odkrys commented 2 years ago

I am testing several video applications on my Lenovo P11 pro (snapdragon 730G). Justplayer cannot play 4k 60fps hevc videos (8bit and 10bit) and 4k 60fps vp9 video in mp4 container. (This mp4 videos play fine on my Galaxy S10+ with Justplayer.)

But if I change the videos to mkv using encoder they are playable. It looks my 730G device cannot find hw decoder for mp4, but why is it successful in mkv?

Snapdragon 700 series products are known to only play 4k 30fps, so is it blacklisted? However, if I change videos to mkv and play them, there is no frame drop at all. I used perfdog ( https://perfdog.wetest.net ) to watch FPS and this tablet plays really well the 10bit 4k 60fps hdr video smoothly.

The error message is as follows.

Decoder init failed: OMX.qcom.video.decoder.hevc, Format(1, null, null, video/hevc, hvc1.2.4.H153.B0,-1, null,[3840,2160,59.939976],[-1,-1])

Attach mediainfo of hevc 10bit 4k 60fps sample.

MP4

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : hev1
Codec ID/Info                            : High Efficiency Video Coding
Duration                                 : 1 min 34 s
Bit rate                                 : 65.2 Mb/s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Variable
Frame rate                               : 59.940 (60000/1001) FPS
Minimum frame rate                       : 59.920 FPS
Maximum frame rate                       : 59.960 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.131
Stream size                              : 735 MiB (100%)
Writing library                          : ATEME Titan File 3.7.3 (4.7.3.1002)
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0500 cd/m2, max: 1000 cd/m2
Codec configuration box                  : hvcC

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : mp4a-40-2
Duration                                 : 1 min 34 s
Bit rate mode                            : Variable
Bit rate                                 : 192 kb/s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Stream size                              : 2.14 MiB (0%)
Default                                  : Yes
Alternate group                          : 1

Details

General
Count                                    : 331
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Count of video streams                   : 1
Count of audio streams                   : 1
Video_Format_List                        : HEVC
Video_Format_WithHint_List               : HEVC
Codecs Video                             : HEVC
Audio_Format_List                        : AAC LC
Audio_Format_WithHint_List               : AAC LC
Audio codecs                             : AAC LC
Complete name                            : C:\Users\Jun\Videos\hevc-10bit-4k-60fps-hdr.mp4
Folder name                              : C:\Users\Jun\Videos
File name extension                      : hevc-10bit-4k-60fps-hdr.mp4
File name                                : hevc-10bit-4k-60fps-hdr
File extension                           : mp4
Format                                   : MPEG-4
Format                                   : MPEG-4
Format/Extensions usually used           : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v
Commercial name                          : MPEG-4
Format profile                           : Base Media
Internet media type                      : video/mp4
Codec ID                                 : isom
Codec ID                                 : isom (isom/iso2/mp41)
Codec ID/Url                             : http://www.apple.com/quicktime/download/standalone.html
CodecID_Compatible                       : isom/iso2/mp41
File size                                : 773579882
File size                                : 738 MiB
File size                                : 738 MiB
File size                                : 738 MiB
File size                                : 738 MiB
File size                                : 737.7 MiB
Duration                                 : 94628
Duration                                 : 1 min 34 s
Duration                                 : 1 min 34 s 628 ms
Duration                                 : 1 min 34 s
Duration                                 : 00:01:34.628
Duration                                 : 00:01:34;36
Duration                                 : 00:01:34.628 (00:01:34;36)
Overall bit rate mode                    : VBR
Overall bit rate mode                    : Variable
Overall bit rate                         : 65399660
Overall bit rate                         : 65.4 Mb/s
Frame rate                               : 59.940
Frame rate                               : 59.940 FPS
Frame count                              : 5672
Stream size                              : 195667
Stream size                              : 191 KiB (0%)
Stream size                              : 191 KiB
Stream size                              : 191 KiB
Stream size                              : 191 KiB
Stream size                              : 191.1 KiB
Stream size                              : 191 KiB (0%)
Proportion of this stream                : 0.00025
HeaderSize                               : 36
DataSize                                 : 773384223
FooterSize                               : 195623
IsStreamable                             : No
File creation date                       : UTC 2022-05-10 17:15:15.508
File creation date (local)               : 2022-05-11 02:15:15.508
File last modification date              : UTC 2022-05-10 13:10:31.654
File last modification date (local)      : 2022-05-10 22:10:31.654
Writing application                      : ShanaEncoder
Writing application                      : ShanaEncoder

Video
Count                                    : 378
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 1
ID                                       : 1
Format                                   : HEVC
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format/Url                               : http://www.itu.int
Commercial name                          : HEVC
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086
HDR format                               : SMPTE ST 2086, HDR10 compatible
HDR_Format_Commercial                    : HDR10
HDR_Format_Compatibility                 : HDR10
Internet media type                      : video/H265
Codec ID                                 : hev1
Codec ID/Info                            : High Efficiency Video Coding
Codec ID/Url                             : http://www.itu.int/
Duration                                 : 94628
Duration                                 : 1 min 34 s
Duration                                 : 1 min 34 s 628 ms
Duration                                 : 1 min 34 s
Duration                                 : 00:01:34.628
Duration                                 : 00:01:34;36
Duration                                 : 00:01:34.628 (00:01:34;36)
Bit rate                                 : 65193872
Bit rate                                 : 65.2 Mb/s
Width                                    : 3840
Width                                    : 3 840 pixels
Height                                   : 2160
Height                                   : 2 160 pixels
Sampled_Width                            : 3840
Sampled_Height                           : 2160
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.778
Display aspect ratio                     : 16:9
Rotation                                 : 0.000
Frame rate mode                          : VFR
Frame rate mode                          : Variable
Frame rate                               : 59.940
Frame rate                               : 59.940 (60000/1001) FPS
FrameRate_Num                            : 60000
FrameRate_Den                            : 1001
Minimum frame rate                       : 59.920
Minimum frame rate                       : 59.920 FPS
Maximum frame rate                       : 59.960
Maximum frame rate                       : 59.960 FPS
Frame count                              : 5672
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 10
Bit depth                                : 10 bits
Bits/(Pixel*Frame)                       : 0.131
Stream size                              : 771144540
Stream size                              : 735 MiB (100%)
Stream size                              : 735 MiB
Stream size                              : 735 MiB
Stream size                              : 735 MiB
Stream size                              : 735.4 MiB
Stream size                              : 735 MiB (100%)
Proportion of this stream                : 0.99685
Writing library                          : ATEME Titan File 3.7.3 (4.7.3.1002)
Writing library                          : ATEME Titan File 3.7.3 (4.7.3.1002)
Encoded_Library_Name                     : ATEME Titan File
Encoded_Library_Version                  : 3.7.3 (4.7.3.1002)
colour_description_present               : Yes
colour_description_present_Source        : Stream
Color range                              : Limited
colour_range_Source                      : Stream
Color primaries                          : BT.2020
colour_primaries_Source                  : Stream
Transfer characteristics                 : PQ
transfer_characteristics_Source          : Stream
Matrix coefficients                      : BT.2020 non-constant
matrix_coefficients_Source               : Stream
Mastering display color primaries        : Display P3
MasteringDisplay_ColorPrimaries_Source   : Stream
Mastering display luminance              : min: 0.0500 cd/m2, max: 1000 cd/m2
MasteringDisplay_Luminance_Source        : Stream
Codec configuration box                  : hvcC

Audio
Count                                    : 280
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
StreamOrder                              : 1
ID                                       : 2
ID                                       : 2
Format                                   : AAC
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Commercial name                          : AAC
Format_AdditionalFeatures                : LC
Codec ID                                 : mp4a-40-2
Duration                                 : 94614
Duration                                 : 1 min 34 s
Duration                                 : 1 min 34 s 614 ms
Duration                                 : 1 min 34 s
Duration                                 : 00:01:34.614
Duration                                 : 00:01:34:17
Duration                                 : 00:01:34.614 (00:01:34:17)
Bit rate mode                            : VBR
Bit rate mode                            : Variable
Bit rate                                 : 192000
Bit rate                                 : 192 kb/s
Channel(s)                               : 2
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Channel positions                        : 2/0/0
Channel layout                           : L R
Samples per frame                        : 1024
Sampling rate                            : 48000
Sampling rate                            : 48.0 kHz
Samples count                            : 4541472
Frame rate                               : 46.875
Frame rate                               : 46.875 FPS (1024 SPF)
Frame count                              : 4435
Compression mode                         : Lossy
Compression mode                         : Lossy
Stream size                              : 2239675
Stream size                              : 2.14 MiB (0%)
Stream size                              : 2 MiB
Stream size                              : 2.1 MiB
Stream size                              : 2.14 MiB
Stream size                              : 2.136 MiB
Stream size                              : 2.14 MiB (0%)
Proportion of this stream                : 0.00290
Default                                  : Yes
Default                                  : Yes
Alternate group                          : 1
Alternate group                          : 1

MediaInfoLib - v19.09

MKV

Video
ID                                       : 1
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086, HDR10 compatible
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 1 min 34 s
Width                                    : 3 840 pixels
Height                                   : 2 160 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 59.940 (60000/1001) FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 10 bits
Writing library                          : ATEME Titan File 3.7.3 (4.7.3.1002)
Default                                  : Yes
Forced                                   : No
Color range                              : Limited
Color primaries                          : BT.2020
Transfer characteristics                 : PQ
Matrix coefficients                      : BT.2020 non-constant
Mastering display color primaries        : Display P3
Mastering display luminance              : min: 0.0500 cd/m2, max: 1000 cd/m2

Audio
ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : A_AAC-2
Duration                                 : 1 min 34 s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Default                                  : Yes
Forced                                   : No

Details

General
Count                                    : 332
Count of stream of this kind             : 1
Kind of stream                           : General
Kind of stream                           : General
Stream identifier                        : 0
Unique ID                                : 96353646254882565852395791581018295053
Unique ID                                : 96353646254882565852395791581018295053 (0x487D0989B20F807394E28900619F8B0D)
Count of video streams                   : 1
Count of audio streams                   : 1
Video_Format_List                        : HEVC
Video_Format_WithHint_List               : HEVC
Codecs Video                             : HEVC
Audio_Format_List                        : AAC LC
Audio_Format_WithHint_List               : AAC LC
Audio codecs                             : AAC LC
Complete name                            : \\192.168.50.1\movie\[SHANA]hevc-10bit-4k-60fps-hdr.mkv
Folder name                              : \\192.168.50.1\movie
File name extension                      : [SHANA]hevc-10bit-4k-60fps-hdr.mkv
File name                                : [SHANA]hevc-10bit-4k-60fps-hdr
File extension                           : mkv
Format                                   : Matroska
Format                                   : Matroska
Format/Url                               : https://matroska.org/downloads/windows.html
Format/Extensions usually used           : mkv mk3d mka mks
Commercial name                          : Matroska
Format version                           : Version 4
File size                                : 773464804
File size                                : 738 MiB
File size                                : 738 MiB
File size                                : 738 MiB
File size                                : 738 MiB
File size                                : 737.6 MiB
Duration                                 : 94628
Duration                                 : 1 min 34 s
Duration                                 : 1 min 34 s 628 ms
Duration                                 : 1 min 34 s
Duration                                 : 00:01:34.628
Duration                                 : 00:01:34;36
Duration                                 : 00:01:34.628 (00:01:34;36)
Overall bit rate                         : 65389931
Overall bit rate                         : 65.4 Mb/s
Frame rate                               : 59.940
Frame rate                               : 59.940 FPS
Frame count                              : 5672
IsStreamable                             : Yes
File creation date                       : UTC 2022-05-10 17:13:12.356
File creation date (local)               : 2022-05-11 02:13:12.356
File last modification date              : UTC 2022-05-10 17:13:12.356
File last modification date (local)      : 2022-05-11 02:13:12.356
Writing application                      : ShanaEncoder
Writing application                      : ShanaEncoder
Writing library                          : ShanaEncoder
Writing library                          : ShanaEncoder
ErrorDetectionType                       : Per level 1

Video
Count                                    : 377
Count of stream of this kind             : 1
Kind of stream                           : Video
Kind of stream                           : Video
Stream identifier                        : 0
StreamOrder                              : 0
ID                                       : 1
ID                                       : 1
Unique ID                                : 10223289567373930770
Format                                   : HEVC
Format                                   : HEVC
Format/Info                              : High Efficiency Video Coding
Format/Url                               : http://www.itu.int
Commercial name                          : HEVC
Format profile                           : Main 10@L5.1@High
HDR format                               : SMPTE ST 2086
HDR format                               : SMPTE ST 2086, HDR10 compatible
HDR_Format_Commercial                    : HDR10
HDR_Format_Compatibility                 : HDR10
Internet media type                      : video/H265
Codec ID                                 : V_MPEGH/ISO/HEVC
Duration                                 : 94628.000000
Duration                                 : 1 min 34 s
Duration                                 : 1 min 34 s 628 ms
Duration                                 : 1 min 34 s
Duration                                 : 00:01:34.628
Duration                                 : 00:01:34;36
Duration                                 : 00:01:34.628 (00:01:34;36)
Width                                    : 3840
Width                                    : 3 840 pixels
Height                                   : 2160
Height                                   : 2 160 pixels
Sampled_Width                            : 3840
Sampled_Height                           : 2160
Pixel aspect ratio                       : 1.000
Display aspect ratio                     : 1.778
Display aspect ratio                     : 16:9
Frame rate mode                          : CFR
Frame rate mode                          : Constant
Frame rate                               : 59.940
Frame rate                               : 59.940 (60000/1001) FPS
FrameRate_Num                            : 60000
FrameRate_Den                            : 1001
Frame count                              : 5672
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Chroma subsampling                       : 4:2:0
Bit depth                                : 10
Bit depth                                : 10 bits
Delay                                    : 0
Delay                                    : 00:00:00.000
Delay, origin                            : Container
Delay, origin                            : Container
Writing library                          : ATEME Titan File 3.7.3 (4.7.3.1002)
Writing library                          : ATEME Titan File 3.7.3 (4.7.3.1002)
Encoded_Library_Name                     : ATEME Titan File
Encoded_Library_Version                  : 3.7.3 (4.7.3.1002)
Default                                  : Yes
Default                                  : Yes
Forced                                   : No
Forced                                   : No
colour_description_present               : Yes
colour_description_present_Source        : Container / Stream
Color range                              : Limited
colour_range_Source                      : Container / Stream
Color primaries                          : BT.2020
colour_primaries_Source                  : Container / Stream
Transfer characteristics                 : PQ
transfer_characteristics_Source          : Container / Stream
Matrix coefficients                      : BT.2020 non-constant
matrix_coefficients_Source               : Container / Stream
Mastering display color primaries        : Display P3
MasteringDisplay_ColorPrimaries_Source   : Stream
Mastering display luminance              : min: 0.0500 cd/m2, max: 1000 cd/m2
MasteringDisplay_Luminance_Source        : Stream

Audio
Count                                    : 280
Count of stream of this kind             : 1
Kind of stream                           : Audio
Kind of stream                           : Audio
Stream identifier                        : 0
StreamOrder                              : 1
ID                                       : 2
ID                                       : 2
Unique ID                                : 16898772958304178060
Format                                   : AAC
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Commercial name                          : AAC
Format_AdditionalFeatures                : LC
Codec ID                                 : A_AAC-2
Duration                                 : 94613.000000
Duration                                 : 1 min 34 s
Duration                                 : 1 min 34 s 613 ms
Duration                                 : 1 min 34 s
Duration                                 : 00:01:34.613
Duration                                 : 00:01:34.613
Channel(s)                               : 2
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Channel positions                        : 2/0/0
Channel layout                           : L R
Samples per frame                        : 1024
Sampling rate                            : 48000
Sampling rate                            : 48.0 kHz
Samples count                            : 4541424
Frame rate                               : 46.875
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Compression mode                         : Lossy
Delay                                    : 0
Delay                                    : 00:00:00.000
Delay, origin                            : Container
Delay, origin                            : Container
Delay relative to video                  : 0
Delay relative to video                  : 00:00:00.000
Default                                  : Yes
Default                                  : Yes
Forced                                   : No
Forced                                   : No

MediaInfoLib - v19.09
moneytoo commented 2 years ago

You could check device decoding capabilities of HEVC using https://github.com/Parseus/codecinfo

But if I change the videos to mkv using encoder they are playable.

Do you remux your MP4 file to MKV or reencode? Maybe you could remuxing back to MP4 just to make sure the file is valid.

Anyway, there's not much Just Player does about this so eventually the best course of actions would be replicating this issue in the ExoPlayer Demo and submitting this issue to ExoPlayer.

odkrys commented 2 years ago

It's just a remux. I tested mp4 -> mkv -> mp4, but it still does not play in mp4. ( -f mp4 -c:v copy -c:a copy -sn -map_metadata -1 -map_chapters -1)

Codecinfo as far as I know this is reading the hardware acceleration profile specified in media_codecs.xml.

OMX.qcom.video.decoder.hevc / OMX.qcom.video.decoder.hevc.secure / OMX.qcom.video.decoder.vp9 / OMX.qcom.video.decoder.vp9.secure

All of them say 4K: 30.0 fps.

Does exoplayer depend on this information? I'm having trouble reverting to 480p when selecting 4k 60fps hdr video on recent youtube 17.x version. This was fine in the 16.x version. But 4k 60fps sdr video is also fine. It's really weird.

I know the hardware decoder has some resource margin, and should I see that this device has enough margin to be able to play 4k 60fps? But I don't know why it plays in mkv and not in mp4. These mp4 videos are played on mxplayer, and the difference is that 60fps video on mxplayer is played with hw+ decoder, not hw decoder.

In mkv, hevc 10bit 4k 60fps hdr video sample is played without frame drops on Justplayer.