polimediaupv / paella-core

Paella Player core library
Educational Community License v2.0
20 stars 15 forks source link

With some videos, Paella shows `0:00` as duration, sound is missing and the progress bar is broken #97

Closed LukasKalbertodt closed 2 years ago

LukasKalbertodt commented 2 years ago

Hi there again!

You can best observe the problem by testing this video. As you can see, three things break:

The video file being played there is: https://oc.tobira.ethz.ch/static/mh_default_org/engage-player/25e82f02-db10-4ba6-937f-3252353cfbe8/8e618425-9c67-4fe5-99b9-8490e393716c/nasa_moon_x264_720p.mp4

The following things are logged in the console:

Console output ``` paella-core - Debug: New paella player instance paella-core - Debug: Loading paella player { "logLevel": "WARN", "plugins": { "es.upv.paella.singleVideo": { "enabled": true, "validContent": [ { "id": "presenter", "content": [ "presenter" ], "icon": "present-mode-2.svg", "title": "Presenter" }, { "id": "presentation", "content": [ "presentation" ], "icon": "present-mode-1.svg", "title": "Presentation" }, { "id": "presenter-2", "content": [ "presenter-2" ], "icon": "present-mode-1.svg", "title": "Presentation" } ] }, "es.upv.paella.dualVideo": { "enabled": true, "validContent": [ { "id": "presenter-presentation", "content": [ "presenter", "presentation" ], "icon": "present-mode-3.svg", "title": "Presenter and presentation" }, { "id": "presenter-2-presentation", "content": [ "presenter-2", "presentation" ], "icon": "present-mode-3.svg", "title": "Presenter and presentation" }, { "id": "presenter-presenter-2", "content": [ "presenter", "presenter-2" ], "icon": "present-mode-3.svg", "title": "Presenter and presentation" } ] }, "es.upv.paella.videoCanvas": { "enabled": true, "order": 1 }, "es.upv.paella.zoomPlugin": { "enabled": true, "order": 0 }, "es.upv.paella.mp4VideoFormat": { "enabled": true, "order": 1 }, "es.upv.paella.hlsVideoFormat": { "enabled": true, "order": 0, "corsConfig": { "withCredentials": false, "requestHeaders": { "Access-Control-Allow-Credentials": false } } }, "es.upv.paella.hlsLiveVideoFormat": { "enabled": true, "order": 0, "corsConfig": { "withCredentials": false, "requestHeaders": { "Access-Control-Allow-Credentials": false } } }, "es.upv.paella.playPauseButton": { "enabled": true, "side": "left" }, "es.upv.paella.volumeButtonPlugin": { "enabled": true, "side": "left" }, "es.upv.paella.forwardButtonPlugin": { "enabled": true, "side": "left" }, "es.upv.paella.backwardButtonPlugin": { "enabled": true, "side": "left" }, "es.upv.paella.captionsSelectorPlugin": { "enabled": true, "side": "right" }, "es.upv.paella.playbackRateButton": { "enabled": true, "side": "right", "rates": [ 0.25, 0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 2.5 ] }, "es.upv.paella.qualitySelector": { "enabled": true, "side": "right" }, "es.upv.paella.fullscreenButton": { "enabled": true, "side": "right" } } } StreamProvider.js:150 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'currentTimeSync') at StreamProvider.js:150:43 at u (StreamProvider.js:2:1) at Generator._invoke (StreamProvider.js:2:1) at Generator.next (StreamProvider.js:2:1) at se (StreamProvider.js:2:1) at o (StreamProvider.js:2:1) at StreamProvider.js:2:1 at new Promise () at StreamProvider.js:2:1 at StreamProvider.js:142:23 ```

I would assume that it's not an issue with how Tobira configures Paella as other videos work fine. For example, try the "Chicken" video in the same series. I checked the media info output for both video files, but there is nothing obvious I think.

Mediainfo diff ```diff -Complete name : /home/lukas/Downloads/chicken_60fps_x264_1080p.mp4 +Complete name : /home/lukas/Downloads/nasa_moon_x264_720p.mp4 Format : MPEG-4 Format profile : Base Media Codec ID : isom (isom/iso2/avc1/mp41) -File size : 21.1 MiB -Duration : 44 s 779 ms -Overall bit rate : 3 947 kb/s +File size : 44.3 MiB +Duration : 4 min 57 s +Overall bit rate : 1 251 kb/s Writing application : Lavf58.49.100 Video ID : 1 Format : AVC Format/Info : Advanced Video Codec -Format profile : High@L4.2 +Format profile : High@L4 Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 4 frames -Format settings, GOP : M=4, N=30 Codec ID : avc1 Codec ID/Info : Advanced Video Coding -Duration : 44 s 745 ms -Bit rate : 3 809 kb/s -Width : 1 920 pixels -Height : 1 080 pixels +Duration : 4 min 56 s +Bit rate : 1 148 kb/s +Width : 1 280 pixels +Height : 720 pixels Display aspect ratio : 16:9 Frame rate mode : Constant -Frame rate : 59.940 (60000/1001) FPS +Frame rate : 25.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive -Bits/(Pixel*Frame) : 0.031 -Stream size : 20.3 MiB (96%) +Bits/(Pixel*Frame) : 0.050 +Stream size : 40.7 MiB (92%) Writing library : x264 core 161 r3018 db0d417 -Encoding settings : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=4 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=0 / threads=18 / lookahead_threads=4 / 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=1 / open_gop=0 / weightp=1 / keyint=30 / keyint_min=3 / scenecut=40 / intra_refresh=0 / rc_lookahead=20 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00 +Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / 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=18 / lookahead_threads=3 / 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=1 / open_gop=0 / weightp=2 / keyint=25 / keyint_min=13 / scenecut=0 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=1200 / vbv_bufsize=2400 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00 Language : English Codec configuration box : avcC @@ -42,15 +41,15 @@ Format : AAC LC Format/Info : Advanced Audio Codec Low Complexity Codec ID : mp4a-40-2 -Duration : 44 s 779 ms +Duration : 4 min 57 s Bit rate mode : Constant -Bit rate : 129 kb/s +Bit rate : 96.0 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 : 703 KiB (3%) +Stream size : 3.41 MiB (8%) Language : English Default : Yes Alternate group : 1 ```

The problem happens with plenty of videos on tobira.opencast.org. Most of the broken videos arethe exact video files the ETHZ used for many years. So Paella should probably be able to deal with those.

If I can help further in debugging this problem, let me know!

ferserc1 commented 2 years ago

The problem is that the "role" parameter has to be specified in order for the player to recognise which is the main audio.

There are two flaws here: firstly, if the video manifest only specifies one stream, it should not be necessary to specify the "role" parameter, because it is obvious that the main audio comes from the only stream there is.

The second bug is that, if there are two streams, an exception should be thrown to indicate which one is the problem.

There are a few more cases of incorrect parameterisations that don't throw exceptions, and I'm fixing them for version 1.3 which will be released soon.

LukasKalbertodt commented 2 years ago

That sounds reasonable! Thank you for the fix. We will update Tobira once Paella 1.3 is released.