Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Trouble getting video stream from Bebop 2 (python, open cv and ffmpeg)

    20 décembre 2018, par Seb A

    I'm currently working with the Bebop 2 drone from parrot and I would like to get the video stream from the bebop and to use the frame I get. To control the bebop I'm using this library : https://github.com/amymcgovern/pyparrot.

    First I've tried to use opencv by opening the sdp file used by the bebop to stream the video with this code :

    capture = cv2.VideoCapture('./bebop.sdp')
    
        while True :
            rt,img = capture.read()
            cv2.imshow("cam",img)
            cv2.waitKey(10)
    

    here is the content of the sdp file :

    c=IN IP4 192.168.42.1
    m=video 55004 RTP/AVP 96
    a=rtpmap:96 H264/90000
    

    but I got this error

    [rtp @ 0000020b890b3300] Protocol 'rtp' not on whitelist 'file,crypto'!
    warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:808)
    warning: ./bebop.sdp (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:809)
    False
    OpenCV Error: Assertion failed (size.width>0 && size.height>0) in cv::imshow, file C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp, line 331
    Traceback (most recent call last):
     File "pilotage.py", line 109, in 
       _main_(args)
     File "pilotage.py", line 56, in main
       cv2.imshow('drone view',im)
    cv2.error: C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:331: error: (-215) size.width>0 && size.height>0 in function cv::imshow
    

    I've seen that this is due to the ffmpeg command used by opencv that does not include the option -protocol_whitelist So I tried to get the image directly with ffmpeg by using this command

    "ffmpeg -protocol_whitelist \"file,rtp,udp\"  -i  ./bebop.sdp -r 30 -b:v 800k image_%03d.png &"
    

    But the images I got were awful and useless. Like this one : bad quality photo

    So I tried different options to improve the quality but I can't get it to work. Thanks for your help.

    I'm on windows 10 and using latest python version

  • ffmpeg some frames are skipped or not getting visible

    20 décembre 2018, par pooja modi

    I am changing frames in every second of video, But some of them are getting glitched or not getting visible properly. My all frames are .png files and all of them are being made properly can't figure out what is the problem. Here, I am mention command for FFmpeg:

      String[] complexCommand = {"-y", "-i", videoPath, "-framerate",  "1", "-i", inputfile + "/" + "datetime%d" + ".png", "-filter_complex", "[0:v]scale=" + width + ":" + height + "[bg];[i]fps=25[i];[bg][1:v]overlay=(0+" + Height + "):(main_h-overlay_h-" + Width +")", "-preset", "ultrafast", outputfile};
    
  • Linking PHP audio and video uploads to FFMPEG on a linux server

    20 décembre 2018, par user5399793

    I host a site on a Linux server that I built with php where I am able to upload audio files in one section and video files to another.

    Each section uses php to upload a single audio file and a single video file. Each upload is assigned a unique filename so they can be viewed separately on an individual page where the uploader can post comments about their audio or video.

    I want to be able to allow musicians and performers in the local area display their work. The site works, but large video files do not upload and my audio player only plays a few formats, and I like to convert them all to mp3's.

    I installed ffmpeg on my linux server to help me with this and am able to connect to it with my terminal. My question is how do I get ffmpeg to interface with my uploaded php files.

    For example, as the user uploads an audio file, can I have ffmpeg convert it while it's uploading, or do I need to set up a temporary folder for uploads, store it there, then have ffmpeg compress the file, convert it to a specific format and save it in another folder?

    I would prefer to have it compress and change the format while it's uploading so as not to use server space, but if this is not the way ffmpeg works, then I don't have a choice. Any help would be appreciated.

  • Pass option or argument in ffmpeg

    20 décembre 2018, par babak

    I'm doing some modification into af_silencedetect.c file, one of the ffmpeg many filters and I want to pass a unique option in when I run ffmpeg. I need ffmpeg to save silence that it found and put them in different log file with unique ID that I'm passing, because I'm running multiple ffmpegs at the same time. Here is what I try to do:

    ffmpeg -i audio.mp3 -vn -af silencedetect=n=-50dB:d=1:id=01 -f mp3 out.mp3
    

    How to do that? How to create new parameter and pass it in and grep it inside ffmpeg?

  • How to concatenate .webm files and convert the resulting video to .mp4 using ffmpeg

    20 décembre 2018, par MAX

    I'v tried many methods nothing is working for example

    ffmpeg -i A.mov -i B.mov -i C.mov -i D.mov -filter_complex "[0:0] [0:1] [1:0] [1:1] [2:0] [2:1] [3:0] [3:1] concat=n=4:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" output.mp4`
    
    ffmpeg -i "concat:A.webm | B.webm | C.webm | D.webm" -c copy output.mp4
    
    ffmpeg -i 1.webm -i 2.webm -i 3.webm -i 4.webm -i 5.webm -filter_complex "[0:0] [0:1] [1:0] [1:1] [2:0] [2:1] [3:0] [3:1] [4:0] [4:1] concat=n=5:v=1:a=1 [v] [a]" -map "[v]" -map "[a]" -c:a libfdk_aac -c:v libx264 output.mp4
    

    Always I find these errors or warning

    [libvo_aacenc @ 04091820] Queue input is backward in time
    
    Last message repeated 4 times
    
    [mp4 @ 0408f0c0] Non-monotonous DTS in output stream 0:1; previous: 770, current: 768; changing to 771.
    
    [libvo_aacenc @ 04091820] Queue input is backward in time
    
    [mp4 @ 0408f0c0] Non-monotonous DTS in output stream 0:1; previous: 771, current: 768; changing to 772.
    
    [libvo_aacenc @ 04091820] Queue input is backward in time
    
    [mp4 @ 0408f0c0] Non-monotonous DTS in output stream 0:1; previous: 772, current: 768; changing to 773.
    [libvo_aacenc @ 04091820] Queue input is backward in time
    
    [mp4 @ 0408f0c0] Non-monotonous DTS in output stream 0:1; previous: 773, current: 768; changing to 774.
    
    [mp4 @ 0408f0c0] Non-monotonous DTS in output stream 0:1; previous: 774, current: 768; changing to 775.
    [libvo_aacenc @ 04091820] Queue input is backward in time
    

    Is there any way to do it or Its not possible....???