From 22b85e32108926cdcf56d8340a319365a9587616 Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:24:23 +0200 Subject: [PATCH 01/14] test: add some logs --- lib/transloadit.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/transloadit.js b/lib/transloadit.js index f7f1771..b1a18dc 100644 --- a/lib/transloadit.js +++ b/lib/transloadit.js @@ -42,6 +42,9 @@ export const createTransloaditConcat = (fields) => { use.steps.push({ name: as, as }) }) + console.log(JSON.stringify(use)) + console.log(JSON.stringify(steps)) + const options = { params: { fields, From 2a4349906d1c9d21c43eb4119d01f5073a533de5 Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Fri, 29 Sep 2023 15:56:35 +0200 Subject: [PATCH 02/14] fix(transloadit): try fix recommended by transloadit --- lib/transloadit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/transloadit.js b/lib/transloadit.js index b1a18dc..3f8cfa2 100644 --- a/lib/transloadit.js +++ b/lib/transloadit.js @@ -39,7 +39,7 @@ export const createTransloaditConcat = (fields) => { force_name: as, } - use.steps.push({ name: as, as }) + use.steps.push({ name: as, as: `audio_${String(index)}` }) }) console.log(JSON.stringify(use)) From 4645eee48edce336830ddfc1796e6d5a4ca4f959 Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Fri, 29 Sep 2023 16:58:47 +0200 Subject: [PATCH 03/14] fix: adapt params as in transloadit api doc --- lib/transloadit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/transloadit.js b/lib/transloadit.js index 3f8cfa2..e8e9869 100644 --- a/lib/transloadit.js +++ b/lib/transloadit.js @@ -39,7 +39,7 @@ export const createTransloaditConcat = (fields) => { force_name: as, } - use.steps.push({ name: as, as: `audio_${String(index)}` }) + use.steps.push({ name: as, as: `audio_${index+1}` }) }) console.log(JSON.stringify(use)) @@ -50,7 +50,7 @@ export const createTransloaditConcat = (fields) => { fields, steps: { ...steps, - concat: { + concatenated: { robot: '/audio/concat', bitrate: 48000, sample_rate: 24000, From 843be063c6441a1656328f93ea9218970e244471 Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Fri, 29 Sep 2023 17:07:26 +0200 Subject: [PATCH 04/14] fix: remove logs used for testing --- lib/transloadit.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/transloadit.js b/lib/transloadit.js index e8e9869..3a447bd 100644 --- a/lib/transloadit.js +++ b/lib/transloadit.js @@ -42,9 +42,6 @@ export const createTransloaditConcat = (fields) => { use.steps.push({ name: as, as: `audio_${index+1}` }) }) - console.log(JSON.stringify(use)) - console.log(JSON.stringify(steps)) - const options = { params: { fields, From 75201efee8af8cb52010abc025dd47fb620f90f5 Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Fri, 29 Sep 2023 17:19:47 +0200 Subject: [PATCH 05/14] test: try to change ffmpeg stack --- lib/transloadit.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/transloadit.js b/lib/transloadit.js index 3a447bd..fff9f22 100644 --- a/lib/transloadit.js +++ b/lib/transloadit.js @@ -52,6 +52,7 @@ export const createTransloaditConcat = (fields) => { bitrate: 48000, sample_rate: 24000, use, + ffmpeg_stack: "v6.0.0", }, }, ...(PUBLIC_URL && { notify_url: `${PUBLIC_URL}/webhook/transloadit` }), From dbe0563314617c7650f7db3bf771df083c4d8ec6 Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Fri, 29 Sep 2023 17:42:21 +0200 Subject: [PATCH 06/14] test: log stuff from transloadit --- lib/notify.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/notify.js b/lib/notify.js index 5f28c5b..30f4925 100644 --- a/lib/notify.js +++ b/lib/notify.js @@ -41,6 +41,8 @@ const post = (url, body) => { export const notifyProduction = async (production) => { const debug = _debug('notify:production') + console.log('---------' + production) + const { webhookUrl, audioData } = production if (!webhookUrl) { debug('missing webhookUrl %o', production) From c996b9a0fa76f6c40457bb1633168e604b6f0e14 Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Fri, 29 Sep 2023 17:57:58 +0200 Subject: [PATCH 07/14] fix: changed prop name --- lib/transloadit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/transloadit.js b/lib/transloadit.js index fff9f22..1a39a61 100644 --- a/lib/transloadit.js +++ b/lib/transloadit.js @@ -85,8 +85,8 @@ export const get = async (body) => { const speakablesHash = fields?.speakablesHash const derivativeId = fields?.derivativeId const webhookUrl = fields?.webhookUrl - const audioUrl = results?.concat?.[0]?.ssl_url - const audioDuration = results?.concat?.[0]?.meta.duration + const audioUrl = results?.concatenate?.[0]?.ssl_url + const audioDuration = results?.concatenate?.[0]?.meta.duration const audioData = await fetch(audioUrl) .then((res) => { From 26134df21524b4e7f4d22022b1815b1d0aa27cb2 Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Fri, 29 Sep 2023 18:00:45 +0200 Subject: [PATCH 08/14] test: add audioUrl to debug --- lib/transloadit.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/transloadit.js b/lib/transloadit.js index 1a39a61..f661574 100644 --- a/lib/transloadit.js +++ b/lib/transloadit.js @@ -87,6 +87,8 @@ export const get = async (body) => { const webhookUrl = fields?.webhookUrl const audioUrl = results?.concatenate?.[0]?.ssl_url const audioDuration = results?.concatenate?.[0]?.meta.duration + + debug('audioUrl: ' + audioUrl) const audioData = await fetch(audioUrl) .then((res) => { From 9d734345458415d8fd32a30f6d26bb037c4747ae Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Fri, 29 Sep 2023 18:04:18 +0200 Subject: [PATCH 09/14] test: more debugging --- lib/transloadit.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/transloadit.js b/lib/transloadit.js index f661574..7795f79 100644 --- a/lib/transloadit.js +++ b/lib/transloadit.js @@ -81,6 +81,8 @@ export const get = async (body) => { throw new TransloaditError(error, fields) } + debug('results:' + results) + const documentId = fields?.documentId const speakablesHash = fields?.speakablesHash const derivativeId = fields?.derivativeId From c82cebadaefd0999956ac66cd679b4092525727f Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:23:29 +0200 Subject: [PATCH 10/14] fix: revert previous changes as they didn't solve the problem --- lib/notify.js | 2 -- lib/transloadit.js | 12 ++++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/notify.js b/lib/notify.js index 30f4925..5f28c5b 100644 --- a/lib/notify.js +++ b/lib/notify.js @@ -41,8 +41,6 @@ const post = (url, body) => { export const notifyProduction = async (production) => { const debug = _debug('notify:production') - console.log('---------' + production) - const { webhookUrl, audioData } = production if (!webhookUrl) { debug('missing webhookUrl %o', production) diff --git a/lib/transloadit.js b/lib/transloadit.js index 7795f79..9c6a396 100644 --- a/lib/transloadit.js +++ b/lib/transloadit.js @@ -39,7 +39,7 @@ export const createTransloaditConcat = (fields) => { force_name: as, } - use.steps.push({ name: as, as: `audio_${index+1}` }) + use.steps.push({ name: as, as }) }) const options = { @@ -47,7 +47,7 @@ export const createTransloaditConcat = (fields) => { fields, steps: { ...steps, - concatenated: { + concat: { robot: '/audio/concat', bitrate: 48000, sample_rate: 24000, @@ -81,16 +81,12 @@ export const get = async (body) => { throw new TransloaditError(error, fields) } - debug('results:' + results) - const documentId = fields?.documentId const speakablesHash = fields?.speakablesHash const derivativeId = fields?.derivativeId const webhookUrl = fields?.webhookUrl - const audioUrl = results?.concatenate?.[0]?.ssl_url - const audioDuration = results?.concatenate?.[0]?.meta.duration - - debug('audioUrl: ' + audioUrl) + const audioUrl = results?.concat?.[0]?.ssl_url + const audioDuration = results?.concat?.[0]?.meta.duration const audioData = await fetch(audioUrl) .then((res) => { From fabfeb1dd0b108c8af802ae97cf8a29b31223b0e Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:23:48 +0200 Subject: [PATCH 11/14] fix: try using newer ffmpeg version --- lib/transloadit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/transloadit.js b/lib/transloadit.js index 9c6a396..f626b80 100644 --- a/lib/transloadit.js +++ b/lib/transloadit.js @@ -52,7 +52,7 @@ export const createTransloaditConcat = (fields) => { bitrate: 48000, sample_rate: 24000, use, - ffmpeg_stack: "v6.0.0", + ffmpeg_stack: "v5.0.0", }, }, ...(PUBLIC_URL && { notify_url: `${PUBLIC_URL}/webhook/transloadit` }), From 4a7f2dedbb655fc8cb5e55353fd8b678289d78fe Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Mon, 2 Oct 2023 13:54:17 +0200 Subject: [PATCH 12/14] fix: try to (crudely) reduce number of files --- lib/pipelines.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/pipelines.js b/lib/pipelines.js index 8a5526c..1e204a7 100644 --- a/lib/pipelines.js +++ b/lib/pipelines.js @@ -75,7 +75,15 @@ export const produce = async (body) => { const upload = createSpeakablesUploader(pathPrefix, storage) - const speakablesHash = getSpeakablesHash(speakables) + // test reducing speakables to 20 always + let reducedSpeakables + if (speakables.length >= 20) { + reducedSpeakables = speakables.slice(0,20) + } else { + reducedSpeakables = speakables + } + + const speakablesHash = getSpeakablesHash(reducedSpeakables) debug('speakablesHash', speakablesHash) const concat = createTransloaditConcat({ @@ -85,7 +93,7 @@ export const produce = async (body) => { webhookUrl, }) - await synthesize(speakables) + await synthesize(reducedSpeakables) .then(upload) .then(concat) .catch((e) => { From 9aff755a1cbac46d4f06ac083eca2455236f59a5 Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:56:08 +0200 Subject: [PATCH 13/14] fix: test 30 files --- lib/pipelines.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pipelines.js b/lib/pipelines.js index 1e204a7..fbdbc3e 100644 --- a/lib/pipelines.js +++ b/lib/pipelines.js @@ -75,10 +75,10 @@ export const produce = async (body) => { const upload = createSpeakablesUploader(pathPrefix, storage) - // test reducing speakables to 20 always + // test reducing speakables to 30 always let reducedSpeakables - if (speakables.length >= 20) { - reducedSpeakables = speakables.slice(0,20) + if (speakables.length >= 30) { + reducedSpeakables = speakables.slice(0,30) } else { reducedSpeakables = speakables } From 76ca25a8c7a5809b30814e3f1b004f2ad530c5d3 Mon Sep 17 00:00:00 2001 From: Luciana Kolbeck <8088524+lucianak@users.noreply.github.com> Date: Mon, 2 Oct 2023 17:58:34 +0200 Subject: [PATCH 14/14] fix: test 25 files --- lib/pipelines.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/pipelines.js b/lib/pipelines.js index fbdbc3e..aad950c 100644 --- a/lib/pipelines.js +++ b/lib/pipelines.js @@ -75,10 +75,10 @@ export const produce = async (body) => { const upload = createSpeakablesUploader(pathPrefix, storage) - // test reducing speakables to 30 always + // test reducing speakables to 25 always let reducedSpeakables - if (speakables.length >= 30) { - reducedSpeakables = speakables.slice(0,30) + if (speakables.length >= 25) { + reducedSpeakables = speakables.slice(0,25) } else { reducedSpeakables = speakables }