Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with change files name in work path in new version nexrender and don't work action-encode input #1033

Open
RezaRamezanisani opened this issue Nov 28, 2024 · 1 comment

Comments

@RezaRamezanisani
Copy link

i wan to add pre-render action to do encode video file in work path but when i set input and output encode i think don't work
this is my postrender action in json :

"assets": [ { "src": "[https://dl.viditor.net/uploads/users/93701_b209470a3db39ee3a0c5fa2e8fb166ee/userProjects/4752_flyermotion-white/350599/1080x1920-6745e9fde9aa4.mp4](https://l.ble.ir/?l=https%3A%2F%2Fdl.viditor.net%2Fuploads%2Fusers%2F93701_b209470a3db39ee3a0c5fa2e8fb166ee%2FuserProjects%2F4752_flyermotion-white%2F350599%2F1080x1920-6745e9fde9aa4.mp4&spec=eyJzcCI6IjE5NDc3MDQxMTAiLCJjcCI6IjE5NDc3MDQxMTAifQ%3D%3D)", "type": "video", "layerName": "mediaHolder_02.mp4", "composition": "media02" }],"actions": { "prerender": [ { "module": "@nexrender/action-encode", "input": "1080x1920-6745e3e1b8331.mp4", "output": "copy_1080x1920-6745e3e1b8331.mp4", "params": { "-ss": "0", "-to": "4.3263012354489", "-acodec": "aac", "-ab": "128k", "-ar": "44100", "-vcodec": "libx264", "-r": "25" } },

this is my error :
image png(1)
image png

this problem not in older version , i think this error maybe in new version action encode or downloading file with add unique name like in image , how to fix? you have any option to dont do add unique title in first name of files in work path ?

please help what to do ?

@nazemi0101
Copy link

this is because add this line in
packages/nexrender-core/src/tasks/download.js
in new version add this line to add random name

if comment maybe work
` /* if asset doesnt have a file name, make up a random one /
if (protocol === 'data' && !asset.layerName) {
destName = Math.random().toString(36).substring(2);
} else {
destName = path.basename(asset.src)
destName = destName.indexOf('?') !== -1 ? destName.slice(0, destName.indexOf('?')) : destName;
/
^ remove possible query search string params ^ /
destName = decodeURI(destName) /
< remove/decode any special URI symbols within filename */

    /* prevent duplicate filename collisions during parallel fetch */
    if (!asset.sequence) {
        destName = Math.random().toString(36).substring(2) + '-' + destName;
    }
}`

 @inlife 

can you add option in actions or action-encode to when we use input , can find new file name in input in relative path workpath and do
like this :
in assets
{
"type": "video", "layerName": "mediaHolder_02.mp4", "composition": "media02",
"src": "[...........93701_b209470a3db39ee3a0c5fa2e8fb166ee/userProjects/4752_flyermotion-white/350599/1080x1920-6745e9fde9aa4.mp4
}
in action encode
like when we add assets in action encode input
"input": "1080x1920-6745e3e1b8331.mp4"
action can find assets with new name and can do action
"input": "dawr312131jkadd-1080x1920-6745e3e1b8331.mp4"

and or have feature in assets we can add params
{
"type": "video",
"layerName": "mediaHolder_02.mp4",
"composition": "media02",
"src": "[............../93701_b209470a3db39ee3a0c5fa2e8fb166ee/userProjects/4752_flyermotion-white/350599/1080x1920-6745e9fde9aa4.mp4]"
"params": { "-ss": "0", "-to": "4.3263012354489"}
}
that auto use action encode to trim video automaticaly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants