Skip to content

Commit

Permalink
Merge pull request #55 from Lumen5/LU-3193-file-url
Browse files Browse the repository at this point in the history
add support for file urls
  • Loading branch information
michaeljherrmann authored Jan 18, 2024
2 parents 3b7a407 + 9f38161 commit ee254ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lumen5/framefusion",
"version": "1.0.3",
"version": "1.0.4",
"type": "module",
"scripts": {
"docs": "typedoc framefusion.ts",
Expand Down
6 changes: 5 additions & 1 deletion src/backends/beamcoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ export class BeamcoderExtractor extends BaseExtractor implements Extractor {
inputFileOrUrl = downloadUrl.filepath;
VERBOSE && console.log('finished downloading');
}
this.#demuxer = await beamcoder.demuxer('file:' + inputFileOrUrl);
// Assume file url at this point
if (!inputFileOrUrl.startsWith('file:')) {
inputFileOrUrl = 'file:' + inputFileOrUrl;
}
this.#demuxer = await beamcoder.demuxer(inputFileOrUrl);
this.#streamIndex = this.#demuxer.streams.findIndex(stream => stream.codecpar.codec_type === STREAM_TYPE_VIDEO);
if (this.#streamIndex === -1) {
throw new Error(`File has no ${STREAM_TYPE_VIDEO} stream!`);
Expand Down

0 comments on commit ee254ea

Please sign in to comment.