Romern / syncMyMoodle

Synchronization client for RWTH Moodle
GNU General Public License v3.0
72 stars 18 forks source link

OpenCast Download: choose highest resolution #3

Closed thtomate closed 4 years ago

thtomate commented 4 years ago

There are resolutions between 1080 and 720. Maybe, we should parse it and choose the highest.

Romern commented 4 years ago

Yes, but the videos are not tagged with the in-between resolutions. Here is an example list of tracks:

Click here to view json ```json [{ "id": "e238c793-3784-4e10-934a-dbb19c437ee9", "type": "presenter/delivery", "ref": "track:867006c2-14e8-428f-96f0-dc550fca9d14", "mimetype": "video/mp4", "tags": { "tag": ["360p-quality", "engage-download", "engage-streaming"] }, "url": "https://engage.streaming.rwth-aachen.de/static/mh_default_org/engage-player/32bdff34-8436-4fa5-982b-d759d2e91e42/89ba2b80-70da-46ce-8b65-27d0ed21fc33/video3.mp4", "checksum": { "type": "md5", "$": "2126c14509062c11c3a13f693c34b486" }, "duration": 76843, "audio": { "id": "audio-1", "device": "", "encoder": { "type": "AAC (Advanced Audio Coding)" }, "framecount": 3602, "channels": 1, "samplingrate": 48000, "bitrate": 32389 }, "video": { "id": "video-1", "device": "", "encoder": { "type": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10" }, "framecount": 1921, "bitrate": 129869, "framerate": 25, "resolution": "640x360" }, "live": false }, { "id": "ce183476-28b8-4832-8f8c-ad7436c1eeab", "type": "presenter/delivery", "ref": "track:867006c2-14e8-428f-96f0-dc550fca9d14", "mimetype": "video/mp4", "tags": { "tag": ["720p-quality", "engage-download", "engage-streaming"] }, "url": "https://engage.streaming.rwth-aachen.de/static/mh_default_org/engage-player/32bdff34-8436-4fa5-982b-d759d2e91e42/c24e4ca7-40cd-4795-8033-697ada68da06/video3.mp4", "checksum": { "type": "md5", "$": "35bb4efa3831a9de99b1b63c467c2b1c" }, "duration": 76843, "audio": { "id": "audio-1", "device": "", "encoder": { "type": "AAC (Advanced Audio Coding)" }, "framecount": 3602, "channels": 1, "samplingrate": 48000, "bitrate": 64448 }, "video": { "id": "video-1", "device": "", "encoder": { "type": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10" }, "framecount": 1921, "bitrate": 474993, "framerate": 25, "resolution": "1280x720" }, "live": false }, { "id": "c87eefd3-f814-4552-8772-1ca7ac83b7c4", "type": "presenter/delivery", "ref": "track:867006c2-14e8-428f-96f0-dc550fca9d14", "mimetype": "video/mp4", "tags": { "tag": ["1080p-quality", "engage-download", "engage-streaming"] }, "url": "https://engage.streaming.rwth-aachen.de/static/mh_default_org/engage-player/32bdff34-8436-4fa5-982b-d759d2e91e42/6309b2c7-2ba5-4212-87b8-b06527d2538e/video3.mp4", "checksum": { "type": "md5", "$": "a919d6349d3f96d82fa39e69ca1f99b5" }, "duration": 76843, "audio": { "id": "audio-1", "device": "", "encoder": { "type": "AAC (Advanced Audio Coding)" }, "framecount": 3602, "channels": 1, "samplingrate": 48000, "bitrate": 96496 }, "video": { "id": "video-1", "device": "", "encoder": { "type": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10" }, "framecount": 1921, "bitrate": 780617, "framerate": 25, "resolution": "1920x1080" }, "live": false }, { "id": "4caaf8e2-2fdf-41a9-a452-50c7b9d7aa8e", "type": "presenter/delivery", "ref": "track:867006c2-14e8-428f-96f0-dc550fca9d14", "mimetype": "video/mp4", "tags": { "tag": ["480p-quality", "engage-download", "engage-streaming"] }, "url": "https://engage.streaming.rwth-aachen.de/static/mh_default_org/engage-player/32bdff34-8436-4fa5-982b-d759d2e91e42/3a6d53e3-2912-4091-8ca6-301e722ade56/video3.mp4", "checksum": { "type": "md5", "$": "391672250660e725fb33d3a45211f7ae" }, "duration": 76843, "audio": { "id": "audio-1", "device": "", "encoder": { "type": "AAC (Advanced Audio Coding)" }, "framecount": 3602, "channels": 1, "samplingrate": 48000, "bitrate": 32389 }, "video": { "id": "video-1", "device": "", "encoder": { "type": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10" }, "framecount": 1921, "bitrate": 288211, "framerate": 25, "resolution": "854x480" }, "live": false }, { "id": "8e62d5bd-60e0-4320-aa40-23f48845d4f9", "type": "presenter/delivery", "ref": "track:4caaf8e2-2fdf-41a9-a452-50c7b9d7aa8e", "transport": "RTMP", "mimetype": "video/mp4", "tags": { "tag": ["480p-quality", "engage-download", "engage-streaming"] }, "url": "rtmps://streaming.rwth-aachen.de/rwth/mp4:engage-player/32bdff34-8436-4fa5-982b-d759d2e91e42/3a6d53e3-2912-4091-8ca6-301e722ade56/video3", "checksum": { "type": "md5", "$": "391672250660e725fb33d3a45211f7ae" }, "duration": 76843, "audio": { "id": "audio-1", "device": "", "encoder": { "type": "AAC (Advanced Audio Coding)" }, "framecount": 3602, "channels": 1, "samplingrate": 48000, "bitrate": 32389 }, "video": { "id": "video-1", "device": "", "encoder": { "type": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10" }, "framecount": 1921, "bitrate": 288211, "framerate": 25, "resolution": "854x480" }, "live": false }, { "id": "c3885bcd-e286-4401-bb90-d49f30eeb754", "type": "presenter/delivery", "ref": "track:4caaf8e2-2fdf-41a9-a452-50c7b9d7aa8e", "transport": "HLS", "mimetype": "application/x-mpegURL", "tags": { "tag": ["480p-quality", "engage-download", "engage-streaming"] }, "url": "https://streaming.rwth-aachen.de/rwth/smil:engage-player_32bdff34-8436-4fa5-982b-d759d2e91e42_presenter.smil/playlist.m3u8", "duration": 76843, "live": false }, { "id": "541a8597-fce1-4bab-a825-0f2d0103d0ad", "type": "presenter/delivery", "ref": "track:4caaf8e2-2fdf-41a9-a452-50c7b9d7aa8e", "transport": "DASH", "mimetype": "application/dash+xml", "tags": { "tag": ["480p-quality", "engage-download", "engage-streaming"] }, "url": "https://streaming.rwth-aachen.de/rwth/smil:engage-player_32bdff34-8436-4fa5-982b-d759d2e91e42_presenter.smil/manifest_mpm4sav_mvlist.mpd", "duration": 76843, "live": false }, { "id": "a237b62b-4a60-4a5a-a57f-1724b2a3181b", "type": "presenter/delivery", "ref": "track:4caaf8e2-2fdf-41a9-a452-50c7b9d7aa8e", "transport": "HDS", "mimetype": "application/f4m+xml", "tags": { "tag": ["480p-quality", "engage-download", "engage-streaming"] }, "url": "https://streaming.rwth-aachen.de/rwth/smil:engage-player_32bdff34-8436-4fa5-982b-d759d2e91e42_presenter.smil/manifest.f4m", "duration": 76843, "live": false }, { "id": "d811a32e-592e-406a-8bb2-f99c1991137e", "type": "presenter/delivery", "ref": "track:4caaf8e2-2fdf-41a9-a452-50c7b9d7aa8e", "transport": "SMOOTH", "mimetype": "application/vnd.ms-sstr+xml", "tags": { "tag": ["480p-quality", "engage-download", "engage-streaming"] }, "url": "https://streaming.rwth-aachen.de/rwth/smil:engage-player_32bdff34-8436-4fa5-982b-d759d2e91e42_presenter.smil/Manifest", "duration": 76843, "live": false }, { "id": "92803f63-b9fb-4904-a347-2361cde6f0fc", "type": "presenter/delivery", "ref": "track:e238c793-3784-4e10-934a-dbb19c437ee9", "transport": "RTMP", "mimetype": "video/mp4", "tags": { "tag": ["360p-quality", "engage-download", "engage-streaming"] }, "url": "rtmps://streaming.rwth-aachen.de/rwth/mp4:engage-player/32bdff34-8436-4fa5-982b-d759d2e91e42/89ba2b80-70da-46ce-8b65-27d0ed21fc33/video3", "checksum": { "type": "md5", "$": "2126c14509062c11c3a13f693c34b486" }, "duration": 76843, "audio": { "id": "audio-1", "device": "", "encoder": { "type": "AAC (Advanced Audio Coding)" }, "framecount": 3602, "channels": 1, "samplingrate": 48000, "bitrate": 32389 }, "video": { "id": "video-1", "device": "", "encoder": { "type": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10" }, "framecount": 1921, "bitrate": 129869, "framerate": 25, "resolution": "640x360" }, "live": false }, { "id": "ecfe341e-dc6f-4716-8a0b-b885a0ac3d5d", "type": "presenter/delivery", "ref": "track:ce183476-28b8-4832-8f8c-ad7436c1eeab", "transport": "RTMP", "mimetype": "video/mp4", "tags": { "tag": ["720p-quality", "engage-download", "engage-streaming"] }, "url": "rtmps://streaming.rwth-aachen.de/rwth/mp4:engage-player/32bdff34-8436-4fa5-982b-d759d2e91e42/c24e4ca7-40cd-4795-8033-697ada68da06/video3", "checksum": { "type": "md5", "$": "35bb4efa3831a9de99b1b63c467c2b1c" }, "duration": 76843, "audio": { "id": "audio-1", "device": "", "encoder": { "type": "AAC (Advanced Audio Coding)" }, "framecount": 3602, "channels": 1, "samplingrate": 48000, "bitrate": 64448 }, "video": { "id": "video-1", "device": "", "encoder": { "type": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10" }, "framecount": 1921, "bitrate": 474993, "framerate": 25, "resolution": "1280x720" }, "live": false }, { "id": "8fc98074-eeac-4842-aa83-c748c40dc140", "type": "presenter/delivery", "ref": "track:c87eefd3-f814-4552-8772-1ca7ac83b7c4", "transport": "RTMP", "mimetype": "video/mp4", "tags": { "tag": ["1080p-quality", "engage-download", "engage-streaming"] }, "url": "rtmps://streaming.rwth-aachen.de/rwth/mp4:engage-player/32bdff34-8436-4fa5-982b-d759d2e91e42/6309b2c7-2ba5-4212-87b8-b06527d2538e/video3", "checksum": { "type": "md5", "$": "a919d6349d3f96d82fa39e69ca1f99b5" }, "duration": 76843, "audio": { "id": "audio-1", "device": "", "encoder": { "type": "AAC (Advanced Audio Coding)" }, "framecount": 3602, "channels": 1, "samplingrate": 48000, "bitrate": 96496 }, "video": { "id": "video-1", "device": "", "encoder": { "type": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10" }, "framecount": 1921, "bitrate": 780617, "framerate": 25, "resolution": "1920x1080" }, "live": false }] ```
Romern commented 4 years ago

Fixed in https://github.com/Romern/syncMyMoodle/commit/8579e7d58e449fa166edc3b0bbe40f483dfdc540