ffmpeg-cli-wrapper icon indicating copy to clipboard operation
ffmpeg-cli-wrapper copied to clipboard

ProgressListener nerver trigered but the video is in converting

Open peihuanhuan opened this issue 1 year ago • 7 comments
trafficstars

Describe the bug

ProgressListener nerver trigered but the video is in converting.

found the error log: Error closing progress log, loss of information possible: Broken pipe

image

To Reproduce

fun ffmpeg(inputPath: String, outputPath: String, byteRate: Long) {
    val ffmpeg = FFmpeg("ffmpeg")
    val ffprobe = FFprobe("ffprobe")

    val inputProbe = ffprobe.probe(inputPath)

    val builder = FFmpegBuilder()
        .setInput(inputPath) // Filename, or a FFmpegProbeResult
        .overrideOutputFiles(true) // Override the output if it exists
        .addOutput(outputPath) // Filename for the destination
        .setAudioBitRate(byteRate * 1024) // at 32 kbit/s
        .done()

    val executor = FFmpegExecutor(ffmpeg, ffprobe)

    executor.createJob(builder) { progress ->
        val duration_ns: Double = inputProbe.getFormat().duration * TimeUnit.SECONDS.toNanos(1)

        val percentage = progress.out_time_ns / duration_ns

        log.info(String.format(
            "[%.0f%%] time:%s ms status:%s frame:%d fps:%.0f speed:%.2fx",
            percentage * 100,
            FFmpegUtils.toTimecode(progress.out_time_ns, TimeUnit.NANOSECONDS),
            progress.status,
            progress.frame,
            progress.fps,
            progress.speed
        ));

    }.run()

}

Expected behavior A clear and concise description of what you expected to happen.

Version (if applicable):

  • OS: Linux version 6.4.16-linuxkit ubuntu
  • Java Version: 1.8
  • FFmpeg version: 6.1.1-3ubuntu5
  • sdk version: 0.8.0

Additional context my dockerfile:

FROM ubuntu

RUN apt-get update -y

RUN apt-get install ffmpeg -y

peihuanhuan avatar Jul 19 '24 17:07 peihuanhuan

Thank you for the report! This might be fixed by #315, but that one sadly hasn't been released yet

If possible, could you share some information about the file you're encoding? Especially the duration would be interesting.

Euklios avatar Aug 08 '24 13:08 Euklios

Thank you @Euklios , do we have a plan to release it? I'm converting .m4s to .mp3 file. It's a minute or two mostly, up to a couple hours, but they all have this problem.

peihuanhuan avatar Aug 08 '24 13:08 peihuanhuan

That's a hard question. There is #319, which is technically ready, but releasing is a responsibility of @bramp . The cleanest option would be going through him.

Alternatively: I used to be doing unofficial snapshot releases, I think I could get that back up for you

Euklios avatar Aug 08 '24 13:08 Euklios

Thank you @Euklios ! let's wait @bramp 's feedback first.

peihuanhuan avatar Aug 08 '24 13:08 peihuanhuan

Fine by me. I don't know how fast you need this fixed.

I just tried to create a test based on the code you provided, but couldn't re-create the issue. Could you please try your code using the big_buck_bunny_720p_1mb.mp4 file from this repository?

Euklios avatar Aug 08 '24 13:08 Euklios

it's not a urgent ticket, let me have a try. but i think it will occur, it should be a ffmpeg version issue.

peihuanhuan avatar Aug 08 '24 14:08 peihuanhuan

for the big_buck_bunny_720p_1mb.mp4, there is no closing progress log, loss of information possible: Broken pipe error log or any other log, this video seems to short.

image

peihuanhuan avatar Aug 08 '24 14:08 peihuanhuan