Merge pull request #235 from jasongdove/ffmpeg-deinterlace
add ffmpeg deinterlace options
This commit is contained in:
commit
edbfce11e7
@ -20,7 +20,7 @@
|
||||
const path = require('path');
|
||||
var fs = require('fs');
|
||||
|
||||
const TARGET_VERSION = 701;
|
||||
const TARGET_VERSION = 702;
|
||||
|
||||
const STEPS = [
|
||||
// [v, v2, x] : if the current version is v, call x(db), and version becomes v2
|
||||
@ -34,6 +34,7 @@ const STEPS = [
|
||||
[ 600, 601, (db) => addFPS(db) ],
|
||||
[ 601, 700, (db) => migrateWatermark(db) ],
|
||||
[ 700, 701, (db) => addScalingAlgorithm(db) ],
|
||||
[ 701, 702, (db) => addDeinterlaceFilter(db) ]
|
||||
]
|
||||
|
||||
const { v4: uuidv4 } = require('uuid');
|
||||
@ -397,6 +398,7 @@ function ffmpeg() {
|
||||
normalizeAudio: true,
|
||||
maxFPS: 60,
|
||||
scalingAlgorithm: "bicubic",
|
||||
deinterlaceFilter: "none"
|
||||
}
|
||||
}
|
||||
|
||||
@ -755,6 +757,12 @@ function addScalingAlgorithm(db) {
|
||||
fs.writeFileSync( f, JSON.stringify( [ffmpegSettings] ) );
|
||||
}
|
||||
|
||||
function addDeinterlaceFilter(db) {
|
||||
let ffmpegSettings = db['ffmpeg-settings'].find()[0];
|
||||
let f = path.join(process.env.DATABASE, 'ffmpeg-settings.json');
|
||||
ffmpegSettings.deinterlaceFilter = "none";
|
||||
fs.writeFileSync( f, JSON.stringify( [ffmpegSettings] ) );
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
initDB: initDB,
|
||||
|
||||
@ -165,6 +165,12 @@ class FFMPEG extends events.EventEmitter {
|
||||
currentVideo ="[fpchange]";
|
||||
}
|
||||
|
||||
// deinterlace if desired
|
||||
if (streamStats.videoScanType == 'interlaced' && this.opts.deinterlaceFilter != 'none') {
|
||||
videoComplex += `;${currentVideo}${this.opts.deinterlaceFilter}[deinterlaced]`;
|
||||
currentVideo = "[deinterlaced]";
|
||||
}
|
||||
|
||||
// prepare input streams
|
||||
if ( typeof(streamUrl.errorTitle) !== 'undefined') {
|
||||
doOverlay = false; //never show icon in the error screen
|
||||
|
||||
@ -236,6 +236,7 @@ lang=en`
|
||||
// Rounding framerate avoids scenarios where
|
||||
// 29.9999999 & 30 don't match.
|
||||
ret.videoDecision = (typeof stream.decision === 'undefined') ? 'copy' : stream.decision;
|
||||
ret.videoScanType = stream.scanType;
|
||||
}
|
||||
// Audio. Only look at stream being used
|
||||
if (stream["streamType"] == "2" && stream["selected"] == "1") {
|
||||
|
||||
@ -66,6 +66,14 @@ module.exports = function (dizquetv, resolutionOptions) {
|
||||
{id: "lanczos", description: "lanczos"},
|
||||
{id: "spline", description: "spline"},
|
||||
];
|
||||
scope.deinterlaceOptions = [
|
||||
{value: "none", description: "do not deinterlace"},
|
||||
{value: "bwdif=0", description: "bwdif send frame"},
|
||||
{value: "bwdif=1", description: "bwdif send field"},
|
||||
{value: "w3fdif", description: "w3fdif"},
|
||||
{value: "yadif=0", description: "yadif send frame"},
|
||||
{value: "yadif=1", description: "yadif send field"}
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -103,6 +103,11 @@
|
||||
ng-options="o.id as o.description for o in scalingOptions" ></select>
|
||||
<small id='scalingHelp' class='form-text text-muted'>Scaling algorithm to use when the transcoder needs to change the video size.</small>
|
||||
|
||||
<br />
|
||||
<label>Deinterlace Filter</label>
|
||||
<select class='form-control custom-select' ng-model="settings.deinterlaceFilter" ria-describedby="deinterlaceHelp"
|
||||
ng-options="o.value as o.description for o in deinterlaceOptions" ></select>
|
||||
<small id='deinterlaceHelp' class='form-text text-muted'>Deinterlace filter to use when video is interlaced. This is only needed when Plex transcoding is not used.</small>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user