Integrate transcription in PeerTube

This commit is contained in:
Chocobozzz
2024-06-13 09:23:12 +02:00
parent ef14cf4a5c
commit 1bfb791e05
172 changed files with 2674 additions and 945 deletions

View File

@@ -4127,7 +4127,7 @@ paths:
/api/v1/videos/{id}/storyboards:
get:
summary: List storyboards of a video
description: "**PeerTube** >= 6.0"
description: "**PeerTube >= 6.0**"
operationId: listVideoStoryboards
tags:
- Video
@@ -4171,6 +4171,32 @@ paths:
items:
$ref: '#/components/schemas/VideoCaption'
/api/v1/videos/{id}/captions/generate:
post:
summary: Generate a video caption
operationId: generateVideoCaption
description: "**PeerTube >= 6.2** This feature has to be enabled by the administrator"
security:
- OAuth2:
- user
tags:
- Video Captions
requestBody:
content:
application/json:
schema:
type: object
properties:
forceTranscription:
type: boolean
default: false
responses:
'204':
description: successful operation
'404':
description: video not found
/api/v1/videos/{id}/captions/{captionLanguage}:
put:
summary: Add or replace a video caption
@@ -4221,7 +4247,7 @@ paths:
/api/v1/videos/{id}/chapters:
get:
summary: Get chapters of a video
description: "**PeerTube** >= 6.0"
description: "**PeerTube >= 6.0**"
operationId: getVideoChapters
tags:
- Video Chapters
@@ -4237,7 +4263,7 @@ paths:
$ref: '#/components/schemas/VideoChapters'
put:
summary: Replace video chapters
description: "**PeerTube** >= 6.0"
description: "**PeerTube >= 6.0**"
operationId: replaceVideoChapters
security:
- OAuth2:
@@ -4270,7 +4296,7 @@ paths:
/api/v1/videos/{id}/passwords:
get:
summary: List video passwords
description: "**PeerTube** >= 6.0"
description: "**PeerTube >= 6.0**"
security:
- OAuth2:
- user
@@ -4292,7 +4318,7 @@ paths:
description: video is not password protected
put:
summary: Update video passwords
description: "**PeerTube** >= 6.0"
description: "**PeerTube >= 6.0**"
security:
- OAuth2:
- user
@@ -4317,7 +4343,7 @@ paths:
/api/v1/videos/{id}/passwords/{videoPasswordId}:
delete:
summary: Delete a video password
description: "**PeerTube** >= 6.0"
description: "**PeerTube >= 6.0**"
security:
- OAuth2:
- user
@@ -8315,7 +8341,7 @@ components:
nullable: true
example: |
"**[Want to help to translate this video?](https://weblate.framasoft.org/projects/what-is-peertube-video/)**\r\n\r\n
**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network,
**Take back the control of your videos! [#JoinPeertube](https://joinpeertube.org)**\r\n*A decentralized video hosting network,
based on free/libre software!*\r\n\r\n**Animation Produced by:** [LILA](https://libreart.info) - [ZeMarmot Team](https://film.zemarmot.net)\r\n
*Directed by* Aryeom\r\n*Assistant* Jehan\r\n**Licence**: [CC-By-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)\r\n\r\n
**Sponsored by** [Framasoft](https://framasoft.org)\r\n\r\n**Music**: [Red Step Forward](http://play.dogmazic.net/song.php?song_id=52491) - CC-By Ken Bushima\r\n\r\n
@@ -9683,6 +9709,9 @@ components:
waitTranscoding:
description: Whether or not we wait transcoding before publish the video
type: boolean
generateTranscription:
description: "**PeerTube >= 6.2** If enabled by the admin, automatically generate a subtitle of the video"
type: boolean
support:
description: A text tell the audience how to support the video creator
example: Please support our work on https://soutenir.framasoft.org/en/ <3

View File

@@ -2,13 +2,15 @@
:warning: **Warning**: dependencies guide is maintained by the community. Some parts may be outdated! :warning:
Main dependencies version supported by PeerTube:
Main dependencies supported by PeerTube:
* `node` >=18.x
* `yarn` 1.x (**must not be >=2.x**)
* `postgres` >=10.x
* `redis-server` >=6.x
* `ffmpeg` >=4.3 (using a ffmpeg static build [is not recommended](https://github.com/Chocobozzz/PeerTube/issues/6308))
* `python` >=3.x
* `pip`
_note_: only **LTS** versions of external dependencies are supported. If no LTS version matching the version constraint is available, only **release** versions are supported.
@@ -48,20 +50,12 @@ _note_: only **LTS** versions of external dependencies are supported. If no LTS
5. Install Python:
On Ubuntu <= bionic (18.04 LTS) or Debian <= Buster:
```
sudo apt update
sudo apt install python-dev
python --version # Should be >= 2.x or >= 3.x
```
On Ubuntu >= focal (20.04 LTS) or Debian >= Bullseye:
```
sudo apt update
sudo apt install python3-dev python-is-python3 # python-is-python2 should also work
python --version # Should be >= 2.x or >= 3.x
sudo apt install python3-dev python3-pip python-is-python3
python --version # Should be >= 3.x
```
6. Install common dependencies:
@@ -85,7 +79,7 @@ sudo systemctl start redis postgresql
1. Run:
```
sudo pacman -S nodejs-lts-fermium yarn ffmpeg postgresql openssl redis git wget unzip python base-devel npm nginx
sudo pacman -S nodejs-lts-fermium yarn ffmpeg postgresql openssl redis git wget unzip python python-pip base-devel npm nginx
```
Now that dependencies are installed, before running PeerTube you should start PostgreSQL and Redis:
@@ -214,7 +208,7 @@ sudo dnf update -y
5. Install PostgreSQL and Python3 and other stuff:
```
sudo dnf install -y nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git python3
sudo dnf install -y nginx postgresql postgresql-server postgresql-contrib openssl gcc-c++ make wget redis git python3 python3-pip
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo PGSETUP_INITDB_OPTIONS='--auth-host=md5' postgresql-setup --initdb --unit postgresql
sudo systemctl enable --now redis

View File

@@ -36,11 +36,17 @@ Ensure you also have these commands:
```bash
exiftool --help
parallel --help
# For transcription tests
whisper --help
whisper-ctranslate2 --help
jiwer --help
```
Otherwise, install the packages. On Debian-based systems (like Debian, Ubuntu or Mint):
```bash
sudo apt-get install parallel libimage-exiftool-perl
sudo pip install -r packages/tests/requirements.txt -r packages/transcription-devtools/requirements.txt
```
### Test