Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • -to value smaller than -ss error while clipping videos with ffmpeg

    16 mai 2018, par dusa

    I am trying to clip videos using frame information, I first convert the frame to time since ffmpeg uses this notion to clip videos.

    The problem is for shorter videos, it gives the error:

    -to; value smaller than -ss; aborting.

    But in reality, this is false. For example, I get an error even with these values:

    0:0:47.4 -to 0:0:47.21  (format -> hh:mm:ss.frame)
    

    Can anyone tell me how I can fix this?

    The video frame rate is 25 fps and the command structure I use is:

     os.system('ffmpeg -i ' + inputvideo + '.mp4' + ' -qscale:v 2 -vf scale=427:240 ' + ' -ss '+ str(fhours) + ':' + str(fminutes) + ':' + str(fseconds) + '.' + str(fframes) + ' -to ' + str(lhours) + ':' + str(lminutes) + ':' + str(lseconds) + '.' + str(lframes) + ' ' + outputvideo + '.avi')
    
  • ffmpeg : Cannot open libx265 encoder. Error initializing output stream 0:0 — Error while opening encoder for output stream #0:0

    16 mai 2018, par bnge

    Sorry for my bad English. I am trying to use ffmpeg to convert some image to heic format. Most of them were succeeded, but some large jpeg (seems only jpeg, png will be okay) files not.

    How can I improve my command to compatible all my images, so I can convert them automatically?

    ➜  ~ ffmpeg -i sample.jpg -crf 12 -preset placebo -pix_fmt yuv420p -f hevc bitstream.265
    ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
      built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
      configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libx265 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
      libavutil      56. 14.100 / 56. 14.100
      libavcodec     58. 18.100 / 58. 18.100
      libavformat    58. 12.100 / 58. 12.100
      libavdevice    58.  3.100 / 58.  3.100
      libavfilter     7. 16.100 /  7. 16.100
      libavresample   4.  0.  0 /  4.  0.  0
      libswscale      5.  1.100 /  5.  1.100
      libswresample   3.  1.100 /  3.  1.100
      libpostproc    55.  1.100 / 55.  1.100
    Input #0, image2, from 'sample.jpg':
      Duration: 00:00:00.04, start: 0.000000, bitrate: 5226869 kb/s
        Stream #0:0: Video: mjpeg, yuvj444p(pc, bt470bg/unknown/unknown), 13333x4200, 25 tbr, 25 tbn, 25 tbc
    Stream mapping:
      Stream #0:0 -> #0:0 (mjpeg (native) -> hevc (libx265))
    Press [q] to stop, [?] for help
    [swscaler @ 0x7fd2e3006000] deprecated pixel format used, make sure you did set range correctly
    x265 [info]: HEVC encoder version 2.7
    x265 [info]: build info [Mac OS X][clang 9.0.0][64 bit] 8bit+10bit+12bit
    x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    x265 [error]: Picture width must be an integer multiple of the specified chroma subsampling
    [libx265 @ 0x7fd2e2802a00] Cannot open libx265 encoder.
    Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
    Conversion failed!
    
  • Python script than run another python script, ffmpeg2vmaf

    16 mai 2018, par Asusio

    I want to build a little API to use ffmpeg2vmaf to analyze videos that are made for the video streaming (DASH, HLS).

    I'm on Linux Ubuntu 16.04, I'm using python 3.

    My API can now concatenate the files into an MP4 file. To do it I'm using the library subprocess and the command cat.

    But when I want to use ffmpeg2vmaf it can't find a library that ffmpeg2vmaf use.

    This is how I do:

    try:
        os.chdir("/home/USERNAME/VMAF/vmaf/")
        output_cmd = subprocess.check_output(["sudo ./ffmpeg2vmaf WIDTH HEIGHT \
                     '/home/alexis/video/ref.mp4' '/home/alexis/video/dist.mp4'\
                     >> '/home/alexis/analyze/analyze.txt'"], shell = True)
    except subprocess.CalledProcessError:
        print("Error")
    

    The error is:

    Traceback (most recent call last):
        File "./ffmpeg2vmaf", line 8, in 
            from vmaf.config import VmafConfig, DisplayConfig
    ImportError: No module named vmaf.config
    

    But if I use the same command without python, in the terminal, it works.

    I have try to put my API in the same folder as "ffmpeg2vmaf" but it still doesn't work.

    Thank you by advance

  • FFMPEG Segment name

    16 mai 2018, par user726720

    I'm trying to save a segment from ffmpeg but keep on getting the following error:

    [mpegts @ 0000000003a20560] Invalid segment filename template 'Test-%date:~7,4%
    %date:~3,3%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%.ts'
    Could not write header for output file #0 (incorrect codec parameters ?): Inval
    d argument
    

    I do understand the way i'm trying to get the date/time in there is not correct. Can someone help me correct it please.

    here is the command:

    ffmpeg -i rtp://10.0.0.239:1234 -vcodec copy -acodec copy -f segment -segment_time 60 -segment_format ts "Test-
    %date:~7,4%-%date:~3,3%-%date:~0,2%_%time:~0,2%-%time:~3,2%-%time:~6,2%.ts"
    
  • Start .bat after files get download in torrent client

    16 mai 2018, par AniEncoder

    I tried to start a .bat file which is located in a particular folder but it doesn't start even if I write the file location.

    The files get downloaded

    C:\Users\Dhrubo\Desktop\torrent.bat
    

    TorrentScreenshot