Skip to content

Commit

Permalink
Merge pull request #785 from HaveAGitGat/streams
Browse files Browse the repository at this point in the history
feat: update error message when no stream data
  • Loading branch information
HaveAGitGat authored Feb 25, 2025
2 parents 41ec366 + 0f82b58 commit 1d893f3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,19 @@ var plugin = function (args) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
args.inputs = lib.loadDefaultValues(args.inputs, details);
var container = (0, fileUtils_1.getContainer)(args.inputFileObj._id);
var streams = [];
try {
streams = JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams));
}
catch (err) {
var message = "Error parsing FFprobe streams, it seems FFprobe could not scan the file: ".concat(JSON.stringify(err));
args.jobLog(message);
throw new Error(message);
}
var ffmpegCommand = {
init: true,
inputFiles: [],
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map(function (stream) { return (__assign(__assign({}, stream), { removed: false, mapArgs: [
streams: streams.map(function (stream) { return (__assign(__assign({}, stream), { removed: false, mapArgs: [
'-map',
"0:".concat(stream.index),
], inputArgs: [], outputArgs: [] })); }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,20 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {

const container = getContainer(args.inputFileObj._id);

let streams = [];

try {
streams = JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams));
} catch (err) {
const message = `Error parsing FFprobe streams, it seems FFprobe could not scan the file: ${JSON.stringify(err)}`;
args.jobLog(message);
throw new Error(message);
}

const ffmpegCommand = {
init: true,
inputFiles: [],
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map((stream:Istreams) => ({
streams: streams.map((stream:Istreams) => ({
...stream,
removed: false,
mapArgs: [
Expand Down

0 comments on commit 1d893f3

Please sign in to comment.