Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Live stream PowerPoint + Video - ffmpeg ? [on hold]

    21 novembre 2016, par Mango

    I'm in the unenviable position of needing to live stream a seminar with one video camera and PowerPoint. We need to switch between the video and PowerPoint at arbitrary times. The switch need not be fancy like a dissolve, and in fact it can take up to three seconds. The audio however must remain uninterrupted and must be synced with both video streams.

    I had the idea of creating a batch file with two ffmpeg commands: one that captured the desktop, and one that captured video from the camera. ffmpeg pushes the video to a local UDP port. Then, it loops.

    A separate ffmpeg process receives the local stream and pushes it to an RTMP server. All I have to do to switch video sources is kill the first ffmpeg.

    This works for video, but I haven't figured out how to get the audio to sync.

    I'm aware of expensive video production software that provides this sort of thing as a service, but I thought I would see if I could do it open source if possible.

    Any suggestions would be appreciated.

  • Terminal text becomes invisible after terminating subprocess

    21 novembre 2016, par wim

    After terminating an ffmpeg subprocess, the terminal gets messed up - typed characters are invisible! The input still works in that commands can be executed, but keyboard input is not echoed to the terminal.

    Issuing shell command reset puts everything back to normal (or !reset from within ipython), so a workaround the issue is calling os.system('reset') inside the script.

    Other things I've tried: import curses; curses.initscr() before spawning the subprocess and curses.endwin() after termination, which worked somewhat but broke other stuff. Another possibly related issue is that after spawning the child process, the interactive terminal becomes laggy and sometimes fails to capture typed characters.

    The code to spawn the process looks like:

    with open('/tmp/stdout.log', 'w') as o:
        with open('/tmp/stderr.log', 'w') as e:
            proc = subprocess.Popen([args], stdout=o, stderr=e)
    

    And later to stop it:

    proc.terminate()
    proc.communicate()
    

    What could be going wrong here?

  • FFmpeg : Trim video then add watermark with multiple text

    21 novembre 2016, par Iura Gaitur

    I want to trim a video then convert a video using FFMPEG and place a watermark with multiple texts on it. I have commands for trimming :

    ffmpeg -i 1.mp4 -ss 00:00:03 -t 00:03:08 -async 1 -c copy output1.mp4

    and for watermark with text placing

    ffmpeg -i 1.mp4 -i watermark_small.png -filter_complex "[0:v][1:v]overlay=10:10, drawtext=enable='between(t,0,12)':fontfile=font.ttf:text='Some text' : fontcolor=black: fontsize=18: box=1: boxcolor=yellow@0.5:boxborderw=5: x=(w-text_w)/1.15:y=30, drawtext=enable='between(t,14,22)':fontfile=font.ttf:text='Next text' : fontcolor=black: fontsize=18: box=1: boxcolor=yellow@0.5:boxborderw=5: x=(w-text_w)/1.15:y=30" -codec:v libx264 -preset ultrafast output1.mp4

    Can someone help me to combine them together?

  • Can't use ffmpeg 3.2 in Android project

    21 novembre 2016, par world2ashish

    Tried almost everything, spent almost 4-5 days trying and still counting.

    The reason I want to compile recent version of ffmpeg is because https://github.com/WritingMinds/ffmpeg-android-java doesn't work for video rotation. For this also I tried multiple answers, different versions of answer (transpose=1, transpose=dir=cclock, etc)

    Somewhere it was mentioned that rotate command wont work with previous versions of ffmpeg, so after a lot of trials, I started working on compilation of new ffmpeg. But all the tutorials for ffmpeg belong to earlier versions (of Android NDk, ffmpeg) which wont work with ffmpeg 3.2 and NDK r13b (I also tried with NDK downloaded by studio itself but no luck). In case it worked for you, please help.

    After a lot of frustrating experience I am writing this. Please help with a workflow or a clear direction. Thanks

    Wasnt able to tag ffmpeg3.2 because of reputation.

  • Installing OpenCV 3.1.0 with CMake on Windows 7, opencv_ffmpeg.dll invalid hash

    21 novembre 2016, par Troppsi

    I'm trying to install OpenCV 3.1.0 with MSVC2015 compiler using CMake. I get an error saying that the file hash is different from the expected hash. I have no access to internet on the PC this needs to be installed on. I tired to install it successfully on a PC with internet to see if I could copy those files to the PC without internet. But that didn't work as CMake deletes the files, and tries to do it it's own way. I also tried this solution, but it didn't work.

    Here is the error message:

    CMake Warning at cmake/OpenCVUtils.cmake:872 (message):
      Download: Local copy of opencv_ffmpeg.dll has invalid MD5 hash:
      d41d8cd98f00b204e9800998ecf8427e (expected:
      89c783eee1c47bfc733f08334ec2e31c)
    Call Stack (most recent call first):
      3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download)
      cmake/OpenCVFindLibsVideo.cmake:206 (include)
      CMakeLists.txt:536 (include)
    
    Downloading opencv_ffmpeg.dll...
    CMake Error at cmake/OpenCVUtils.cmake:895 (file):
      file DOWNLOAD HASH mismatch
    
        for file: [C:/OpenCV/opencv/sources/3rdparty/ffmpeg/downloads/89c783eee1c47bfc733f08334ec2e31c/opencv_ffmpeg.dll]
          expected hash: [89c783eee1c47bfc733f08334ec2e31c]
            actual hash: [d41d8cd98f00b204e9800998ecf8427e]
                 status: [6;"Couldn't resolve host name"]
    
    Call Stack (most recent call first):
      3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download)
      cmake/OpenCVFindLibsVideo.cmake:206 (include)
      CMakeLists.txt:536 (include)
    
    
    CMake Error at cmake/OpenCVUtils.cmake:899 (message):
      Failed to download opencv_ffmpeg.dll.  Status=6;"Couldn't resolve host
      name"
    Call Stack (most recent call first):
      3rdparty/ffmpeg/ffmpeg.cmake:10 (ocv_download)
      cmake/OpenCVFindLibsVideo.cmake:206 (include)
      CMakeLists.txt:536 (include)
    

    I would like to be able to install this without internet, but it proves very diffucult. Does anyone have any solutions to this?

    Thanks in advance.