Newest 'ffmpeg' Questions - Stack Overflow

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

Articles published on the website

  • Can OpenCV handle the error when ffmpeg fails?

    12 December 2015, by wking

    I am using CV::VideoCapture to capture frames from an IP camera. It works most of time, however, sometimes it reports the error:

    [mjpeg @ 0x233aea0] overread 8
    

    And when this error occurred, my program just stuck there. This might explain why. But how can I solve it in C++ code? Can OpenCV handle this error without terminate the program?

    p.s. I found that if I didn't call CV::VideoCapture::read() immediately, but wait for a while, like 60 seconds, after CV::VideoCapture::open(), this error occurred everytime! Is it a bug of OpenCV?

  • Does ffmpeg not support icod? Where should I start to dig the issue?

    12 December 2015, by hdf

    I try to decode some video files using ffmpeg, but get errors caused by icod codec.
    Here's the file's ffprobe info:

    user:~$ ffprobe input.mov
    ffprobe version 1.2.3 Copyright (c) 2007-2013 the FFmpeg developers
      built on Jan 15 2014 23:08:14 with gcc 4.8 (Ubuntu/Linaro 4.8.1-10ubuntu9)
      configuration: --enable-zlib --enable-libmp3lame --enable-libx264 --enable-gpl --enable-nonfree --enable-pic
    

    ...

        Stream #0:0(eng): Video: none (icod / 0x646F6369), 1280x720, 52569 kb/s, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 5994 tbn, 5994 tbc
        Metadata:
          creation_time   : 2014-01-27 05:09:24
          handler_name    : Apple Alias Data Handler
          timecode        : 21:03:24:08
        Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s
        Metadata:
          creation_time   : 2014-01-27 05:09:24
          handler_name    : Apple Alias Data Handler
        Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s
        Metadata:
          creation_time   : 2014-01-27 05:09:24
          handler_name    : Apple Alias Data Handler
          timecode        : 21:03:24:08
    Unsupported codec with id 0 for input stream 0
    Unsupported codec with id 0 for input stream 2
    
  • what is The fastest way to scale down a H264 video in 2:1?

    12 December 2015, by 李天宇

    when I use ffmpeg to scale a H264 video. It seems that the video is decoded to the raw graph then scaled then encoded again. But if the speed is very critical,is there a faster way if I specify a “good" ratio like 2:1, as if I want to pick up one pixel in every four?

    I know a bit how h264 works, 8*8/4*4 pixels are coded as a group,so it's not easy to pick up 1/4 pixels in its range. But is there a way to merge 4 group into one quickly?

  • ffmpeg C API documentation/tutorial [closed]

    12 December 2015, by fvisticot

    I am trying to find documentation to use the ffmpeg C API. It seems that only command line documentation is available. Is there any good documentation/tutorials/links available?

  • FFMPEG filter_complex wih speedup and subtitles and scaling

    11 December 2015, by Sambir

    Hi I am trying to convert a file to a specific framerate and remove any jittering, jumping of the screen. I also try to boost the volume and add a subtitle overlay. I get an error with the curent line than it is not allowed to use complex_filter in combination with vf and af. as an extra I also would like to add text in the left corner (this i did not try yet) and would want the screen to be sized to full hd (changed scale to 1920:1080 but no succes).

    ffmpeg -i movie.mp4 -r 25 -filter_complex "[0:v]setpts=0.959*PTS[v];[0:a]atempo=1.0427[a]" -map "[v]" -map "[a]" -vf subtitles=sub.srt,scale=1920:1080 -af volume=2 -strict -2 -preset veryfast movie_new.mp4
    

    Got it!

    New:

    ffmpeg -i inside.mp4 -r 25 -filter_complex "[0:v]setpts=0.959*PTS[i];[i]scale=1920:1080[j];[j]subtitles=inside.srt[k];[0:a]atempo=1.0427[p];[p]volume=2[q]" -map "[k]" -map "[q]" -strict -2 -preset veryfast inside_new.mp4
    

    But now there is a new issue. Subs out of sync :P is there a easy fix for this or do i first need to encode without subs then resync then encode with subs?

    found this link by the way Subtitle Resync Tool

    moviespeed is changed by 0.959. is there a calculation i can do to adjust the subtitles by x miliseconds?

    EDIT: Got the subtitles fixed with subtitle workshop. Was just a small setting to change which directly shifted all the text :)