Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • How do I set the first and last frame of a video to be an image ?

    16 septembre 2011, par user205865

    HTML 5 implementations are different across various browsers. In firefox, the image specified by the placeholder attribute will be shown until the user clicks play on the video. In chrome, the placeholder image is shown until the video is loaded (not played), at which point the first frame of the video is shown.

    To reconcile this issue, I would like to set the first frame of the video to the placeholder image so that the experience will be the same in both browsers.

    I would preferably do this using ffmpeg or mencoder. I have very limited experience using these however, so if someone could point me in the right direction, I would be much obliged.

    Thanks!

  • PHP's exec() not executing command for FFmpeg

    16 septembre 2011, par tundoopani

    I have installed ffmpeg on my server and it works fine via my terminal. I'm able to successfully convert a file to webm format, so I'm sure the installation is fine. I'm also sure that I only have one installation of ffmpeg installed on my machine.

    A problem arises when I try to convert files through PHP via PHP's exec(). When I run the same commands, I ran in the terminal, nothing happens. I looked around stackoverflow and other parts of the net for some help. I tried this to see the output:

    exec($cmd, $out, $rv);
    echo "output is:\n".implode("\n", $out)."\n exit code:$rv\n";
    

    The output is: "output is: exit code:127"

    The command I'm using is in this format:

    ffmpeg -i "sample.mov" -vcodec libvpx  -r 30 -b "644k" -acodec libvorbis -ab 128000   -ar "44100" -ac 2 -s "352x198" "sample.webm"
    

    I've tried replacing "ffmpeg" with the full path to FFmpeg but that did not work.

    Why isn't the script running the command correctly and converting the files?

    Thank you!

  • FFMpeg API Write AVPackets to new H264 file without Decoding / Transcoding

    15 septembre 2011, par mhathcock

    Using the FFMpeg API in Windows 7 64bit with MSVC++ 2010:

    Using video files in MP4 container, with Video in H264 and Audio in AAC.

    I can successfullly read packets, decode them, encode them, and write them back to a video file using the normal av_read_frame, avcodec_decode_video, etc.

    What i want to do is read a packet, and write it to the output file immediately, without encoding or decoding. Essentially, to be able to take packets from different video files (that are all identical size, bitrate, fps, etc) and write them into 1 video file.

    I set the packet PTS and DTS to the number of written packets.

    Libx264 does not complain during this process, but the output video file contains no data (headers only?) and is less than 50kB, and claims a duration of 0.

    Code:

    while( readVal > -1 )
    {
      readVal = av_read_frame( pFormat, &pkt );
    
      if ( pkt.stream_index == vidIdx )
      {
        pkt.pts = packets;
        pkt.dts = packets;
    
        pkt.stream_index = pVideoStream->index;
    
        av_write_frame( pFmtOut, &pkt );
    
        printf("Processing packet %i\n", packets );
    
        ++packets;
      } 
    }
    
  • Using FFmpeg's (libavformat) RTP data structures via dynamic linking

    15 septembre 2011, par ericreeves

    I want to use the RTP data structures (e.g. RTPMuxContext in libavformat/rtpenc.h) provided by FFmpeg's libavformat however they don't seem to be available with the following install:

    ffmpeg version 0.8.2.git, Copyright (c) 2000-2011 the FFmpeg developers
      built on Sep 14 2011 16:04:33 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3)
      configuration: --enable-shared --disable-mmx --arch=x86_64
      libavutil    51. 16. 0 / 51. 16. 0
      libavcodec   53. 14. 0 / 53. 14. 0
      libavformat  53. 12. 0 / 53. 12. 0
      libavdevice  53.  3. 0 / 53.  3. 0
      libavfilter   2. 40. 0 /  2. 40. 0
      libswscale    2.  1. 0 /  2.  1. 0
    

    When I look in /usr/local/include, I see the libavformat directory however only a few files are there: avformat.h, avio.h, and version.h. Of course, when I try to include libavformat/rtpenc.h I get "error: libavformat/rtpenc.h: No such file or directory"

    I'd like to achieve this by dynamic linking to the FFmpeg libraries (for LGPL compliance, among other reasons), but it doesn't seem to be possible.

    Is there a parameter for the configure script that I'm missing, or a post-installation step that I've neglected?

  • ffmpeg speed encoding problem

    15 septembre 2011, par amrouch

    I am currently developing an application that makes capturing video from a webcam on Linux using the Qt Designer tool and V4L2 and ffmpeg libraries under C + +, to capture the image there is no problem using lib V4L2, and since That a picture is ready I send it to the encoder which is based on ffmpeg libs, initially the encoder creates a video file, and it receives images to encode it in this file, my problem is as follows: the encoding is normally done, but after if I start playing the recorded video file, speed appears to be accelerated compared to the regular speed! So what is clear, the problem is in video encoding, my question is, is there a method or function that manages ffmpeg encoding speed pictures ????? thank you for your help.