Skip to content

Commit

Permalink
Fix: B-adapt 1 should use B-frames 16
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton-Latukha committed Jul 6, 2018
1 parent c9e96ea commit d2c72ca
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/helpers/ffmpeg-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ function transcode (options: TranscodeOptions) {
.videoCodec('libx264')
.outputOption('-threads ' + CONFIG.TRANSCODING.THREADS)
.outputOption('-movflags faststart')
/** NOTE: 'b-adapt 1' aka 'b_strategy 1' is heuristic algorythm,
convergence not depends on the number of allowed B-frames
optimal B-frames option for it is 16 */
.outputOption('-b_strategy 1')
/** NOTE: Use B-frames <= 16 on '-b_strategy 2'
reference: https://github.com/Chocobozzz/PeerTube/pull/774 */
.outputOption('-bf 16')
// .outputOption('-crf 18')

let fps = await getVideoFileFPS(options.inputPath)
Expand Down

0 comments on commit d2c72ca

Please sign in to comment.