Commit Graph

43 Commits (0305db28c98fd6cf43a3c50ba92c76215e99d512)

Author SHA1 Message Date
Jelle Besseling 0305db28c9
Add support for saving video files to object storage (#4290)
* Add support for saving video files to object storage

* Add support for custom url generation on s3 stored files

Uses two config keys to support url generation that doesn't directly go
to (compatible s3). Can be used to generate urls to any cache server or
CDN.

* Upload files to s3 concurrently and delete originals afterwards

* Only publish after move to object storage is complete

* Use base url instead of url template

* Fix mistyped config field

* Add rudenmentary way to download before transcode

* Implement Chocobozzz suggestions

https://github.com/Chocobozzz/PeerTube/pull/4290#issuecomment-891670478

The remarks in question:
    Try to use objectStorage prefix instead of s3 prefix for your function/variables/config names
    Prefer to use a tree for the config: s3.streaming_playlists_bucket -> object_storage.streaming_playlists.bucket
    Use uppercase for config: S3.STREAMING_PLAYLISTS_BUCKETINFO.bucket -> OBJECT_STORAGE.STREAMING_PLAYLISTS.BUCKET (maybe BUCKET_NAME instead of BUCKET)
    I suggest to rename moveJobsRunning to pendingMovingJobs (or better, create a dedicated videoJobInfo table with a pendingMove & videoId columns so we could also use this table to track pending transcoding jobs)
    https://github.com/Chocobozzz/PeerTube/pull/4290/files#diff-3e26d41ca4bda1de8e1747af70ca2af642abcc1e9e0bfb94239ff2165acfbde5R19 uses a string instead of an integer
    I think we should store the origin object storage URL in fileUrl, without base_url injection. Instead, inject the base_url at "runtime" so admins can easily change this configuration without running a script to update DB URLs

* Import correct function

* Support multipart upload

* Remove import of node 15.0 module stream/promises

* Extend maximum upload job length

Using the same value as for redundancy downloading seems logical

* Use dynamic part size for really large uploads

Also adds very small part size for local testing

* Fix decreasePendingMove query

* Resolve various PR comments

* Move to object storage after optimize

* Make upload size configurable and increase default

* Prune webtorrent files that are stored in object storage

* Move files after transcoding jobs

* Fix federation

* Add video path manager

* Support move to external storage job in client

* Fix live object storage tests

Co-authored-by: Chocobozzz <me@florianbigard.com>
2021-08-17 08:26:20 +02:00
Chocobozzz fa47956ecf
Filter host for channels and playlists search 2021-07-28 10:32:40 +02:00
Chocobozzz 764b1a14fc Use random names for VOD HLS playlists 2021-07-26 11:29:31 +02:00
Chocobozzz c4d125527a
Avoid error when file has no torrent file 2021-05-25 11:35:29 +02:00
Chocobozzz 16c016e8b1
Stricter models typing 2021-05-12 14:12:14 +02:00
Chocobozzz d61893f723 Async torrent creation 2021-02-25 15:01:07 +01:00
Chocobozzz 8efc27bf14 Cleanup 2021-02-18 13:38:09 +01:00
Chocobozzz d9a2a03196 Don't guess remote tracker URL 2021-02-18 13:38:09 +01:00
Chocobozzz 90a8bd305d Dissociate video file names and video uuid 2021-02-18 13:38:09 +01:00
Chocobozzz b49f22d8f9 Upgrade sequelize to v6 2020-12-09 11:41:22 +01:00
Chocobozzz 0b84383d48
Fix stat file size with HLS 2020-11-10 08:07:21 +01:00
Chocobozzz 9e2b2e76ba Don't add live videos in redundancy 2020-11-09 15:33:04 +01:00
Chocobozzz 053aed43fb Regenerate miniature on live save 2020-11-09 15:33:04 +01:00
Chocobozzz bd54ad1953 Add live notification tests 2020-11-09 15:33:04 +01:00
Chocobozzz 97969c4edf Add check constraints live tests 2020-11-09 15:33:04 +01:00
Chocobozzz c6c0fa6cd8 Live streaming implementation first step 2020-11-09 15:33:04 +01:00
Chocobozzz 26d6bf6533
Split types and typings 2020-06-18 10:46:27 +02:00
Chocobozzz 7b81edc854
Video file metadata PR cleanup 2020-03-10 16:18:29 +01:00
Rigel Kent 8319d6ae72
Add video file metadata to download modal, via ffprobe (#2411)
* Add video file metadata via ffprobe

* Federate video file metadata

* Add tests for file metadata generation

* Complete tests for videoFile metadata federation

* Lint migration and video-file for metadata

* Objectify metadata from getter in ffmpeg-utils

* Add metadataUrl to all videoFiles

* Simplify metadata API middleware

* Load playlist in videoFile when requesting metadata
2020-03-10 14:39:40 +01:00
Chocobozzz 35f28e94c7
Add infohash cache 2020-01-03 13:47:45 +01:00
Chocobozzz 907b8f9347
Use a migration script to generate HLS torrent files 2019-12-12 10:56:34 +01:00
Chocobozzz d7a25329f9
Add ability to disable webtorrent
In favour of HLS
2019-11-25 10:59:43 +01:00
Chocobozzz d5d9b6d7bf
Update server dependencies 2019-10-21 15:03:28 +02:00
Chocobozzz 453e83ea5d
Stronger model typings 2019-08-19 17:26:35 +02:00
Chocobozzz 536598cfaf
Add audio support in upload 2019-05-16 17:16:47 +02:00
Chocobozzz 3acc508440
Upgrade sequelize 2019-04-24 16:26:21 +02:00
Chocobozzz ae9bbed46d
Update P2P media loader peer version 2019-04-08 11:16:14 +02:00
Chocobozzz 9b39106d57
findById -> findByPk 2019-02-21 14:40:10 +01:00
Chocobozzz 0920929696 Add hls support on server 2019-02-11 09:13:02 +01:00
Chocobozzz 44b9c0ba31
Add totalLocalVideoFilesSize in stats 2019-01-15 09:45:54 +01:00
Chocobozzz dc13348070 Add import finished and video published notifs 2019-01-09 11:15:15 +01:00
Chocobozzz 14e2014acc Support additional video extensions 2018-12-11 15:11:09 +01:00
Chocobozzz 25378bc866
Delete correctly redundancy files 2018-10-03 16:43:57 +02:00
Chocobozzz 2e7cf5ae0c
Fix video files duplicated when fps is null
Null values are not considered equal in a UNIQUE index
2018-09-26 14:08:35 +02:00
Chocobozzz e5565833f6
Improve redundancy: add 'min_lifetime' configuration 2018-09-24 13:38:39 +02:00
Chocobozzz c48e82b5e0 Basic video redundancy implementation 2018-09-13 14:05:49 +02:00
Chocobozzz cc43831a90
Filter tracker based on infohash 2018-08-14 11:00:03 +02:00
Chocobozzz 8cd72bd377 Optimize SQL queries 2018-07-24 14:04:05 +02:00
Chocobozzz 3a6f351b25
Handle higher FPS for high resolution (test) 2018-06-29 17:10:54 +02:00
Chocobozzz 3fd3ab2d34
Move models to typescript-sequelize 2017-12-13 16:50:33 +01:00
Chocobozzz d4f1e94c89
Misc cleanup 2017-11-27 19:40:53 +01:00
Chocobozzz f0adb2701c Modify video file size to bigint 2017-09-22 17:02:31 +02:00
Chocobozzz 93e1258c7c Move video file metadata in their own table
Will be used for user video quotas and multiple video resolutions
2017-08-25 11:36:23 +02:00