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

Looking for support for segment option #17

Open
shubhamagrawal280395 opened this issue Nov 22, 2019 · 1 comment
Open

Looking for support for segment option #17

shubhamagrawal280395 opened this issue Nov 22, 2019 · 1 comment

Comments

@shubhamagrawal280395
Copy link

shubhamagrawal280395 commented Nov 22, 2019

Hi ,
This code is working fine for me

        let conv = new Converter();
        const input = conv.createInputStream({ f: 'image2pipe', r: 25 }) 

        conv
            .output({
                "f": 'mp4', 
                "vcodec": 'libx264', 
                "pix_fmt": 'yuv420p', 
                "buffer": true , 
            })
            .pipe(uploadFromStream(resolve,reject,outputPath))
            .on('error',function(err){
                console.log(`error on create video line 38 ${err}`)
                reject(err);
            })

but I want to create a independent ts segment not mp4 for which I have done something like below

        let conv = new Converter();
        const input = conv.createInputStream({ f: 'image2pipe', r: 25 }) // create input writable stream
        //conv.createOutputToFile('out.mp4', { vcodec: 'libx264', pix_fmt: 'yuv420p' })

        conv
            .output({
                "f": 'ssegment', 
                "vcodec": 'libx264', 
                //"pix_fmt": 'yuv420p', 
                "buffer": true , 
                "vbsf":"h264_mp4toannexb",
                "flags":true , 
                "global_header":true , 
               "map":"0",
                "segment_time":"1",
               "segment_format":"mpegts"
            })
            .pipe(uploadFromStream(resolve,reject,outputPath))
            .on('error',function(err){
                console.log(`error on create video line 38 ${err}`)
                reject(err);
            })

but it is returning me some error

{
    "errorType": "Runtime.UnhandledPromiseRejection",
    "errorMessage": "Error: ENOENT: no such file or directory, open '/tmp/ffmpeg-avk572ai4n'",
    "reason": {
        "errorType": "Error",
        "errorMessage": "ENOENT: no such file or directory, open '/tmp/ffmpeg-avk572ai4n'",
        "code": "ENOENT",
        "errno": -2,
        "syscall": "open",
        "path": "/tmp/ffmpeg-avk572ai4n",
        "stack": [
            "Error: ENOENT: no such file or directory, open '/tmp/ffmpeg-avk572ai4n'"
        ]
    },
    "promise": {},
    "stack": [
        "Runtime.UnhandledPromiseRejection: Error: ENOENT: no such file or directory, open '/tmp/ffmpeg-avk572ai4n'",
        "    at process.on (/var/runtime/index.js:37:15)",
        "    at process.emit (events.js:198:13)",
        "    at process.EventEmitter.emit (domain.js:448:20)",
        "    at emitPromiseRejectionWarnings (internal/process/promises.js:140:18)",
        "    at process._tickCallback (internal/process/next_tick.js:69:34)"
    ]
}

Can someone please help me resolving this issue

@phaux
Copy link
Owner

phaux commented Nov 29, 2019

you can't pipe when using -f ssegment (docs).

This muxer outputs streams to a number of separate files of nearly fixed duration. Output filename pattern can be set in a fashion similar to image2, or by using a strftime template if the strftime option is enabled.

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