1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Add video aspect ratio in server

This commit is contained in:
Chocobozzz 2024-02-27 11:18:56 +01:00
parent c75381208f
commit b6b1aaa56f
No known key found for this signature in database
GPG key ID: 583A612D890159BE
52 changed files with 345 additions and 237 deletions

View file

@ -328,7 +328,7 @@ class LiveManager {
allResolutions: number[]
hasAudio: boolean
}) {
const { sessionId, videoLive, user } = options
const { sessionId, videoLive, user, ratio } = options
const videoUUID = videoLive.Video.uuid
const localLTags = lTags(sessionId, videoUUID)
@ -345,7 +345,7 @@ class LiveManager {
...pick(options, [ 'inputLocalUrl', 'inputPublicUrl', 'bitrate', 'ratio', 'fps', 'allResolutions', 'hasAudio' ])
})
muxingSession.on('live-ready', () => this.publishAndFederateLive(videoLive, localLTags))
muxingSession.on('live-ready', () => this.publishAndFederateLive({ live: videoLive, ratio, localLTags }))
muxingSession.on('bad-socket-health', ({ videoUUID }) => {
logger.error(
@ -405,7 +405,13 @@ class LiveManager {
})
}
private async publishAndFederateLive (live: MVideoLiveVideo, localLTags: { tags: (string | number)[] }) {
private async publishAndFederateLive (options: {
live: MVideoLiveVideo
ratio: number
localLTags: { tags: (string | number)[] }
}) {
const { live, ratio, localLTags } = options
const videoId = live.videoId
try {
@ -415,6 +421,7 @@ class LiveManager {
video.state = VideoState.PUBLISHED
video.publishedAt = new Date()
video.aspectRatio = ratio
await video.save()
live.Video = video