Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • How to rotate a video file around an arbitrary angle using ffmpeg ? [closed]

    19 février 2013, par Listen To Your Body

    Arbitrary meaning everything but 0°, 90°, 180° and 270°.

    Arbitrary could be 64°.

  • Trying to create a batch file to convert mp4 to avi with ffmpeg [closed]

    19 février 2013, par thirdtime

    This is what I have currently, and it works fine to convert, but what I want to do, is check and see if the file has already been converted first. Then, if it hasn't been converted, save the converted file to a different folder.

    FOR %%f IN (E:/TV/TOP.GEAR*.MP4) DO
    E:/TV/FFMPEG.EXE -i %%f -q:v
    

    i.e. file located at e:/TV/filename.mp4. Check if e:/TVTranscode/filename.avi exists. If not, run the ffmpeg.exe line. The last bit of the ffmpeg line %f.avi is the output, so I don't know how I would change the directory of the output. Any help would be greatly appreciated.

  • Icecast Ogg format - mp3

    19 février 2013, par user1503606

    I am trying to setup live streaming with html5 and icecast and traktor.

    In tracktor it will only output in Ogg format.

    So i am looking for possible solution as html5 doesnt seem to work with ogg streaming on ipad and iphone.

    Is it possible to some how covert the ogg format to mp3 on the fly with something like this.

    <?php shell_exec("ffmpeg -i http://255.70.84.64:8000/stream soundpollution.mp3 2>&1"); ?>
    

    But run a loop around this so it polls maybe every 10 seconds

    Just thought id ask the community as i am trying this but not getting very far.

    And looking for a work around

    Thanks.

  • Reducing the bit rate is dropping the audio stream [closed]

    19 février 2013, par user977505

    I'm a newbie to the ffmpeg, x264 commands and conversion. So please bear w/ me.

    I've a H.264 content w/ very high bit rate and I'm using ffmepg, x264 commands to reduce the bit rate. The bit rate is getting reduced but the problem is the output doesn't have the audio stream anymore.

    Here are the commands, I'm using:

    ffmpeg.exe  -i King_Maker_Leader.mp4 -pix_fmt yuv420p -vf scale=1024:576 -r 24 \
      -f yuv4mpegpipe - | x264.exe  --bitrate 1664 --demuxer y4m \
      --preset slow --ref 3 --threads 6 --thread-input --no-scenecut \
      --no-interlaced --stats King_Maker_Leader.stats --vbv-bufsize 3328000 \
      --vbv-maxrate 1996 --pass 1 --output NUL --profile main --level 3.1 --sar 1:1 \
      --tune film --keyint 96 -
    
    ffmpeg.exe  -i King_Maker_Leader.mp4 -pix_fmt yuv420p -vf scale=1024:576 \
      -r 24 -f yuv4mpegpipe - | x264.exe  --bitrate 1664 --demuxer y4m \
      --preset slow --ref 3 --threads 6 --thread-input --no-scenecut \
      --no-interlaced --stats King_Maker_Leader.stats --vbv-bufsize 3328000 \
      --vbv-maxrate 1996 --pass 2 --output King_Maker_Leader_generated.mp4 \
      --profile main --level 3.1 --sar 1:1 --tune film --keyint 96 -
    

    I cannot figure out what is wrong with the above commands.

    I'm attaching the partial logs from pass 2 command that show the input has two streams (video and audio) and the output has only video stream.

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '..\yathrakkarude_sathruka.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf54.6.101
      Duration: 00:01:00.37, start: 0.000000, bitrate: 8587 kb/s
        Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 720x576 [
    SAR 16:11 DAR 20:11], 8073 kb/s, 25 fps, 25 tbr, 25k tbn, 50 tbc
        Metadata:
          handler_name    : VideoHandler
        Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, s16, 508
     kb/s
        Metadata:
          handler_name    : SoundHandler
    Output #0, yuv4mpegpipe, to 'pipe:':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf54.25.104
        Stream #0:0(eng): Video: rawvideo (I420 / 0x30323449), yuv420p, 1024x576 [SA
    R 45:44 DAR 20:11], q=2-31, 200 kb/s, 90k tbn, 24 tbc
        Metadata:
          handler_name    : VideoHandler
    Stream mapping:
      Stream #0:0 -> #0:0 (h264 -> rawvideo)
    Press [q] to stop, [?] for help
    [yuv4mpegpipe @ 016d5800] Encoder did not produce proper pts, making some up.
    y4m [info]: 1024x576p 45:44 @ 24/1 fps (cfr)
    x264 [info]: using SAR=1/1
    x264 [warning]: VBV buffer (2000000) > level limit (14000)
    x264 [info]: using cpu capabilities: MMX2 SSE2Fast FastShuffle SSEMisalign LZCNT
    
  • Is there a way a video can be encoded on its own when uploaded into server

    18 février 2013, par user1914374

    Below is my code where it uploads a file into a server and stores the names of each uploaded file into the db:

    <?php
    
     // connect to the database
     include('connect.php');
    
      /* check connection */
      if (mysqli_connect_errno()) {
        printf("Connect failed: %s\n", mysqli_connect_error());
        die();
      }
    
    
        if ($_FILES['fileVideo']['error'] === UPLOAD_ERR_OK) { 
    
    $result = 0;
    
    
    if( file_exists("VideoFiles/".$_FILES['fileVideo']['name'])) {
        $parts = explode(".",$_FILES['fileVideo']['name']);
        $ext = array_pop($parts);
        $base = implode(".",$parts);
        $n = 2;
    
        while( file_exists("VideoFiles/".$base."_".$n.".".$ext)) $n++;
        $_FILES['fileVideo']['name'] = $base."_".$n.".".$ext;
    
        move_uploaded_file($_FILES["fileVideo"]["tmp_name"],
        "VideoFiles/" . $_FILES["fileVideo"]["name"]);
        $result = 1;
    
    }
        else
          {
          move_uploaded_file($_FILES["fileVideo"]["tmp_name"],
          "VideoFiles/" . $_FILES["fileVideo"]["name"]);
          $result = 1;
      }
    
        $videosql = "INSERT INTO Video (VideoFile) 
        VALUES (?)";
    
            if (!$insert = $mysqli->prepare($videosql)) {
          // Handle errors with prepare operation here
        }
    
        //Assign the variable
    $vid = 'VideoFiles/'.$_FILES['fileVideo']['name'];
    
                //Dont pass data directly to bind_param store it in a variable
    $insert->bind_param("s",$vid);
    
     $insert->execute();
     $id = $mysqli->insert_id;
    
            if ($insert->errno) {
              // Handle query error here
            }
    
            $insert->close();     
    
            }else{
      echo "Upload was not successful";   
      }
    
    ?>
    
     <script language="javascript" type="text/javascript">
    window.top.stopVideoUpload(&lt;?php echo $result; ?>,&#39;&lt;?php echo $id; ?>&#39;, &#39;&lt;?php echo $_FILES[&#39;fileVideo&#39;][&#39;name&#39;]; ?>&#39;);
    </script>

    Now I am using a jwplayer and it requires video files to match video formats on this page:

    http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/12539/supported-video-and-audio-formats/

    So I need to be able to encode files automatically on the server when the file is uploaded into the server. I do not want the user to try and encode a video file manually by themseleves, I want it done automatically. But my question is how can I get automatic server side file encoding to work?

    I have a demo showing how a video file is uploaded: DEMO

    To use Demo:

    1. Click on Add Question button and file input will appear in table

    2. Click on upload straightaway and you will see a simple validation stating which video file format are allowed (this is simply done by checking video file extension)

    3. Browse for a video file, select and then click on Upload and wait for upload to finish (I recommend a short video file for saving time). When file is uploaded it will display success message and video file is uploaded into server,