Skip to content

ProgressListener nerver trigered but the video is in converting #332

@peihuanhuan

Description

@peihuanhuan

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions