Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Android, split gif to frames with ffmpeg

    9 octobre 2016, par P. Ilyin

    I need to split my gif file to separate frames of any format (gif, png, doesnt matter).

    ffmpeg -i path/to/gif -c:v gif -f image2 path/to/output$03d.gif

    this command really splits gif to frames, but only first frame have a normal quality. All other frames looks like some damaged images

    enter image description here

    library I use is com.writingminds:FFmpegAndroid:0.3.2

    What should Ido to get all frames with normal quality

  • Setting a framerate of a video created from images with ffmpeg (slowing down)

    9 octobre 2016, par jeet

    I'm making a video using ffmpeg & multiple images with this command:

    ffmpeg -f image2 -i img%d.png v.mpg
    

    The video is made, but plays very fast. Can I slow it down a bit? (double duration nearly) If possible set the speed while creation itself please.

    I also need to add an audio "a.wav" to the video being made, possibly in the same command. Is that possible?

    Please give me the commands Thanks

    When I use this command, below is the error I get:

    ffmpeg -r 12 -i pic\s%d.png -i rmt.wav -shortest -r 25 v.mpg
    
    
    
    FFmpeg version SVN-r16573, Copyright (c) 2000-2009 Fabrice Bellard, et al.
    configuration: --extra-cflags=-fno-common --enable-memalign-hack --enable-pthreads --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libfaac --enable-libgsm --enable-libx264 --enable-libschroedinger --enable-avisynth --enable-swscale --enable-gpl
    libavutil     49.12. 0 / 49.12. 0
    libavcodec    52.10. 0 / 52.10. 0
    libavformat   52.23. 1 / 52.23. 1
    libavdevice   52. 1. 0 / 52. 1. 0
    libswscale     0. 6. 1 /  0. 6. 1
    built on Jan 13 2009 02:57:09, gcc: 4.2.4
    Input #0, image2, from 'pic\s%d.png':
    Duration: 00:03:53.00, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: png, rgb24, 1366x768, 12.00 tb(r)
    Input #1, wav, from 'rmt.wav':
    Duration: 00:12:16.19, bitrate: 64 kb/s
    Stream #1.0: Audio: pcm_u8, 8000 Hz, mono, s16, 64 kb/s
    Stream #0.0: Video: mpeg1video, yuv420p, 1366x768, q=2-31, 200 kb/s, 25.00 tb(c)
    Stream #0.1: Audio: mp2, 8000 Hz, mono, s16, 64 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #1.0 -> #0.1
    [mp2 @ 0x1738390]Sampling rate 8000 is not allowed in mp2
    Error while opening codec for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
    
  • Execute multiple commands in background from terminal & redirecting output

    9 octobre 2016, par Guernica

    I'm running ffmpeg via an exec command from php. I need to wait for the command to finish executing and run another command to call a php script.

    I need the output to be redirected to text files.

    This i have accomplished with the following code but it wont execute in the background. PHP hangs until the script has finished executing.

    exec("ffmpeg -i INPUTFILE -f mp4 -vcodec libx264 -preset fast -profile:v main -acodec aac -strict -2 OUTPUTFILE -hide_banner 1> /tmp/1.txt 2>/tmp/1.txt && php PATH_TO_PHP_SCRIPT/complete.php id=11 1> /tmp/11.txt 2> /tmp/11.txt &");
    

    Any help would be greatly appreciated.

    EDIT: I've got the required functionality by calling my original php containing the above code from another php containing

    exec("php convert.php id=".$id."  1> /tmp/".$id."_error.txt 2>/tmp/".$id."_error.txt &");
    

    I would rather leave this question open to find a more elegant solution or information as to why my original code at the top doesn't function in the way i would expect.

  • FFMPEG video encoded by android app doesn't scale properly on the website

    9 octobre 2016, par Ahmed Mujtaba

    I'm trying to creat e an app that records a video on phone and uploads it to the website. I'm using a FFMPEG library to encode the video to be streamed on the web. The command I'm using for encoding is below:

    -y i inputPath -vf scale=640:480,transpose=1 -strict experimental -s 360x640 -r 25 -vcodec mpeg4 -b 1000k ab 48000 -ac 2 -ar 22050 destinationPath
    

    The video is encoded fine but when I try to play it on the website, it's stretched vertically and goes off the screen. I'm using html5 player to play it on the web. Here's what the video looks like

    enter image description here

    The video uploaded from the website is encoded using libx264 codec and it plays fine. However the library I'm using to encode on the android app doesn't support libx264. I'm not sure if it's the incorrect aspect ratio that's messing up the playback or something else. I've set the aspet ratio to 640:480 but that hasn't fixed things. Can anyone help?

  • Stream from WebRTC input to HLS

    9 octobre 2016, par acroca

    I need to do video streaming where the recording is happening on a browser and has to be consumed as HLS on mobile devices.

    It seems I need some media server and send the camera stream as WebRTC to it. It seems Janus and Kurento can do that task and output RTP streams. I'm not sure now how to convert that RTP stream to HLS, I guess I could hook ffmpeg on that RTP stream and generate HLS with MpegTS, but I'm not sure this is the right direction.

    Is that the obvious way to do it? Is there any existing service to do all this?

    Thank you.