mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 09:49:20 +02:00
Fix live replay audio/video desync
This commit is contained in:
parent
a6a3f00be4
commit
0390864755
1 changed files with 17 additions and 14 deletions
|
@ -60,7 +60,7 @@ export interface MergeAudioTranscodeOptions extends BaseTranscodeVODOptions {
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TranscodeVODOptions =
|
export type TranscodeVODOptions =
|
||||||
HLSTranscodeOptions
|
| HLSTranscodeOptions
|
||||||
| HLSFromTSTranscodeOptions
|
| HLSFromTSTranscodeOptions
|
||||||
| VideoTranscodeOptions
|
| VideoTranscodeOptions
|
||||||
| MergeAudioTranscodeOptions
|
| MergeAudioTranscodeOptions
|
||||||
|
@ -79,7 +79,7 @@ export class FFmpegVOD {
|
||||||
|
|
||||||
async transcode (options: TranscodeVODOptions) {
|
async transcode (options: TranscodeVODOptions) {
|
||||||
const builders: {
|
const builders: {
|
||||||
[ type in TranscodeVODOptionsType ]: (options: TranscodeVODOptions) => Promise<void> | void
|
[type in TranscodeVODOptionsType]: (options: TranscodeVODOptions) => Promise<void> | void
|
||||||
} = {
|
} = {
|
||||||
'quick-transcode': this.buildQuickTranscodeCommand.bind(this),
|
'quick-transcode': this.buildQuickTranscodeCommand.bind(this),
|
||||||
'hls': this.buildHLSVODCommand.bind(this),
|
'hls': this.buildHLSVODCommand.bind(this),
|
||||||
|
@ -108,11 +108,13 @@ export class FFmpegVOD {
|
||||||
return this.ended
|
return this.ended
|
||||||
}
|
}
|
||||||
|
|
||||||
private async buildVODCommand (options: TranscodeVODOptions & {
|
private async buildVODCommand (
|
||||||
|
options: TranscodeVODOptions & {
|
||||||
videoStreamOnly?: boolean
|
videoStreamOnly?: boolean
|
||||||
canCopyAudio?: boolean
|
canCopyAudio?: boolean
|
||||||
canCopyVideo?: boolean
|
canCopyVideo?: boolean
|
||||||
}) {
|
}
|
||||||
|
) {
|
||||||
const {
|
const {
|
||||||
resolution,
|
resolution,
|
||||||
fps,
|
fps,
|
||||||
|
@ -227,6 +229,7 @@ export class FFmpegVOD {
|
||||||
const videoPath = this.getHLSVideoPath(options)
|
const videoPath = this.getHLSVideoPath(options)
|
||||||
|
|
||||||
command.outputOption('-c copy')
|
command.outputOption('-c copy')
|
||||||
|
command.outputOption('-copyts')
|
||||||
|
|
||||||
if (options.isAAC) {
|
if (options.isAAC) {
|
||||||
// Required for example when copying an AAC stream from an MPEG-TS
|
// Required for example when copying an AAC stream from an MPEG-TS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue