Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg mosaic keep audio of all input videos

    11 juin 2017, par FSH

    I have five videos and want to combine them into one big "strip" with all five videos next to each other.

    My code so far (following this example):

    ffmpeg
        -i s-0-h-0.mp4 -i s-1-h-0.mp4 -i s-2-h-0.mp4 -i s-3-h-0.mp4 -i s-4-h-0.mp4
        -filter_complex "
            nullsrc=size=4240x478 [base];
            [0:v] setpts=PTS-STARTPTS, scale=848x478 [vid1];
            [1:v] setpts=PTS-STARTPTS, scale=848x478 [vid2];
            [2:v] setpts=PTS-STARTPTS, scale=848x478 [vid3];
            [3:v] setpts=PTS-STARTPTS, scale=848x478 [vid4];
            [4:v] setpts=PTS-STARTPTS, scale=848x478 [vid5];
            [base][vid1] overlay=shortest=1 [tmp1];
            [tmp1][vid2] overlay=shortest=1:x=848 [tmp2];
            [tmp2][vid3] overlay=shortest=1:x=1696 [tmp3];
            [tmp3][vid4] overlay=shortest=1:x=2544 [tmp4];
            [tmp4][vid5] overlay=shortest=1:x=3392
        "
       -c:v libx264 output.mkv
    

    However, this only includes the audio from input 1.

    How do I keep the audio of all five input videos?

  • ffmpeg stucks after each song

    11 juin 2017, par Halfbax

    When I start to stream to youtube, it works fine. Until the first song is over. After it the stream is in a loop of the last 20 seconds. I dont know why. The next song wont ever streamed.

    The audio stream is lag-free. <- tested

    case $1 in
                    start)
                            # VLC audio stream
                            su vlc -c "screen -dmS $VLC_PID_NAME cvlc --random /home/music/chill/*.mp3 --sout '#transcode{vcodec=none,acodec=mp3,ab=128}:standard{access=http,mux=raw,dst=localhost:8080/live.ogg}'"
    
                            sleep 2
                            # FFMPEG
                            # Static image + vlc audio stream
                            screen -dmS $FFMPEG_PID_NAME ffmpeg -loop 1 -framerate 2 -i '/home/forest.jpg' -i 'http://localhost:8080/live.ogg' -s "$INRES" -r "$FPS" -f alsa -ac 2 -vcodec libx264 -s "$OUTRES" -g 2 -acodec libmp3lame -b:a 128k -b:v 200k -ar 44100 -threads 0 -preset:v "$QUAL" -f flv "rtmp://a.rtmp.youtube.com/live2/$STREAM_KEY"
                            ;;
    
  • Launching an exe from CMD closes immediatly

    11 juin 2017, par user2566350

    I tried googling for an hour but I can't find anything to fix my issue i only find "similar" fixes for problems i'm not having please help me!

    I will try my best to explain: I am opening ffmpeg.exe from a batch file that only has ffmpeg.exe with no arguments in it and it doesn't work even tho it did few hours ago.

    If I open command line from the folder and enter ffmpeg.exe it does work, (as in it's not closing ffmpeg but wait for my input) which is exactly how the batch file worked before.

    What could be the issue? I have not changed the bat file or the ffmpeg one or their locations.

    Running on win7x64 if that matter.

    Edit: File name is "start ffmpeg.bat" it's content is only ffmpeg.exe (which used to work, I also tried "start ffmpeg.exe" and "ffmpeg" and changed the filename to "1.bat"/"1.cmd" but neither worked)

  • AttributeError : 'NoneType' object has no attribute 'tostring'

    10 juin 2017, par Antoine Pouliot

    So I just started programming a few days ago and I have this problem: AttributeError: 'NoneType' object has no attribute 'tostring'. I don't know what is wrong.

    #Reads through each frame, calculates the timestamp, places it on the frame and
    #exports the frame to the output video.
    while current_frame < total_frames:
        success, image = video.read()
        elapsed_time = video.get(cv2.CAP_PROP_POS_MSEC)
        current_frame = video.get(cv2.CAP_PROP_POS_FRAMES)
        timestamp = initial + dt.timedelta(microseconds = elapsed_time*1000)
        cv2.putText(image, 'Date: ' + str(timestamp)[0:10], (50,int(height-150)), cv2.FONT_HERSHEY_COMPLEX_SMALL, 2, (255, 255, 255), 3)
        cv2.putText(image, 'Time: ' + str(timestamp)[11:-4], (50,int(height-100)), cv2.FONT_HERSHEY_COMPLEX_SMALL, 2, (255, 255, 255), 3)
        pipe.stdin.write(image.tostring())
    
  • FFMpeg-PHP Headers Not Found on CentOS / cpanel

    10 juin 2017, par Colter

    I have looked all over for directions on how to install. I have followed the guide at ffmpeg(dot)org/wiki/CompilationGuide/Centos FFMpeg works fine as I have been able to convert an mp3 and mp4. My issue is when I try to setup FFMpeg-PHP. When I run ./configure --prefix=/usr --enable-shared --with-php-config=/opt/cpanel/ea-php71/root/usr/bin/php-config ffmpeg-php I am getting two errors.

    • configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
    • checking for ffmpeg headers... configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option

    FFMpeg Info

    ffmpeg version 2.6.8 Copyright (c) 2000-2016 the FFmpeg developers built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)

    FFMpeg-PHP Output

    checking for grep that handles long lines and -e... /bin/grep
    checking for egrep... /bin/grep -E
    checking for a sed that does not truncate output... /bin/sed
    checking for cc... cc
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether cc accepts -g... yes
    checking for cc option to accept ISO C89... none needed
    checking how to run the C preprocessor... cc -E
    checking for icc... no
    checking for suncc... no
    checking whether cc understands -c and -o together... yes
    checking for system library directory... lib
    checking if compiler supports -R... no
    checking if compiler supports -Wl,-rpath,... yes
    checking build system type... x86_64-unknown-linux-gnu
    checking host system type... x86_64-unknown-linux-gnu
    checking target system type... x86_64-unknown-linux-gnu
    checking for PHP prefix... /opt/cpanel/ea-php71/root/usr
    checking for PHP includes... -I/opt/cpanel/ea-php71/root/usr/include/php -I/opt/cpanel/ea-php71/root/usr/include/php/main -I/opt/cpanel/ea-php71/root/usr/include/php/TSRM -I/opt/cpanel/ea-php71/root/usr/include/php/Zend -I/opt/cpanel/ea-php71/root/usr/include/php/ext -I/opt/cpanel/ea-php71/root/usr/include/php/ext/date/lib
    checking for PHP extension directory... /opt/cpanel/ea-php71/root/usr/lib64/php/modules
    checking for PHP installed headers prefix... /opt/cpanel/ea-php71/root/usr/include/php
    checking if debug is enabled... no
    checking if zts is enabled... no
    checking for re2c... no
    configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
    checking for gawk... gawk
    checking for ffmpeg support... yes, shared
    checking whether to force gd support in ffmpeg-php... no
    checking for ffmpeg headers...
    configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option
    

    I am not sure if this is related but I am also having an issue running yum update.

    root@cvp259 [/]# yum update
    Loaded plugins: fastestmirror, tsflags, universal-hooks
    Setting up Update Process
    Loading mirror speeds from cached hostfile
     * EA4: 67.222.0.10
     * cpanel-addons-production-feed: 67.222.0.10
     * base: centos.unixheads.org
     * epel: pubmirror2.math.uh.edu
     * extras: repos.dfw.quadranet.com
     * nux-dextop: mirror.li.nux.ro
     * updates: mirror.steadfast.net
    Resolving Dependencies
    --> Running transaction check
    ---> Package nasm.x86_64 0:2.07-7.el6 will be updated
    ---> Package nasm.x86_64 0:2.13.01-0.fc24 will be an update
    --> Processing Dependency: libc.so.6(GLIBC_2.14)(64bit) for package: nasm-2.13.01-0.fc24.x86_64
    --> Finished Dependency Resolution
    Error: Package: nasm-2.13.01-0.fc24.x86_64 (nasm)
               Requires: libc.so.6(GLIBC_2.14)(64bit)
     You could try using --skip-broken to work around the problem
     You could try running: rpm -Va --nofiles --nodigest
    

    Any help would be appreciated.