diff options
author | Chocobozzz <me@florianbigard.com> | 2022-01-06 17:55:37 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-01-06 17:55:37 +0100 |
commit | cbe2f36d93c779ca08424336be7e3988e57be01d (patch) | |
tree | 49b46f450d6cabbd3b3b86dc25d0e3f3a2b4ab94 /server/models/video/video.ts | |
parent | 78a5dd9c69af1b1fcae48a25053b569aa0eae626 (diff) | |
download | PeerTube-cbe2f36d93c779ca08424336be7e3988e57be01d.tar.gz PeerTube-cbe2f36d93c779ca08424336be7e3988e57be01d.tar.zst PeerTube-cbe2f36d93c779ca08424336be7e3988e57be01d.zip |
Fix audio transcoding with video only file
Diffstat (limited to 'server/models/video/video.ts')
-rw-r--r-- | server/models/video/video.ts | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts index e5077487a..12b937574 100644 --- a/server/models/video/video.ts +++ b/server/models/video/video.ts | |||
@@ -33,7 +33,7 @@ import { VideoPathManager } from '@server/lib/video-path-manager' | |||
33 | import { getServerActor } from '@server/models/application/application' | 33 | import { getServerActor } from '@server/models/application/application' |
34 | import { ModelCache } from '@server/models/model-cache' | 34 | import { ModelCache } from '@server/models/model-cache' |
35 | import { buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils' | 35 | import { buildVideoEmbedPath, buildVideoWatchPath, pick } from '@shared/core-utils' |
36 | import { uuidToShort } from '@shared/extra-utils' | 36 | import { ffprobePromise, getAudioStream, uuidToShort } from '@shared/extra-utils' |
37 | import { | 37 | import { |
38 | ResultList, | 38 | ResultList, |
39 | ThumbnailType, | 39 | ThumbnailType, |
@@ -1678,12 +1678,20 @@ export class VideoModel extends Model<Partial<AttributesOnly<VideoModel>>> { | |||
1678 | return peertubeTruncate(this.description, { length: maxLength }) | 1678 | return peertubeTruncate(this.description, { length: maxLength }) |
1679 | } | 1679 | } |
1680 | 1680 | ||
1681 | getMaxQualityResolution () { | 1681 | getMaxQualityFileInfo () { |
1682 | const file = this.getMaxQualityFile() | 1682 | const file = this.getMaxQualityFile() |
1683 | const videoOrPlaylist = file.getVideoOrStreamingPlaylist() | 1683 | const videoOrPlaylist = file.getVideoOrStreamingPlaylist() |
1684 | 1684 | ||
1685 | return VideoPathManager.Instance.makeAvailableVideoFile(file.withVideoOrPlaylist(videoOrPlaylist), originalFilePath => { | 1685 | return VideoPathManager.Instance.makeAvailableVideoFile(file.withVideoOrPlaylist(videoOrPlaylist), async originalFilePath => { |
1686 | return getVideoFileResolution(originalFilePath) | 1686 | const probe = await ffprobePromise(originalFilePath) |
1687 | |||
1688 | const { audioStream } = await getAudioStream(originalFilePath, probe) | ||
1689 | |||
1690 | return { | ||
1691 | audioStream, | ||
1692 | |||
1693 | ...await getVideoFileResolution(originalFilePath, probe) | ||
1694 | } | ||
1687 | }) | 1695 | }) |
1688 | } | 1696 | } |
1689 | 1697 | ||