u2takey / ffmpeg-go

golang binding for ffmpeg
Apache License 2.0
1.72k stars 170 forks source link

error in generate dash mpd file #96

Open GostGrimmy opened 1 year ago

GostGrimmy commented 1 year ago

this is my code:

    err := ffmpeg_go.Input(
        "input-filepath",
        ffmpeg_go.KwArgs{
            "re": "",
        },
    ).
        Output("path/out.mpd",
            ffmpeg_go.KwArgs{
                "map":    0,
                "c:a":    "aac",
                "c:v":    "libx264",
                "b:v:0":  "750k",
                "s:v:0":  "640x360",
                "vf:v:0": "scale=-1:360",
                //"filter:v":        "fps=24",
                "keyint_min":      "120",
                "g":               "120",
                "sc_threshold":    0,
                "use_timeline":    1,
                "window_size":     5,
                "b_strategy":      "0",
                "bf":              "1",
                "use_template":    "1",
                "adaptation_sets": "\"id=0,streams=v id=1,streams=a\"",
                "f":               "dash",
            },
        ).
        OverWriteOutput().
        ErrorToStdOut().
        Run()
    if err != nil {
        fmt.Println(err.Error())
    }

generate ffmpeg command is ffmpeg -re -i myinput-path/video/1.mp4 -adaptation_sets "id=0,streams=v id=1,streams=a" -b:v:0 750k -b_strategy 0 -bf 1 -c:a aac -c:v libx264 -f dash -g 120 -keyint_min 120 -map 0 -queue_size 60 -s:v:0 640x360 -sc_threshold 0 -use_template 1 -use_timeline 1 -vf:v:0 scale=-1:360 -window_size 5 my-output-path/out.mpd -y after exec the error is

Error initializing output stream 0:0 -- [libx264 @ 0x562b672eb180] final ratefactor: 32.52 [aac @ 0x562b672ed840] Qavg: 20954.139 [aac @ 0x562b672ed840] 2 frames left in the queue on closing

but i can exec in the shell terminal and it exec success.

What is the quession about it .