google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.74k stars 6.03k forks source link

Populate Format.codecs for video tracks in MKV/MP4 #5882

Open T-10001 opened 5 years ago

T-10001 commented 5 years ago

How it should look: image

How it shows up on ExoPlayer: image

[REQUIRED] Content description

General Unique ID : 267980416984396205961281129986639226741 (0xC99B26A52E58A2903E58B4672DDB6775) Complete name : O:\Video\Pexels Videos 1824697-1.mkv Format : Matroska Format version : Version 4 File size : 381 KiB Duration : 10 s 965 ms Overall bit rate : 285 kb/s Encoded date : UTC 2019-05-13 11:08:24 Writing application : HandBrake 1.2.0 2018121700 Writing library : Lavf58.20.100 ErrorDetectionType : Per level 1

Video ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High 10@L4 Format settings : 4 Ref Frames Format settings, CABAC : No Format settings, Reference frames : 4 frames Codec ID : V_MPEG4/ISO/AVC Duration : 10 s 911 ms Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate mode : Constant Frame rate : 29.970 (30000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 10 bits Scan type : Progressive Writing library : x264 core 157 r2935 545de2f Encoding settings : cabac=0 / ref=2 / deblock=0:0:0 / analyse=0x3:0x113 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=0 / open_gop=0 / weightp=0 / keyint=300 / keyint_min=30 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=51.0 / qcomp=0.60 / qpmin=0 / qpmax=81 / qpstep=4 / vbv_maxrate=60000 / vbv_bufsize=75000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00 Default : Yes Forced : No Color range : Limited Color primaries : BT.709 Transfer characteristics : BT.709 Matrix coefficients : BT.709

Audio ID : 2 Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : A_AAC-2 Duration : 10 s 965 ms Channel(s) : 2 channels Channel layout : L R Sampling rate : 48.0 kHz Frame rate : 46.875 FPS (1024 SPF) Compression mode : Lossy Delay relative to video : -21 ms Title : Stereo Default : Yes Forced : No

[REQUIRED] Link to test content

Re-encode of https://www.pexels.com/video/view-of-city-in-timelapse-mode-1824697/ available at https://ufile.io/rib5ossq or https://drive.google.com/file/d/1srqww7ziBEXhWZDDbfSRxOtKEW_QIjGe/view?usp=sharing

[REQUIRED] Version of ExoPlayer being used

2.9.1

[REQUIRED] Device(s) and version(s) of Android being used

Samsung Galaxy S8 9.0

ojw28 commented 5 years ago

Yes, I'm pretty sure this is because the S8 doesn't support High 10 profile. This is a limitation of the device (and most other older devices).

As to whether the player should figure this out rather than trying to play the stream: It seems that we don't do a profile check before starting playback because Format.codecs doesn't get populated when playing MKV or MP4 streams directly. We should take a look at whether it's easy to populate the information based on what's in the container.

CreateAnAccounts commented 5 years ago

S8 only doesn't support high 10 hardware-wise, right? It is possible to play high 10 content on various other android players.