Commit Graph

51 Commits (18c53ef9492fc7c304b77badce3a47df519db6e7)

Author SHA1 Message Date
Chocobozzz 0c9668f779 Implement remote runner jobs in server
Move ffmpeg functions to @shared
2023-05-09 08:57:34 +02:00
Chocobozzz a3b472a12e
Add ability to list imports of a channel sync 2022-08-10 14:32:00 +02:00
Chocobozzz 0567049a98
Add missing job types to admin panel 2022-08-10 10:34:39 +02:00
Florent 2a491182e4
Channel sync (#5135)
* Add external channel URL for channel update / creation (#754)

* Disallow synchronisation if user has no video quota (#754)

* More constraints serverside (#754)

* Disable sync if server configuration does not allow HTTP import (#754)

* Working version synchronizing videos with a job (#754)

TODO: refactoring, too much code duplication

* More logs and try/catch (#754)

* Fix eslint error (#754)

* WIP: support synchronization time change (#754)

* New frontend #754

* WIP: Create sync front (#754)

* Enhance UI, sync creation form (#754)

* Warning message when HTTP upload is disallowed

* More consistent names (#754)

* Binding Front with API (#754)

* Add a /me API (#754)

* Improve list UI (#754)

* Implement creation and deletion routes (#754)

* Lint (#754)

* Lint again (#754)

* WIP: UI for triggering import existing videos (#754)

* Implement jobs for syncing and importing channels

* Don't sync videos before sync creation + avoid concurrency issue (#754)

* Cleanup (#754)

* Cleanup: OpenAPI + API rework (#754)

* Remove dead code (#754)

* Eslint (#754)

* Revert the mess with whitespaces in constants.ts (#754)

* Some fixes after rebase (#754)

* Several fixes after PR remarks (#754)

* Front + API: Rename video-channels-sync to video-channel-syncs (#754)

* Allow enabling channel sync through UI (#754)

* getChannelInfo (#754)

* Minor fixes: openapi + model + sql (#754)

* Simplified API validators (#754)

* Rename MChannelSync to MChannelSyncChannel (#754)

* Add command for VideoChannelSync (#754)

* Use synchronization.enabled config (#754)

* Check parameters test + some fixes (#754)

* Fix conflict mistake (#754)

* Restrict access to video channel sync list API (#754)

* Start adding unit test for synchronization (#754)

* Continue testing (#754)

* Tests finished + convertion of job to scheduler (#754)

* Add lastSyncAt field (#754)

* Fix externalRemoteUrl sort + creation date not well formatted (#754)

* Small fix (#754)

* Factorize addYoutubeDLImport and buildVideo (#754)

* Check duplicates on channel not on users (#754)

* factorize thumbnail generation (#754)

* Fetch error should return status 400 (#754)

* Separate video-channel-import and video-channel-sync-latest (#754)

* Bump DB migration version after rebase (#754)

* Prettier states in UI table (#754)

* Add DefaultScope in VideoChannelSyncModel (#754)

* Fix audit logs (#754)

* Ensure user can upload when importing channel + minor fixes (#754)

* Mark synchronization as failed on exception + typos (#754)

* Change REST API for importing videos into channel (#754)

* Add option for fully synchronize a chnanel (#754)

* Return a whole sync object on creation to avoid tricks in Front (#754)

* Various remarks (#754)

* Single quotes by default (#754)

* Rename synchronization to video_channel_synchronization

* Add check.latest_videos_count and max_per_user options (#754)

* Better channel rendering in list #754

* Allow sorting with channel name and state (#754)

* Add missing tests for channel imports (#754)

* Prefer using a parent job for channel sync

* Styling

* Client styling

Co-authored-by: Chocobozzz <me@florianbigard.com>
2022-08-10 09:53:39 +02:00
Chocobozzz bd911b54b5
Use bullmq job dependency 2022-08-09 09:18:07 +02:00
Chocobozzz 5a921e7b74
Move to bullmq 2022-08-09 09:18:07 +02:00
Chocobozzz 84cae54e7a
Add option to not transcode original resolution 2022-08-09 09:18:07 +02:00
Chocobozzz f27b7a750f
Send views in a dedicated queue 2022-06-17 14:08:13 +02:00
Chocobozzz cdd838168d
Fix live ending job that breaks new live session 2022-06-16 13:39:57 +02:00
Chocobozzz 26e3e98ff0
Support live session in server 2022-05-03 14:49:15 +02:00
Chocobozzz 4ec52d04dc
Add ability to save replay of permanent lives 2022-04-21 11:47:57 +02:00
Chocobozzz a219c9100b
Refactor AP context builder 2022-03-24 09:40:46 +01:00
Chocobozzz 92e66e04f7
Rename studio to editor 2022-03-22 17:24:32 +01:00
Chocobozzz 1808a1f8e4
Add video edition finished notification 2022-03-22 16:25:14 +01:00
Chocobozzz 57e4e1c1a9
Don't store remote rates of remote videos
In the future we'll stop to expose all available rates to improve users
privacy
2022-03-18 11:21:50 +01:00
Chocobozzz f012319a64
Process video torrents in order
Prevent update before video torrent generation for example
2022-03-16 15:45:58 +01:00
Chocobozzz c729caf6cc Add basic video editor support 2022-02-28 10:42:19 +01:00
Chocobozzz 0f11ec8dd3
Prevent HLS transcoding after webtorrent transcoding 2022-02-01 11:27:38 +01:00
Chocobozzz cbe2f36d93
Fix audio transcoding with video only file 2022-01-06 17:55:37 +01:00
Chocobozzz ad5db1044c
Add ability to run transcoding jobs 2021-11-18 15:20:57 +01:00
Chocobozzz 51353d9a03 Refactor video views
Introduce viewers attribute for live videos
Count views for live videos
Reduce delay to see the viewer update for lives
Add ability to configure video views buffer interval and view ip
expiration
2021-11-09 15:00:31 +01:00
Rigel Kent 276250f0a3
prevent multiple post-process triggering of upload-resumable (#4175)
* prevent multiple post-process triggering of upload-resumable

* switch from 409 to 503 for upload being processed

* Improve resumable upload check

Co-authored-by: Chocobozzz <me@florianbigard.com>
2021-10-25 17:42:20 +02:00
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 37a44fc915 Add ability to search playlists 2021-06-25 14:44:01 +02:00
Chocobozzz db4b15f21f
Use got instead of request 2021-03-24 18:18:40 +01:00
Chocobozzz 74d249bc13
Add ability to cleanup remote AP interactions 2021-03-03 10:08:08 +01:00
Chocobozzz 8795d6f254
Fix broken local actors
Some channels can't federate because they don't have public/private
keys, maybe because the generation failed for various reasons
2021-02-26 14:22:25 +01:00
Chocobozzz e3b4c084cd
Guess if we need to generate the thumbnail for imports 2021-02-12 09:37:01 +01:00
Chocobozzz 9129b7694d Allow to specify transcoding and import jobs concurrency 2021-02-08 15:38:45 +01:00
Chocobozzz 77d7e851dc Add priority to transcoding jobs
(1 = highest priority)

100 for new resolutions
10 for original file optimization

Add a malus for transcoding jobs depending on how many uploads the user did in the
last 7 days
2021-01-25 14:38:52 +01:00
Chocobozzz 24516aa26a
Refactor transcoding job handlers 2021-01-21 15:58:17 +01:00
Chocobozzz 3b01f4c0ac
Support progress for ffmpeg tasks 2021-01-21 14:42:43 +01:00
Chocobozzz 805b8619c1
Fix (again) youtube import 2021-01-19 16:36:21 +01:00
Rigel Kent 454c20fa7c
stricter youtubedl format selectors (#3516)
* stricter youtubedl format selectors

make sure selectors avoid av1, and otherwise match as closely to the
maximum resolution enabled for transcoding

* add support for merge formats in youtubedl

* avoid vp9.2 in youtubedl to avoid any HDR

* move getEnabledResolutions, safer replace of imported extension

* add test for youtube-dl selectors
2021-01-15 15:56:56 +01:00
Chocobozzz 402145b863
Refactor jobs state 2020-12-14 12:00:35 +01:00
Chocobozzz a5cf76afa3 Add watch messages if live has not started 2020-11-09 15:33:04 +01:00
Chocobozzz 0fecf427d3
Don't use @shared in models
So other projects can use them
2020-08-27 09:58:27 +02:00
Rigel Kent 2158ac9034
Add server plugin filter hooks for import with torrent and url (#2621)
* Add server plugin filter hooks for import with torrent and url

* WIP: pre and post-import filter hooks

* Rebased

* Cleanup filters to accept imports

Co-authored-by: Chocobozzz <me@florianbigard.com>
2020-05-14 11:10:26 +02:00
Chocobozzz e307e4fce3 Add ability for auth plugins to hook tokens validity 2020-05-04 16:21:39 +02:00
Chocobozzz 8dc8a34ee8 Avoir some circular dependencies 2020-05-04 16:21:39 +02:00
Chocobozzz a15871560f
Move to eslint 2020-02-03 08:31:02 +01:00
Chocobozzz b764380ac2 Add ability to list redundancies 2020-01-28 11:35:26 +01:00
Chocobozzz 1061c73fde
Add ability to filter per job type 2019-12-04 14:49:59 +01:00
Chocobozzz a0327eedb0
Rename video-file job to video-transcoding 2019-03-19 17:00:08 +01:00
Chocobozzz 04b8c3fba6
Delete invalid or deleted remote videos 2018-11-20 10:44:48 +01:00
Chocobozzz 6b6168606b
Bufferize videos views in redis 2018-08-30 15:03:18 +02:00
Chocobozzz fbad87b047 Add ability to import video with youtube-dl 2018-08-06 11:19:16 +02:00
Chocobozzz 94831479f5 Migrate to bull 2018-07-11 14:00:17 +02:00
Florent Fayolle 0138af9237 Add create-import-video-file-job command 2018-06-07 08:57:48 +02:00
Chocobozzz 5350fd8e5b
Move server follow in the job queue
It helps to track follow errors
2018-04-18 15:32:40 +02:00