Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFMPEG - can you have comments in script files ?

    25 mai, par rossmcm

    Because of batch's poor ability to handle multi-line strings, I'm using FFMPEG script files more and more for filter_complex arguments. I'm wondering if there is any way to include comments in these files. They seem to be quite tolerant of white space and line breaks. I've tried:

    #
    #   comment
    #
    

    and

    ;
    ;   comment
    ;
    

    and

    `
    `   comment
    `
    

    and

    '
    '   comment
    '
    

    with no success. It doesn't look as if comments are officially supported, but I'm wondering of there is some syntax quirk that allows them?

    *** CLARIFICATION ***

    I'm not talking about comments in batch files here, but comments in filter_complex_script files. FFMPEG supports specifying the filter_complex argument string in a separate file. So instead of:

    ffmpeg -i "input.mp4" -filter_complex "[0:v] crop=w=100:h=100:x=12:y=34 " "output.mp4"
    

    you can specify:

    ffmpeg -i "input.mp4" -filter_complex_script "crop.txt" "output.mp4"
    

    where crop.txt contains

    [0:v] crop=w=100:h=100:x=12:y=34
    

    This is really handy when the filter_complex string gets more complicated (I routinely deal with arguments 10,000 characters in length).

  • How can i burn in the current video playback percentage on to a video stream using FFMpeg

    25 mai, par David Clews

    I've taken alook at the drawtext filter in ffmpeg and it offers the ability to burn in the current local time directly on to the video stream. I would like this sort of behaviour but for a integer percentage value and the percentage symbol % after the actual value. I don't know if this is possible using FFMpeg on the command line. The formula should be something like.

    ceil((t/duration)*100)

  • FFMPEG RTSP Stream timeout triggered after 30015.187000 ms

    25 mai, par BatCoder

    I am trying to read several RTSP streams using opencv cv2.VideoCapture(URL). It has FFMPEG backend. Sometimes for few streams it is throwing timeout warning after 30 seconds.

    [ WARN:0@123.394] global cap_ffmpeg_impl.hpp:453 _opencv_ffmpeg_interrupt_callback Stream timeout triggered after 30015.187000 ms
    

    I tried setting up the timeout flag.

    import os
    os.environ["OPENCV_FFMPEG_CAPTURE_OPTIONS"] = "timeout;5000" # 5 seconds 
    cv2.VideoCapture("rtsp://URL", cv2.CAP_FFMPEG)
    

    Ref: How to terminate cv2.VideoCapture(rtsp_url) call if execution stalls due to RTSP camera issues?

    But still, it is waiting for 30 seconds before raising the warning.

    OpenCV version: 4.4.0.x Python version: 3.9.x

    Can we decrease the wait time from 30 seconds to a lower number ?

  • Convert m3u8 (HLS) to mpd (MPEG-DASH)

    24 mai, par Almog

    I have Live stream of HLS [https://82-80-192-30.vidnt.com/ipbc_IPBCchannel11LVMRepeat/definst/IPBCchannel11LVM_3.stream/playlist.m3u8] and I want to convert it to MPEG-DASH.

    What is the best practice?

    The stream is already h264 aac therefore I understand I do not need to reencode and I just need to transmux.

    What should I use? ffmpeg? mp4box?

    Notes:

    1. I used nginx-rtmp-module (https://github.com/ut0mt8/nginx-rtmp-module/) in order to create DASH from RTMP stream according to this tutorial: https://isrv.pw/html5-live-streaming-with-mpeg-dash But nginx-rtmp-module can get as input just rtmp streams and it did not work for me with HLS stream.

    2. I used ffmpeg in order to create dash from m3u8 as following:

      ffmpeg -i https://82-80-192-30.vidnt.com/ipbc_IPBCchannel11LVMRepeat/_definst_/IPBCchannel11LVM_3.stream/playlist.m3u8 -strict -2 -min_seg_duration 2000 -window_size 5 -extra_window_size 5 -use_template 1 -use_timeline 1 -f dash out.mpd

    But this is very limited. I can't control the segment duration. The min_seg_duration parameter of ffmpeg does not work very well for me, and also it can set the minimum duration while I want to limit the maximum duration of each segment (the segment comes out with ~10 seconds, while I need it to be ~2-4 seconds as I'm playing live).

  • How can I convert WebM files into M4A in flutter ?

    24 mai, par Sohail Anwar

    Before that I was using ffmpeg_kit_flutter package for converting WebM files into M4A for both android and ios, Now this package was retired, Have any alternative of this package?