Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Mac Terminal (Bash) batch program to get multimedia file info using ffmpeg

    7 décembre 2013, par julesverne

    I have a Mac computer. Usually all my batch programming is done on my PC. So I tried to create what I assumed would be a simple equivalent using a Mac shell. Obviously as you all know that was foolish of me to think that. After 2 days of scowering the web I found the closest thing I could to what I was looking for. But no, this doesn't work either.

    All I'd like to do is throw a multimedia file onto the script, and have the terminal give me the ffmpeg info output. In my searching I did find this "$@" which as far as I can tell is the windows bat equivalent of %*. Meaning you can throw files on the script and the script refers to those files as variables which can be processed. So I believe what I want to do is possible.

    Again the code at the bottom is just to look through the current directory of all .mov files and run ffmpeg. It doesn't work. But.. if no one can help me figure out the actual thing I'd like to do then I'd settle with something like below that does actually work.

    #!/bin/bash
    FFMPEG=/Applications/ffmpeg
    FIND=/usr/bin/find
    FILES=$(${FIND} . -type f  -iname "*.mov")
    if [ "$FILES" == "" ]
    then
    echo "There are no *.mov file in $(pwd) directory"
    exit 1
    fi
    
    for f in *.mov
    do
    
    $FFMPEG -i "$f"
    
    done
    

    If someone can please help me figure this out I'd really appreciate it. Thank you in advance! Jules

    I just found this solution from the "similar questions" sidebar, which is similar to the script above, so again, not completely what I wanted but.. didn't matter, didn't work for me. How to batch convert mp4 files to ogg with ffmpeg using a bash command or Ruby

  • ffmpeg is dropping frames and only using 1/10 cpu [on hold]

    7 décembre 2013, par wlraider70

    I have some old hardware so I'm not expecting miracles. I want to stream from a webcam to ustream at standard quality.

    I'm using a code like

    sudo ffmpeg -re -f v4l2 -i /dev/video1 -f flv "rtmp://1.16543hvtJ6aU flashver=FME/2.5\20(compatible;\20FMSc\201.0)"
    

    or

       sudo ffmpeg -re -f v4l2 -r 25 -s 640x480 -i /dev/video1 -f flv "rtmp://1.166aU flashver=FME/2.5\20(compatible;\20FMSc\201.0)
    

    I'm getting results like

    Tasks: 102 total,   1 running,  99 sleeping,   2 stopped,   0 zombie
    Cpu(s):  5.7%us,  0.7%sy,  0.0%ni, 93.6%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
    Mem:   1920560k total,   339028k used,  1581532k free,    19112k buffers
    Swap:  1963004k total,        0k used,  1963004k free,   129300k cached
    
      PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
     3176 root      20   0  222m  31m  24m S  5.0  1.7   0:01.60 ffmpeg
    

    and

      Metadata:
        encoder         : Lavf53.32.100
        Stream #0:0: Video: flv1 ([2][0][0][0] / 0x0002), yuv420p, 640x480, q=2-31, 200 kb/s, 1k tbn, 30 tbc
    Stream mapping:
      Stream #0:0 -> #0:0 (rawvideo -> flv)
    Press [q] to stop, [?] for help
    frame=  330 fps=  5 q=2.5 size=     808kB time=00:01:02.70 bitrate= 105.5kbits/s dup=0 drop=137
    

    How can I push the system harder or figure out where my bottleneck is?

  • understanding usage of H264 video codec parameters in ffmpeg

    7 décembre 2013, par John Qualis

    I am new to PJSIP. I want to understand which parameters does ffmpeg encoder use from "ffmpeg_codec_desc" parameters in "ffmpeg_vid_codesc.c" in pjmedia? Suppose we change "ffmpeg_codec_desc" parameters for H264 as follows: for eg. change the resolution from {352, 288} to {576, 432} and change the frame rate from 15 to 20 but keep max and avg bit rates to 128000.

    Which H264 parameters does ffmpeg use to produce a H264 stream? And what is the relationship between resolution, frame rate and bit rate?

    Any input is much appreciated

  • Extract frames and miliseconds

    6 décembre 2013, par Gonzalo Solera

    I would like to be able to extract all the frames of a video and their respectives times. I'm using ffmpeg compiled staticall for android and I'm using this command to extract all the frames of a video:

    ffmpeg -i /inputFile.mp4/ -y /output/%d.jpg
    

    This works good but I would be very grateful if anyone could show me how to record in an arraylist the time of each frame. (I suppose reading the output when I execute the command):

    Process p = Runtime.getRuntime().exec(myCommand);
    

    Thanks for help!!

  • ffmpeg binary which can work on Ubuntu version 13.10 [on hold]

    6 décembre 2013, par user2007454

    Can anybody tell me where can I find ffmpeg binary for ubuntu version 13.10, I have spent days in ffmpeg compilation but every time I try to convert my video file from one format to other I am getting an eror I think working with binary would be a good idea plz do share your comments on this

    ffmpeg -i linux_vid.mp4 linux_vid.avi
    ffmpeg version 0.8.9-6:0.8.9-0ubuntu0.13.10.1, Copyright (c) 2000-2013 the Libav developers
      built on Nov  9 2013 19:15:22 with gcc 4.8.1
    *** THIS PROGRAM IS DEPRECATED ***
    This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'linux_vid.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf54.59.106
        comment         : 1364833251131047
      Duration: 00:00:56.45, start: 0.000000, bitrate: 231 kb/s
        Stream #0.0(und): Video: h264 (Constrained Baseline), yuv420p, 320x238 [PAR 4057:4095 DAR 129824:97461], 133 kb/s, PAR 41531:41920 DAR 349:262, 24 fps, 24 tbr, 12288 tbn, 48 tbc
        Stream #0.1(und): Audio: aac, 44100 Hz, stereo, s16, 93 kb/s
    [buffer @ 0x94225c0] w:320 h:238 pixfmt:yuv420p
    [mpeg4 @ 0x943fa80] Invalid pixel aspect ratio 41531/41920, limit is 255/255
    Output #0, avi, to 'linux_vid.avi':
        Stream #0.0(und): Video: mpeg4, yuv420p, 320x238 [PAR 41531:41920 DAR 349:262], q=2-31, 200 kb/s, 90k tbn, 24 tbc
        Stream #0.1(und): Audio: libmp3lame, 44100 Hz, stereo, s16, 200 kb/s
    Stream mapping:
      Stream #0.0 -> #0.0
      Stream #0.1 -> #0.1
    Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height