Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg amerge prefer longest audio track

    4 décembre 2013, par Adam Chance

    I'm trying to combine two audio tracks in ffmpeg with amerge, but it is only as long as the shortest feature. The ffmpeg wiki says that this is the behaviour of the amerge filter, but I need the output to be as long as the longest audio track. The code I'm using is

    ffmpeg -i audio.flac -i song.flac -filter_complex amerge -acodec mp2 -b:a 128k audiotrack.mp2
    

    Console output:

        ffmpeg version N-58688-gc46ab34 Copyright (c) 2000-2013 the FFmpeg developers
        built on Dec  1 2013 14:39:22 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
        configuration: --enable-outdev=alsa --enable-indev=alsa --enable-gpl --enable-x11grab --enable-libpulse --enable-libopus --enable-libvorbis --enable-libtheora --enable-pthreads
        libavutil      52. 56.100 / 52. 56.100
        libavcodec     55. 44.100 / 55. 44.100
        libavformat    55. 22.100 / 55. 22.100
        libavdevice    55.  5.102 / 55.  5.102
        libavfilter     3. 91.100 /  3. 91.100
        libswscale      2.  5.101 /  2.  5.101
        libswresample   0. 17.104 /  0. 17.104
        libpostproc    52.  3.100 / 52.  3.100
        Input #0, flac, from 'audio.flac':
        Metadata:
        ENCODER         : Lavf55.22.100
        Duration: 00:00:04.14, bitrate: 172 kb/s
        Stream #0:0: Audio: flac, 16000 Hz, mono, s16
        Input #1, flac, from 'song.flac':
        Duration: 00:07:38.04, bitrate: 676 kb/s
        Stream #1:0: Audio: flac, 44100 Hz, stereo, s16
        Stream #1:1: Video: mjpeg, yuvj444p(pc), 500x500 [SAR 28:28 DAR 1:1], 90k tbr, 90k tbn, 90k tbc
        Metadata:
        comment         : Cover (front)
        File 'audiotrack.mp2' already exists. Overwrite ? [y/N] y
        [Parsed_amerge_0 @ 0x317f580] No channel layout for input 1
        Output #0, mp2, to 'audiotrack.mp2':
        Metadata:
        encoder         : Lavf55.22.100
        Stream #0:0: Audio: mp2, 16000 Hz, stereo, s16, 128 kb/s (default)
        Stream mapping:
        Stream #0:0 (flac) -> amerge:in0
        Stream #1:0 (flac) -> amerge:in1
        amerge -> Stream #0:0 (mp2)
        Press [q] to stop, [?] for help
        size=      65kB time=00:00:04.14 bitrate= 128.9kbits/s
    
  • Joining h264 MP4 with ffmpeg Concat without re-encoding

    4 décembre 2013, par Lisa Jacobs

    I am trying to write a batch file to stitch 3 MP4 videos together without having to re-encode them, using a text file mylist.txt:

    file 'video1.mp4'
    file 'video2.mp4'
    file 'video3.mp4'
    

    I am stitching with: ffmpeg -f concat -i input.txt -c copy output.mp4 but for some reason the second video remains with a blackscreen and/or like if the stream was corrupted. It's like there was no keyframe at the beginning of video2.mp4 ? Video2.mp4 plays fine and does not seem to be corrupted.

  • Get keyframes of video ffmpeg

    4 décembre 2013, par akash777.sharma

    I had a task of getting keyframes information of a video i.e. getting time duration of all keyframes(seeking video via rtmp url). To get information of all the frames of video use following command:

    ffprobe -show_frames testVideo.mp4 > data.txt
    

    The information I get from data.txt file :

    “keyframe=1” signifies that it tried to make keyframe
    “pict_type=I” signifies a keyframe or I-frame
    here I get exact time duration of keyframe.
    

    actual fps of video

    fps = coded_picture_number(last frame that contains coded_picture_number) / pkt_pts_time
    

    Above information worked well for most of the videos.But for some videos that were created by Red5 were showing abnormal results. List of urls I have searched
    http://sinclairmediatech.com/using-ffprobe-to-evaluate-keyframes/
    http://ffmpeg-users.933282.n4.nabble.com/How-can-I-find-the-keyframe-information-for-a-mp4-video-td4349687.html

    please help if I am wrong or need any other command. Thanks in advance.

  • Conflicting types error using linphone ios sdk

    4 décembre 2013, par VinZ

    I downloaded the linphone sdk for iphone sourcecode and compiled it on my machine. The SDK build was successful after few fixes. But while building the app in Xcode, it is throwing the following error:

    Error 1:

    /linphone-iphone/submodules/linphone/mediastreamer2/src/utils/ffmpeg-priv.h:78:17: Conflicting types for 'avcodec_alloc_context3'
    

    Error 2:

    /linphone-iphone/submodules/linphone/mediastreamer2/src/utils/ffmpeg-priv.h:82:5: Conflicting types for 'avcodec_open2'
    

    It is coming from mediastreamer2/ffmpeg source code. Any help on how to fix this is highly appreciated.

  • ffmpeg : using the returned data in php

    4 décembre 2013, par user1503606

    I have started using ffmpeg and I am very new to it, so please bear with me.

    I have installed ffmpeg on my server and it works great; I can run certain commands and get output data when logged in via ssh

    For example I can run

    ffmpeg -i Sleep\ Away.mp3 
    

    Which returns the following:

    ffmpeg version 0.8.5, Copyright (c) 2000-2011 the FFmpeg developers
      built on Aug 20 2012 09:28:43 with clang 3.1 (tags/Apple/clang-318.0.61)
      configuration: --enable-nonfree --enable-gpl --enable-version3 --enable-postproc --enable-swscale --enable-avfilter --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libfaac --enable-libxvid --enable-libx264 --enable-libvpx --enable-hardcoded-tables --enable-shared --enable-pthreads --disable-indevs --cc=clang
      libavutil    51.  9. 1 / 51.  9. 1
      libavcodec   53.  7. 0 / 53.  7. 0
      libavformat  53.  4. 0 / 53.  4. 0
      libavdevice  53.  1. 1 / 53.  1. 1
      libavfilter   2. 23. 0 /  2. 23. 0
      libswscale    2.  0. 0 /  2.  0. 0
      libpostproc  51.  2. 0 / 51.  2. 0
    [mp3 @ 0x7f9694011a00] Header missing
        Last message repeated 13 times
    [mp3 @ 0x7f9694007c00] max_analyze_duration 5000000 reached at 5007020
    [mp3 @ 0x7f9694007c00] Estimating duration from bitrate, this may be inaccurate
    Input #0, mp3, from 'Sleep Away.mp3':
      Metadata:
        track           : 3
        album           : Bob Acri
        artist          : Bob Acri
        title           : Sleep Away
        genre           : Jazz
        album_artist    : Bob Acri
        composer        : Robert R. Acri
        date            : 2004
      Duration: 00:03:21.77, start: 0.000000, bitrate: 192 kb/s
        Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 192 kb/s
    At least one output file must be specified
    

    The question I am asking is, how can I use the output data above? I am developiong a music website; say I want to loop through all the MP3 files and save the info about them into a database, so that the above would result in:

    Sleep Away.mp3    mp3    3:21    Jazz    2004     Bob Acri ...
    

    obviously in a table

    I have tried to use the php backtick operator with no success so far. I just thought I would put a question up here to get some advice from people that have done something similar.

    Thanks

    Update: I have tried the following

    <?php $output = `ffmpeg -i Sleep\ Away.mp3`; echo "
    $output
    "; ?> <?php $output = shell_exec('ffmpeg -i Sleep\ Away.mp3'); echo "
    $output
    "; ?>

    both don't appear to return anything.