Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg to convert .avi, .mp4, .mp3, .flv, .mkv to mp4

    10 septembre 2014, par Mikael Mezio

    I searching for a script that contains all of that attributes like the title.

    I have done one simple but that is only for one attribute so far and i do not want one script for each of all attributes to not be confused.

    Like this, running the script for like 10 minutes to see if there is any file that consist .flv and the automatic doing a convert for the file to a mp4 attribute.

    #!/bin/bash
    # Convert all flv to mp4
    ext=.mp4
    for file in *.flv; do
    currmov=$file$ext
    ffmpeg -r 15  -i $file  -b 296k -s 640x320 -vcodec mpeg4 -acodec aac $currmov
    done
    

    Thanks for help! /M

  • Problem with FFMPEG and PHP

    10 septembre 2014, par ziritrion

    I know this isn't exactly a programming question per se, but rather a settings question, but still:

    I'm trying to convert video with FFMPEG with a PHP script, following this tutorial:

    http://vexxhost.com/blog/2007/05/20/how-to-convertencode-files-to-flv-using-ffmpeg-php/

    FFMPEG works perfectly and I've used it from the command line a number of times. PHP also seems to work fine. I've also installed ffmpeg-php and it seems to be loading file.

    The problem lies when I try to do the following in PHP:

    $srcFile = "p1.avi";

    $ffmpegObj = new ffmpeg_movie($srcFile);

    No matter what, PHP will return this:

    Warning: can't open movie file p1.avi in /var/www/converter.php on line xx

    Obviously, whatever call I do afterwards with $ffmpegObj will throw a fatal error. I'm absolutely stuck and extensive googling hasn't helped much.

    If you must know, I'm using Ubuntu 9.04 with the default LAMP server packages as well as php5-ffmpeg, and I've compiled ffmpeg following a tutorial I found on Ubuntuforums (I'd link to it but stackoverflow won't let me)

    Thanks!

  • How to write a Batch/CMD file to check every 5mins if process stops then execute url ?

    10 septembre 2014, par user2068371

    So i use PHP to execute FFMPEG for video conversions and to save me manualy executing a URL to trigger the video conversions i figured it could be possible with a batch/cmd script.

    the process in question is named ffmpeg.exe

    And the url i need to execute is the following : website/index.php?option=com_hwdmediashare&task=maintenance.process&format=raw&token=LOL

    I need to check if ffmpeg.exe is running every 5 minutes if not then execute that url or perhaps i am thinking it may be more simple to launch that url through php.exe itself.

  • FFMPEG api convertion file error

    10 septembre 2014, par Thomas

    I'm trying to convert video thanks to the API (using the transcoding example) which I adapted a very few (like 5 lines) and force the codec to MJPEG. It encode 3 or 4 frames then it quit saying Invalid pts (3) <= last (3). Here's the whole trace :

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/thomas/test.mov':
      Metadata:
        major_brand     : qt  
        minor_version   : 0
        compatible_brands: qt  
        creation_time   : 2014-09-05 15:42:24
      Duration: 00:00:29.70, start: 0.000000, bitrate: 943 kb/s
        Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 935 kb/s, SAR 1:1 DAR 16:9, 60 fps, 60 tbr, 6k tbn, 50 tbc (default)
        Metadata:
          creation_time   : 2014-09-05 15:42:24
          handler_name    : Core Media Data Handler
          encoder         : H.264
          timecode        : 00:00:00:00
        Stream #0:1(und): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
        Metadata:
          creation_time   : 2014-09-05 15:42:24
          handler_name    : Core Media Data Handler
          timecode        : 00:00:00:00
    Output #0, mov, to '/Users/thomas/test_MJPEG.mov':
        Stream #0:0: Video: mjpeg, yuvj420p, 1280x720, q=2-31, 128 kb/s, 50 tbc
        Stream #0:1: Data: none (tmcd / 0x64636D74), 0 kb/s
    [mov @ 0x7ffd6202e600] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    [mov @ 0x7ffd6202e600] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    [swscaler @ 0x7ffd6204d000] deprecated pixel format used, make sure you did set range correctly
    Pushing decoded frame to filters
    Pulling filtered frame from filters
    Encoding frame
    Pulling filtered frame from filters
    Pushing decoded frame to filters
    Pulling filtered frame from filters
    Encoding frame
    Pulling filtered frame from filters
    Pushing decoded frame to filters
    Pulling filtered frame from filters
    Encoding frame
    Pulling filtered frame from filters
    Pushing decoded frame to filters
    Pulling filtered frame from filters
    Encoding frame
    Pulling filtered frame from filters
    Pushing decoded frame to filters
    Pulling filtered frame from filters
    Encoding frame
    [mjpeg @ 0x7ffd6202ec00] Invalid pts (3) <= last (3)
    Error occurred: Operation not permitted
    

    I don't know how to fix this, am I using invalid settings ?

    Here's the movie I'm working with

    FYI, I'd like to achieve the same thing than the command ffmpeg -i test.mov -vcodec mjpeg testMJPEG.mov

  • FFmpeg for Android

    10 septembre 2014, par Adroid Freak

    I'm using FFmpeg4Android for changing the resolution of videos. I can't get a good video output out of it. My command is below (copied from their website). The video looks always stretched and it doesn't looks normal. I tried so many combinations of args but I couldn't reach good results. What I need is a low a good quality video (640x360) or even less, anyone here reached the right combinations of args that achieve both fast resolution change/video compressing and good/acceptable quality using this library? Can you please advise?

    I tried many resolutions and many bitrates here, none of them is good.

    ffmpeg -y -i /sdcard/videokit/in.mp4 -strict experimental -s 320x240 -r 25 -aspect 3:4 -vcodec mpeg4 -b 2097152 -ab 48000 -ac 2 -ar 22050 /sdcard/videokit/out.mp4