Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • Keep ffmpeg converting images to video when new images are incoming

    23 septembre 2019, par Jongseok Yoon

    Is there a way to keep ffmpeg convert images incoming to HLS, and stop whenever I want?

    I'm using ffmpeg to convert images to m3u8/ts for streaming. A camera device will send images 24/7, and ffmpeg will convert those when users requested until they stop watching.

    For now, I get images from a camera device by Java network, then move those images to ffmpeg input directory and convert those with C++. It's a loop that does this job, so new ffmpeg is executed every time images are moved.

    The problem is there are too many ts files leftover, and they're taking a lot of spaces on server. So I tried to delete those with delete_segments option, but since ffmpeg is executed every time, it couldn't delete segments made from ffmpeg right before it.

    Here are some ways I consider:

    1. To remove files with another function, without ffmpeg.
    2. Maybe transfer images directly to ffmpeg input, and somehow make ffmpeg keep convert those images to ts. (And I couldn't think of somehow)
    3. Or maybe change the whole structure.

    It would be much easier with the option 1, but it would be great if I can do this with ffmpeg's own functions.

  • How can i stop ffmpeg screen recording correctly ?

    23 septembre 2019, par Danke

    I am recording my screen and saving it to a *.mkv container (I am not sure it is what i really need, i have chosen it because a matadata in start of the file, and had hoped the file will be OK if simething will be wrong) using command:

    ffmpeg -f x11grab -r 7 -s 1920x1080 -i :0.0 -vcodec png -f segment -segment_time 20 Video_%02d.mkv
    

    I have problem: When a shut down my pc, using the hardware button :), i have 0 size video file segment, i don't know why it happens.

  • FFmpegFrameGrabber.start() crashes when loading mp4 file

    23 septembre 2019, par Anand Jain

    I'm trying to load a mp4 video file I record somewhere else in the app, and then want to pass the image's address to a jni native opencv code to do some processing.

    FFmpegFrameGrabber grabber;
    
                grabber = new FFmpegFrameGrabber(videoPath);
                grabber.start();
                grabber.getFrameNumber();
                grabber.getLengthInTime();
                grabber.getLengthInFrames();
    
                frameRate = grabber.getFrameRate();
    
                Log.d("V1", "FRAME RATE = " + frameRate);
    
                grabber.stop();
                grabber.release();
    

    It show Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.v1.v1golf2-rWziofbEW92JsJ7hvlJj5g==/base.apk"],nativeLibraryDirectories=[/data/app/com.v1.v1golf2-rWziofbEW92JsJ7hvlJj5g==/lib/arm64, /data/app/com.v1.v1golf2-rWziofbEW92JsJ7hvlJj5g==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]] couldn't find "libjniavutil.so" error.

    Dependency which I am using below :-

    implementation 'org.bytedeco.javacpp-presets:opencv-platform:3.1.0-1.3'
        implementation 'org.bytedeco.javacpp-presets:ffmpeg-platform:3.2.1-1.3'
    
  • Convert YUV420 to BGR without using videoconvert in GStreamer

    23 septembre 2019, par AnD Max

    I am using GSteamer, and I want to convert I420 to BGR format. Pipeline:

    gst-launch-1.0 filesrc location= ./Big_Buck_Bunny_1080_10s_1MB.mp4 ! qtdemux ! h264parse ! avdec_h264 ! fakesink

    I don't use videoconvert plugin because it takes many CPU workload. I saw that avdec_h264 plugins has support BGR format and I tried to chose BGR format but the output always give I420 format ("avdec_h264 ! video/x-raw, format=BGR !").

    I tried to cast it to BGR format in source code (gst-libav/ext/libav/gstavvidec.c\gst_ffmpeg_pixfmt_to_videoformat()) but I got an error in (gst-libav/gst-libs/ext/libav/libavcodec/decode.c), 1606

    for (i = 0; i < num_planes; i++) {
                av_assert0(frame->data[i]);
            }
    

    Does my way correct? Should I modify num_planes in deocode.c? If it's not a right way, can I convert format by using OpenCV with GStreamer pipeline?

    If you have any good way, please tell me also.

  • UTF-8 source files are not supported in avisynth

    22 septembre 2019, par Hadi Rasekh

    I use avisynth to demux video from audio. When I use

     x = "m.mkv"
     ffvideosource(x)
    

    It work correctly but when I change my video filename to a UTF-8 one and my script as:

     x = "م.mkv"
     ffvideosource(x)
    

    I Got the following error: failed to open for hashing avisynth

    I found a link (UTF-8 source files are not supported) who tell UTF-8 file name not work in avisynth, and to correct the problem, it said:

    specify the parameter utf8=true when calling ffvideosource, save the script as UTF-8 without BOM and then see if that works.

    But, I couldn't solve the problem. As I Open the script in the notepad and save it in utf-8 format, I got the following error:

    UTF-8 Source files are not supported, re-save script with ANSI encoding

    How can I solve the problem, How can I run my script with a UTF-8 filename?