@ -30,6 +30,19 @@ var details = function () { return ({
} ,
} ,
tooltip : 'Specify the container to use' ,
tooltip : 'Specify the container to use' ,
} ,
} ,
{
name : 'forceConform' ,
type : 'boolean' ,
defaultValue : 'false' ,
inputUI : {
type : 'dropdown' ,
options : [
'false' ,
'true' ,
] ,
} ,
tooltip : "\nSpecify if you want to force conform the file to the new container,\nThis is useful if not all streams are supported by the new container. \nFor example mkv does not support data streams.\n " ,
} ,
] ,
] ,
outputs : [
outputs : [
{
{
@ -45,9 +58,42 @@ var plugin = function (args) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
args . inputs = lib . loadDefaultValues ( args . inputs , details ) ;
args . inputs = lib . loadDefaultValues ( args . inputs , details ) ;
var newContainer = String ( args . inputs . container ) ;
var newContainer = String ( args . inputs . container ) ;
var forceConform = args . inputs . forceConform ;
if ( ( 0 , fileUtils _1 . getContainer ) ( args . inputFileObj . _id ) !== args . inputs . container ) {
if ( ( 0 , fileUtils _1 . getContainer ) ( args . inputFileObj . _id ) !== args . inputs . container ) {
args . variables . ffmpegCommand . container = newContainer ;
args . variables . ffmpegCommand . container = newContainer ;
args . variables . ffmpegCommand . shouldProcess = true ;
args . variables . ffmpegCommand . shouldProcess = true ;
if ( forceConform === true ) {
for ( var i = 0 ; i < args . variables . ffmpegCommand . streams . length ; i += 1 ) {
var stream = args . variables . ffmpegCommand . streams [ i ] ;
try {
var codecType = stream . codec _type . toLowerCase ( ) ;
var codecName = stream . codec _name . toLowerCase ( ) ;
if ( newContainer === 'mkv' ) {
if ( codecType === 'data'
|| [
'mov_text' ,
'eia_608' ,
'timed_id3' ,
] . includes ( codecName ) ) {
stream . removed = true ;
}
}
if ( newContainer === 'mp4' ) {
if ( [
'hdmv_pgs_subtitle' ,
'eia_608' ,
'timed_id3' ,
'subrip' ,
] . includes ( codecName ) ) {
stream . removed = true ;
}
}
}
catch ( err ) {
// Error
}
}
}
}
}
return {
return {
outputFileObj : args . inputFileObj ,
outputFileObj : args . inputFileObj ,