Recherche avancée

Médias (0)

Mot : - Tags -/content

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (87)

Sur d’autres sites (15971)

  • Unrecognized option 'stimeout'

    22 juin 2022, par ganapati kulkarni

    Unrecognized option 'stimeout', is popping up when i'm using the command :

    


    ffmpeg -re -rtsp_transport tcp -y -stimeout 1000000 -i "rtsp://admin:admin123@10.40.20.247:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif" -c copy -vsync 1 -f segment -segment_time 600 -segment_atclocktime 0 -segment_list_flags +live -reset_timestamps 1 -strftime 1 "C:\MINDA\OBITS\BlackBox\Recordings\Normal\Dahua-5M02C9FPAG1C78A\2022-1-4\%Y.%m.%d.%H.%M.%S.avi"


    


  • generate thumbnail from stream jaffree Java

    27 avril 2022, par med benzekri

    I am trying to generate a thumbnail from a video stream using jaffree thought they didn't mention in their docs anything about generating thumbnail. I tried to figure it out on my own but it doesn't seem to work.

    


    code for thumbnail generating :

    


            public  PipedOutputStream generatethumbnail(){
           PipedOutputStream image = new PipedOutputStream();
                    FFmpeg.atPath()
                  .addInput(PipeInput.pumpFrom(stream).setPosition(1L, TimeUnit.SECONDS))
                   .addOutput(PipeOutput.pumpTo(image).setFormat("image2"))
                   .execute();
               return image;
        }
    }


    


    the stack trace when i run a test :

    


    2022-04-25 00:36:50.250  WARN 200267 --- [           main] c.g.kokorin.jaffree.ffmpeg.PipeOutput    : It's recommended to use ChannelOutput since ffmpeg requires seekable output for many formats
2022-04-25 00:36:50.255  WARN 200267 --- [           main] c.github.kokorin.jaffree.ffmpeg.FFmpeg   : ProgressListener isn't set, progress won't be reported
2022-04-25 00:36:50.256  INFO 200267 --- [           main] c.g.k.jaffree.process.ProcessHandler     : Command constructed:
ffmpeg -loglevel level+info -ss 1.000 -i tcp://127.0.0.1:43417 -n -f image2 tcp://127.0.0.1:38791
2022-04-25 00:36:50.256  INFO 200267 --- [           main] c.g.k.jaffree.process.ProcessHandler     : Starting process: ffmpeg
2022-04-25 00:36:50.292  INFO 200267 --- [           main] c.g.k.jaffree.process.ProcessHandler     : Waiting for process to finish
2022-04-25 00:36:50.890  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info] ffmpeg version 5.0-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2022 the FFmpeg developers
2022-04-25 00:36:50.891  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   built with gcc 8 (Debian 8.3.0-6)
2022-04-25 00:36:50.928  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg
2022-04-25 00:36:50.929  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   libavutil      57. 17.100 / 57. 17.100
2022-04-25 00:36:50.929  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   libavcodec     59. 18.100 / 59. 18.100
2022-04-25 00:36:50.930  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   libavformat    59. 16.100 / 59. 16.100
2022-04-25 00:36:50.930  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   libavdevice    59.  4.100 / 59.  4.100
2022-04-25 00:36:50.930  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   libavfilter     8. 24.100 /  8. 24.100
2022-04-25 00:36:50.930  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   libswscale      6.  4.100 /  6.  4.100
2022-04-25 00:36:50.930  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   libswresample   4.  3.100 /  4.  3.100
2022-04-25 00:36:53.600  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   libpostproc    56.  3.100 / 56.  3.100
2022-04-25 00:36:53.601  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'tcp://127.0.0.1:43417':
2022-04-25 00:36:53.602  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   Metadata:
2022-04-25 00:36:53.603  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     major_brand     : mp42
2022-04-25 00:36:53.603  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     minor_version   : 0
2022-04-25 00:36:53.603  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     compatible_brands: mp42mp41
2022-04-25 00:36:53.603  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     creation_time   : 2019-11-27T09:33:42.000000Z
2022-04-25 00:36:53.604  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   Duration: 00:00:20.69, start: 0.000000, bitrate: N/A
2022-04-25 00:36:53.604  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   Stream #0:0[0x1](eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 5760x2880, 29992 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
2022-04-25 00:36:53.604  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     Metadata:
2022-04-25 00:36:53.605  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       creation_time   : 2019-11-27T09:33:42.000000Z
2022-04-25 00:36:53.605  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       handler_name    : ?Mainconcept Video Media Handler
2022-04-25 00:36:53.605  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       vendor_id       : [0][0][0][0]
2022-04-25 00:36:53.605  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       encoder         : AVC Coding
2022-04-25 00:36:53.606  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     Side data:
2022-04-25 00:36:53.606  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       stereo3d: 2D
2022-04-25 00:36:53.606  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       spherical: equirectangular (0.000000/0.000000/0.000000) 
2022-04-25 00:36:53.606  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
2022-04-25 00:36:53.607  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     Metadata:
2022-04-25 00:36:53.607  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       creation_time   : 2019-11-27T09:33:42.000000Z
2022-04-25 00:36:53.607  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       handler_name    : #Mainconcept MP4 Sound Media Handler
2022-04-25 00:36:53.607  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       vendor_id       : [0][0][0][0]
2022-04-25 00:36:53.608  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info] Stream mapping:
2022-04-25 00:36:53.608  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
2022-04-25 00:36:54.787  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info] Press [q] to stop, [?] for help
2022-04-25 00:36:54.799  WARN 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [swscaler @ 0x6b45b80] [swscaler @ 0x6b52b40] [warning] deprecated pixel format used, make sure you did set range correctly
2022-04-25 00:36:54.801  WARN 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [swscaler @ 0x6b45b80] [swscaler @ 0x8467b00] [warning] deprecated pixel format used, make sure you did set range correctly
2022-04-25 00:36:54.804  WARN 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [swscaler @ 0x6b45b80] [swscaler @ 0x850d400] [warning] deprecated pixel format used, make sure you did set range correctly
2022-04-25 00:36:54.806  WARN 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [swscaler @ 0x6b45b80] [swscaler @ 0x85b2d00] [warning] deprecated pixel format used, make sure you did set range correctly
2022-04-25 00:36:57.870  WARN 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [swscaler @ 0x6b45b80] [swscaler @ 0x8658600] [warning] deprecated pixel format used, make sure you did set range correctly
2022-04-25 00:36:57.871  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info] Output #0, image2, to 'tcp://127.0.0.1:38791':
2022-04-25 00:36:57.871  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   Metadata:
2022-04-25 00:36:57.871  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     major_brand     : mp42
2022-04-25 00:36:57.872  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     minor_version   : 0
2022-04-25 00:36:57.872  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     compatible_brands: mp42mp41
2022-04-25 00:36:57.872  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     encoder         : Lavf59.16.100
2022-04-25 00:36:57.872  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]   Stream #0:0(eng): Video: mjpeg, yuvj420p(pc, bt709, progressive), 5760x2880, q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn (default)
2022-04-25 00:36:57.873  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     Metadata:
2022-04-25 00:36:57.873  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       creation_time   : 2019-11-27T09:33:42.000000Z
2022-04-25 00:36:57.873  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       handler_name    : ?Mainconcept Video Media Handler
2022-04-25 00:36:57.874  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       vendor_id       : [0][0][0][0]
2022-04-25 00:36:57.874  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       encoder         : Lavc59.18.100 mjpeg
2022-04-25 00:36:57.874  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]     Side data:
2022-04-25 00:36:57.875  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
2022-04-25 00:36:57.875  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       stereo3d: 2D
2022-04-25 00:36:58.077  INFO 200267 --- [         StdErr] c.g.k.jaffree.process.BaseStdReader      : [info]       spherical: equirectangular (0.000000/0.000000/0.000000) 
2022-04-25 00:36:58.213  WARN 200267 --- [     Runnable-1] c.g.kokorin.jaffree.process.Executor     : Interrupting starter thread (main) because of exception: TCP negotiation failed
2022-04-25 00:36:58.214  WARN 200267 --- [           main] c.g.k.jaffree.process.ProcessHandler     : Process has been interrupted
2022-04-25 00:36:58.215  WARN 200267 --- [           main] c.g.kokorin.jaffree.process.Executor     : Interrupting ALIVE thread: StdErr
2022-04-25 00:36:58.215  WARN 200267 --- [           main] c.g.kokorin.jaffree.process.Executor     : Interrupting ALIVE thread: StdOut
2022-04-25 00:36:58.215  WARN 200267 --- [           main] c.g.kokorin.jaffree.process.Executor     : Interrupting ALIVE thread: Runnable-0

com.github.kokorin.jaffree.JaffreeException: Failed to execute, was interrupted

    at com.github.kokorin.jaffree.process.ProcessHandler.interactWithProcess(ProcessHandler.java:190)
    at com.github.kokorin.jaffree.process.ProcessHandler.execute(ProcessHandler.java:147)
    at com.github.kokorin.jaffree.ffmpeg.FFmpeg.execute(FFmpeg.java:400)
    at dz.univ.bechar.mda.service.FFmpegService$Genrator.generatethumbnail(FFmpegService.java:57)
    at dz.univ.bechar.mda.service.FFmpegServiceTest.givenObjectStream_whenGenerate_Thumbnail(FFmpegServiceTest.java:30)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
    at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
    at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:84)
    at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
    at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
    at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
    at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
    at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
    at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
    at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
    at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
    at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
    at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
    at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:71)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater$1.execute(IdeaTestRunner.java:38)
    at com.intellij.rt.execution.junit.TestsRepeater.repeat(TestsRepeater.java:11)
    at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:35)
    at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:235)
    at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:54)
    Suppressed: com.github.kokorin.jaffree.JaffreeException: TCP negotiation failed
        at com.github.kokorin.jaffree.net.TcpServer.run(TcpServer.java:69)
        at com.github.kokorin.jaffree.process.Executor$1.run(Executor.java:83)
        at java.base/java.lang.Thread.run(Thread.java:829)
    Caused by: java.io.IOException: Pipe not connected
        at java.base/java.io.PipedOutputStream.write(PipedOutputStream.java:140)
        at com.github.kokorin.jaffree.util.IOUtil.copy(IOUtil.java:71)
        at com.github.kokorin.jaffree.util.IOUtil.copy(IOUtil.java:50)
        at com.github.kokorin.jaffree.net.PipeOutputNegotiator.negotiate(PipeOutputNegotiator.java:55)
        at com.github.kokorin.jaffree.net.NegotiatingTcpServer.serve(NegotiatingTcpServer.java:44)
        at com.github.kokorin.jaffree.net.TcpServer.run(TcpServer.java:66)
        ... 2 more
Caused by: java.lang.InterruptedException
    at java.base/java.lang.Object.wait(Native Method)
    at java.base/java.lang.Object.wait(Object.java:328)
    at java.base/java.lang.ProcessImpl.waitFor(ProcessImpl.java:495)
    at com.github.kokorin.jaffree.process.ProcessHandler.interactWithProcess(ProcessHandler.java:180)
    ... 73 more


    


    Since the output info is shown, I assume that the thumbnail is generated but somehow interrupted, isn't it ?

    


    Note : I need ffmpeg output to be a stream uploaded to an object storage server.

    


    ffmpeg used : ffmpeg 5.0-static
tried this version ffmpeg-3.4.2-static which worked before on nodejs app with fluent-ffmpeg

    


  • How to Show result after uploaded file in PHP

    23 avril 2022, par i0x4r

    I have a script that uploads the video to a server, everything is correct but there is a problem, after the upload of the video to the server is completed
it shows all the uploaded files in the (uploads) folder as array !

    


    I only want the result of the file I just uploaded, and it doesn't show me the previous files !
I need ffmpeg to improve video quality

    


    index.php

    


    &lt;?php&#xA;//index.php&#xA;&#xA;?>&#xA;&#xA;&#xA; &#xA;  &#xA;  &#xA;  <code class="echappe-js">&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js&quot;&gt;&lt;/script&gt;&#xA;        &lt;script src=&quot;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js&quot;&gt;&lt;/script&gt;        &#xA;  &#xA;  &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/dropzone/5.5.1/dropzone.js&quot;&gt;&lt;/script&gt;&#xA;  &#xA; &#xA; &#xA;  
    &#xA;&#xA;
    &#xA;&#xA;

    &#xA; &#xA; &#xA; &#xA;
    &#xA;&#xA;

    &#xA;&#xA;
    &#xA;

    &#xA; &#xA;&#xA;&#xA;&lt;script&gt;&amp;#xA;&amp;#xA;$(document).ready(function(){&amp;#xA; &amp;#xA; Dropzone.options.dropzoneFrom = {&amp;#xA;  autoProcessQueue: true,&amp;#xA;  timeout: 300000,&amp;#xA;  acceptedFiles:&quot;video/*&quot;,&amp;#xA;  init: function(){&amp;#xA;   var submitButton = document.querySelector(&amp;#x27;#submit-all&amp;#x27;);&amp;#xA;   myDropzone = this;&amp;#xA;   submitButton.addEventListener(&quot;click&quot;, function(){&amp;#xA;    myDropzone.processQueue();&amp;#xA;   });&amp;#xA;   this.on(&quot;complete&quot;, function(){&amp;#xA;    if(this.getQueuedFiles().length == 0 &amp;amp;&amp;amp; this.getUploadingFiles().length == 0)&amp;#xA;    {&amp;#xA;     var _this = this;&amp;#xA;     _this.removeAllFiles();&amp;#xA;    }&amp;#xA;    list_image();&amp;#xA;   });&amp;#xA;  },&amp;#xA; };&amp;#xA;&amp;#xA; list_image();&amp;#xA;&amp;#xA; function list_image()&amp;#xA; {&amp;#xA;  $.ajax({&amp;#xA;   url:&quot;upload.php&quot;,&amp;#xA;   success:function(data){&amp;#xA;    $(&quot;#preview&quot;).html(data);&amp;#xA;   }&amp;#xA;  });&amp;#xA; }&amp;#xA;&amp;#xA; $(document).on(&amp;#x27;click&amp;#x27;, &amp;#x27;.remove_image&amp;#x27;, function(){&amp;#xA;  var name = $(this).attr(&amp;#x27;id&amp;#x27;);&amp;#xA;  $.ajax({&amp;#xA;   url:&quot;upload.php&quot;,&amp;#xA;   method:&quot;POST&quot;,&amp;#xA;   data:{name:name},&amp;#xA;   success:function(data)&amp;#xA;   {&amp;#xA;    list_image();&amp;#xA;   }&amp;#xA;  })&amp;#xA; });&amp;#xA; &amp;#xA;});&amp;#xA;&lt;/script&gt;&#xA;

    &#xA;

    upload.php

    &#xA;

        &lt;?php&#xA;&#xA;//upload.php&#xA;&#xA;$folder_name = &#x27;upload/&#x27;;&#xA;$tumb_name = &#x27;thumb/&#x27;;&#xA;$imageext = &#x27;.png&#x27;;&#xA;&#xA;if(!empty($_FILES))&#xA;{&#xA;&#xA; $temp_file = $_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;];&#xA; $location = $folder_name . $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; move_uploaded_file($temp_file, $location);&#xA; $upload = $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; $uploadStr = str_replace(" ", "\ ",$upload);&#xA; $locationStr = str_replace(" ","\ ",$location);&#xA; $cmd  = "ffmpeg -y -i {$locationStr} -ss 00:00:15 -vframes 1 thumb/{$uploadStr}.png 2>&amp;1";&#xA; echo shell_exec($cmd);&#xA;}&#xA;&#xA;if(isset($_POST["name"]))&#xA;{&#xA; $filename = $folder_name.$_POST["name"];&#xA; $imagename = $thumb_name.$_POST["name"].$imageext;&#xA; unlink($filename);&#xA; unlink($imagename);&#xA;}&#xA;&#xA;$result = array();&#xA;&#xA;$files = scandir(&#x27;upload&#x27;);&#xA;&#xA;$output = &#x27;<div class="row">&#x27;;&#xA;&#xA;if(false !== $files)&#xA;{&#xA; foreach($files as $file)&#xA; {&#xA;  if(&#x27;.&#x27; !=  $file &amp;&amp; &#x27;..&#x27; != $file)&#xA;  {&#xA;   $output .= &#x27;&#xA;   <a href="http://stackoverflow.com/view.php?file=&#38;#x27;.$file.&#38;#x27;" target="_blank"> <img src="http://stackoverflow.com/feeds/tag/thumb/&#38;#x27;.$file.&#38;#x27;.png" class="img-thumbnail" width='246' height='138' /></a>&#xA;    <button type="button" class="btn btn-link remove_image">Remove</button>&#xA;   &#x27;;&#xA;  }&#xA; }&#xA;}&#xA;$output .= &#x27;</div>&#x27;;&#xA;echo $output;&#xA;&#xA;?>&#xA;

    &#xA;

    EDIT :&#xA;I put the example on an Array, I don't want it, I just want it to show the downloaded video I just uploaded as a result.

    &#xA;

    EDIT 2 :&#xA;There are some who say type $location and it displays the downloaded file, but this does not work !!!&#xA;I just tried more than once and with several uses, there is no display where the text is empty

    &#xA;

    This is an example of that

    &#xA;

    &lt;?php&#xA;&#xA;//upload.php&#xA;&#xA;$folder_name = &#x27;upload/&#x27;;&#xA;$tumb_name = &#x27;thumb/&#x27;;&#xA;$imageext = &#x27;.png&#x27;;&#xA;&#xA;if(!empty($_FILES))&#xA;{&#xA;&#xA; $temp_file = $_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;];&#xA; $location = $folder_name . $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; move_uploaded_file($temp_file, $location);&#xA; $upload = $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; $uploadStr = str_replace(" ", "\ ",$upload);&#xA; $locationStr = str_replace(" ","\ ",$location);&#xA; $cmd  = "ffmpeg -y -i {$locationStr} -ss 00:00:15 -vframes 1 thumb/{$uploadStr}.png 2>&amp;1";&#xA; echo shell_exec($cmd);&#xA;}&#xA;&#xA;if(isset($_POST["name"]))&#xA;{&#xA; $filename = $folder_name.$_POST["name"];&#xA; $imagename = $thumb_name.$_POST["name"].$imageext;&#xA; unlink($filename);&#xA; unlink($imagename);&#xA;}&#xA;&#xA;&#xA;$output .= &#x27;Successfly file is "&#x27;.$location.&#x27;"&#x27;;&#xA;echo $output;&#xA;&#xA;?>&#xA;

    &#xA;

    Result : Successfly file is ""&#xA;no name file :(

    &#xA;

    EDIT 3 :

    &#xA;

    this code upload.php&#xA;functions not working

    &#xA;

    &lt;?php&#xA;&#xA;//upload.php&#xA;&#xA;$folder_name = &#x27;upload/&#x27;;&#xA;$tumb_name = &#x27;thumb/&#x27;;&#xA;$imageext = &#x27;.png&#x27;;&#xA;&#xA;if(!empty($_FILES))&#xA;{&#xA;&#xA; $temp_file = $_FILES[&#x27;file&#x27;][&#x27;tmp_name&#x27;];&#xA; $location = $folder_name . $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; move_uploaded_file($temp_file, $location);&#xA; $upload = $_FILES[&#x27;file&#x27;][&#x27;name&#x27;];&#xA; $uploadStr = str_replace(" ", "\ ",$upload);&#xA; $locationStr = str_replace(" ","\ ",$location);&#xA; $cmd  = "ffmpeg -y -i {$locationStr} -ss 00:00:15 -vframes 1 thumb/{$uploadStr}.png 2>&amp;1";&#xA; echo shell_exec($cmd);&#xA;}&#xA;&#xA;&#xA;echo "The file " . $location . " has been uploaded";&#xA;// not working&#xA;echo "<br />";&#xA;echo "The file " . $upload . " has been uploaded";&#xA;// not working&#xA;echo "<br />";&#xA;echo "The file " . $uploadStr . " has been uploaded";&#xA;// not working&#xA;echo "<br />";&#xA;echo "The file " . $locationStr . " has been uploaded";&#xA;// not working&#xA;&#xA;?>&#xA;

    &#xA;

    Result upload.php in EDIT 3

    &#xA;

    this error :&#xA;[23-Apr-2022 12:31:56 Asia/Riyadh] PHP Notice : Undefined variable : location in /home/prdix/public_html/test/upload.php on line 38

    &#xA;

    line 38 : echo $location ;

    &#xA;

    About the developer solution Markus AO

    &#xA;

    I did the experiment and it is quite good, but dropzone is still missing, because I will upload a large video and the normal upload compresses the video before uploading, here is a picture from my mobile while uploading, but this does not happen with dropzone&#xA;enter image description here

    &#xA;

    I want to implement this in dropzone as well, because this library does not compress the video, but upload it in full size.

    &#xA;

    Thank you bro.

    &#xA;