Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Changing Video's rotation metadata without rotating video

    2 décembre 2016, par Arshdeep Singh

    I have two Videos. One is from front camera and one is from back camera. When I concatenate these two. one gets vertically inverted in merged file. Video taken from front camera having rotation metadata 270. And Video taken from back camera having rotation metadata 90. While concatenation one gets inverted, while I don't want. Please help....

  • python call of ffmpeg misses target file parameter

    2 décembre 2016, par Fred

    I'm writing a python GUI for ffmpeg. When calling ffmpeg via subprocess it runs fine as long as the command is like

    subprocess.Popen([ffmpeg_converter,
            '-i',file,
            target_file
            ])
    

    But when I do the same call with ffmpeg arguments it fails with "At least one output file must be specified":

    option_string = '-q:a 4'
    subprocess.Popen([ffmpeg_converter,
            '-i',file,
            option_string,
            target_file
            ])
    

    It even recognizes the options but does not see the target file. I even replaced the actual target file with someting simple like "test.mp3" but still the same error. Any ideas? (I'm on windows with python 3.3.)

    The complete console output is:

        ffmpeg version N-57781-g0610d6e Copyright (c) 2000-2013 the FFmpeg developers
      built on Nov  1 2013 18:01:35 with gcc 4.8.2 (GCC)
      configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
    le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
    ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
    eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
    ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
      libavutil      52. 49.100 / 52. 49.100
      libavcodec     55. 40.101 / 55. 40.101
      libavformat    55. 20.105 / 55. 20.105
      libavdevice    55.  5.100 / 55.  5.100
      libavfilter     3. 90.100 /  3. 90.100
      libswscale      2.  5.101 /  2.  5.101
      libswresample   0. 17.104 /  0. 17.104
      libpostproc    52.  3.100 / 52.  3.100
    Trailing options were found on the commandline.
    Input #0, flac, from 'c:\script\python\testdata\source\01. Es geht los.flac':
      Metadata:
        ARTIST          : Olivia Trummer Trio
        TITLE           : Es geht los
        ALBUM           : Westwind
        DATE            : 2008
        track           : 01
        GENRE           : Jazz
        COMMENT         : EAC FLAC -8
      Duration: 00:06:27.25, bitrate: 834 kb/s
        Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
    At least one output file must be specified
    
  • Filtering (deinterlacing) in ffmpeg

    2 décembre 2016, par mtadmk

    Is it possible to deinterlace? I was following

    and unfortunately

    A fatal error has been detected by the Java Runtime Environment:

    EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ff831ee94cd, pid=8808, tid=9184

    JRE version: Java(TM) SE Runtime Environment (8.0_91-b14) (build 1.8.0_91-b14) Java VM: Java HotSpot(TM) 64-Bit Server VM (25.91-b14 mixed mode windows-amd64 compressed oops) Problematic frame: C [avfilter-6.dll+0x394cd]

    when init calls avfilter.avfilter_graph_create_filter. Method code:

    avfilter.AVFilterContext filter_src_ctx = null;
    avfilter.AVFilterContext filter_sink_ctx = null;
     private void init_filtering(avcodec.AVCodecContext ctx, AVFrame frame) {
            avfilter.AVFilter buffer_src = avfilter.avfilter_get_by_name("buffer");
            avfilter.AVFilter buffer_sink = avfilter.avfilter_get_by_name("buffersink");
            avfilter.AVFilterInOut inputs = avfilter.avfilter_inout_alloc();
            avfilter.AVFilterInOut outputs = avfilter.avfilter_inout_alloc();
    
            String args = String.format("video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
                frame.width(),
                frame.height(),
                frame.format(),
                ctx.time_base().num(),
                ctx.time_base().den(),
                ctx.sample_aspect_ratio().num(),
                ctx.sample_aspect_ratio().den());
    
            String description = "yadif=1:-1:0";
            avfilter.AVFilterGraph graph = avfilter.avfilter_graph_alloc();
    
            int result = avfilter.avfilter_graph_create_filter(filter_src_ctx, buffer_src, "in", args, null, graph);
            if (result < 0) {
                System.out.println("error");
            }
    
            avfilter.AVBufferSinkParams params = avfilter.av_buffersink_params_alloc();
            params.pixel_fmts().put(avutil.AV_PIX_FMT_NONE);
    
            result = avfilter.avfilter_graph_create_filter(filter_sink_ctx, buffer_sink, "out", null, params, graph);
            av_free(params);
            if (result < 0) {
                System.out.println("error");
            }
            inputs.name(new BytePointer("out"));
            inputs.filter_ctx(filter_sink_ctx);
            inputs.pad_idx(0);
            inputs.next(null);
    
            inputs.name(new BytePointer("in"));
            inputs.filter_ctx(filter_src_ctx);
            inputs.pad_idx(0);
            inputs.next(null);
    
            result = avfilter.avfilter_graph_parse_ptr(graph, description, inputs, outputs, null);
            if (result < 0) {
                System.out.println("error");
            }
    
            result = avfilter.avfilter_graph_config(graph, null);
            if (result < 0) {
                System.out.println("error");
            }
            isInitFilter = true;
        }
    

    I would apprieciate any suggestion. (This is a copy of issue reported in javacpp )

  • How do I create with ffmpeg video slideshow from VIDEO

    2 décembre 2016, par MaZy

    Hello I do not find an answer for this.

    As example I have a videoA with 10 min duration. I want to make new videoB slideshow from videoA which should have max duration time of 5 seconds. I should show every 0.5 seconds some frames of the videoA. Getting x frames of the videoA are better divided by duration if possible. What I mean is if videoA is 30 seconds. So get startframe, frame at 15 sec, frame at 30 sec.

    I want to use the slideshow as preview. What I only find is making slideshow from images or creating preview as images..

  • When recording MP4 using ffmpeg suddenly power off

    2 décembre 2016, par wanglx

    Now I used C language and ffmpeg realize a multiplex real-time audio and video to MP4 files of the program and everything works fine, but when in the process of reuse of sudden power failure, the recording is MP4 file is damaged, VLC can not play this file. I think reason is no call to write the trailer function av_write_trailer , causing index and time stamp information lost, I use araxis merge tool compared the successful call av_write_trailer function of file and a no av_write_trailer to call the damaged files and found two different points: 1. Damaged files in the file header box number value not right 2. The damaged file no end of file.

    Now I want to repair after power on my program can automatically repair the damaged files, in Google did not find effective methods. my train of thought is in the normal recording process saves per second a damaged file is missing two information: box number and end of file, save it to a local file, when writing the MP4 file integrity delete this file after, if power off damaged, then in the next power, read the file and the corresponding information to write the damaged files corresponding position to. But now the problem is that I don't know how to save the number of box and the end of the file, I this is feasible? If possible, what should I do? Looking forward to your reply!