Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • correctly encode .mov file for various browsers and devices

    7 décembre 2015, par khinester

    i have the following template, which uses node-blade that is similar to jade

    .show-for-medium-up
      -var poster_url = '//' + settings.cloudFrontDomain + '/images/poster/2015_2016.jpeg'
      .fullwidth
        .about-page
          video.video-js.vjs-default-skin.vjs-playing.vjs-big-play-centered(id="home" poster=poster_url)
            source(src="//#{settings.cloudFrontDomain}/assets/videos/home/winter_2015/SD_720.webm" type='video/webm')
            source(src="//#{settings.cloudFrontDomain}/assets/videos/home/winter_2015/SD_720.mp4" type='video/mp4')
            source(src="//#{settings.cloudFrontDomain}/assets/videos/home/winter_2015/SD_720.ogg" type='video/ogg')
            source(src="//#{settings.cloudFrontDomain}/assets/videos/home/winter_2015/SD_360.m4v" type='video/mp4')
        :javascript
          videojs("home", {
              preload: 'auto',
              autoplay: true,
              loop: true,
              fluid: true,
              aspectRatio: '16:9',
              controls: false
            });
    

    i have encoded the videos using ffmpeg using the following commands

     ffmpeg -i $s.mov -vcodec libvpx -acodec libvorbis -aq 5 -ac 2 -qmax 25 -b 614400 -s 1280x720 $s-SD_720.webm
     ffmpeg -i $s.mov -c:v libtheora -c:a libvorbis -q:v 6 -q:a 5 $s-SD_720.ogg
     ffmpeg -i $s.mov -vcodec h264 -acodec mp2 $s-SD_720.mp4
    

    the original video is

    ffprobe ../HD.mov 
    ffprobe version N-76639-g58d32c0 Copyright (c) 2007-2015 the FFmpeg developers
      built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
      configuration: --prefix=/home/khine/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/khine/ffmpeg_build/include --extra-ldflags=-L/home/khine/ffmpeg_build/lib --bindir=/home/khine/bin --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
      libavutil      55.  5.100 / 55.  5.100
      libavcodec     57. 15.100 / 57. 15.100
      libavformat    57. 14.100 / 57. 14.100
      libavdevice    57.  0.100 / 57.  0.100
      libavfilter     6. 15.100 /  6. 15.100
      libswscale      4.  0.100 /  4.  0.100
      libswresample   2.  0.101 /  2.  0.101
      libpostproc    54.  0.100 / 54.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../HD.mov':
      Metadata:
        major_brand     : qt  
        minor_version   : 537199360
        compatible_brands: qt  
        creation_time   : 2015-12-02 22:35:26
      Duration: 00:01:19.20, start: 0.000000, bitrate: 55745 kb/s
        Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080, 55733 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 50 tbc (default)
        Metadata:
          creation_time   : 2015-12-02 22:35:26
          handler_name    : Apple Alias Data Handler
          encoder         : H.264
          timecode        : 00:03:02:19
        Stream #0:1(eng): Data: none (tmcd / 0x64636D74) (default)
        Metadata:
          creation_time   : 2015-12-02 23:44:32
          handler_name    : Apple Alias Data Handler
          timecode        : 00:03:02:19
    

    what is the correct way to reduce the size to use on the web and also for use on mobile devices without flash.

    any advice much appreciated

  • FFmpeg pipe related issues

    7 décembre 2015, par Ranjit Aneesh

    I am new to FFmpeg and have very little knowledge of different codecs.

    I am using pipes to provide input and to send out output from FFmpeg

    The command I use is essentially

    ffmpeg -i pipe:0  -f flv pipe:1
    

    I am using a Java program that basically provides an input stream as standard input (pipe:0), FFmpeg converts the video into the required format and sends out to standard output(pipe:1) from where I stream out to my remote location.

    My java program revolves around this piece of code, providing input and sending output as an output stream.

    Essentially my program does what it is supposed to, however I see that the final output video file is not of the complete duration. It is like 10 sec duration, and my sample video is 21 mins! Also it is missing audio.

    Do I need to provide more info to FFmpeg?

    EDIT: When I replace the pipe with an input file and an output file,the output is generated correctly without any issues, when I use pipes the size of the file is still larger compared to original. Just in case if it helps to diagnose.

    FFmpeg version SVN-r23418, Copyright (c) 2000-2010 the FFmpeg developers
    built on Jun 2 2010 04:12:01 with gcc 4.4.2
    configuration: --target-os=mingw32 --enable-runtime-cpudetect --enable-avisynth --enable-gpl --enable-version3 --enable-bzlib --enable-libgsm --enable-libfaad --enable-pthreads --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --enable-libopenjpeg --enable-libxvid --enable-libschroedinger --enable-libx264 --extra-libs='-lx264 -lpthread' --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-librtmp --extra-libs='-lrtmp -lssl -lcrypto -lws2_32 -lgdi32 -lwinmm -lcrypt32 -lz' --arch=x86 --cross-prefix=i686-mingw32- --cc='ccache i686-mingw32-gcc' --enable-memalign-hack
    libavutil 50.16. 0 / 50.16. 0
    libavcodec 52.72. 1 / 52.72. 1
    libavformat 52.67. 0 / 52.67. 0
    libavdevice 52. 2. 0 / 52. 2. 0
    libavfilter 1.20. 0 / 1.20. 0
    libswscale 0.11. 0 / 0.11. 0
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'pipe:0':
    Metadata:
    major_brand : isom
    minor_version : 1
    compatible_brands: isom
    title :
    artist :
    date :
    album :
    comment :
    Feedback:
    genre :
    Duration: 00:21:46.63, start: 0.000000, bitrate: N/A
    Stream #0.0(und): Video: h264, yuv420p, 512x288 [PAR 1:1 DAR 16:9], 403 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc
    Stream #0.1(und): Audio: aac, 44100 Hz, mono, s16, 47 kb/s
    Output #0, flv, to 'pipe:1':
    Metadata:
    encoder : Lavf52.67.0
    Stream #0.0(und): Video: flv, yuv420p, 512x288 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 1k tbn, 25 tbc
    Stream #0.1(und): Audio: libmp3lame, 44100 Hz, mono, s16, 64 kb/s
    Stream mapping:
    Stream #0.0 -> #0.0
    Stream #0.1 -> #0.1

  • How to improve the efficiency of the H.264 encoding using ffmpeg

    7 décembre 2015, par xiaolan

    When I use ffmpeg to do video encoding, and I set gop_size to be 3, the video stream can be played normally by visiting Crtmpserver as soon as I start sending video packets one after one to the Crtmpserver. But if gop_size is 6, the viewer will feel like the video became slow and some frames might not be displayed. If gop_size is bigger, the efficiency may be slower. Could anyone give me some suggestions? I want a better live streaming which can be displayed normally.

  • FFMPEG No such filter : 'palettegen'

    7 décembre 2015, par tyasird

    I am using windows 10 and FFmpeg 64-bit Shared Version.

    When I use palettegen effect, returns error.

    ffmpeg -i input.mov -vf palettegen palette.png
    

    returns

    [AVFilterGraph @ 0228d3c0] No such filter: 'palettegen'
    Error opening filters!
    

    How can I install this Filter? Thanks.

  • FFMPEG : Transmux mpegts to mp4 gives error : muxer does not support non seekable output

    7 décembre 2015, par Kr0e

    When piping mpegts to ffmpeg, which should convert it to mp4 and pipe to stdout, ffmpeg says: "muxer does not support non seekable output".

    After a lot of research I came to the conclusion that mp4 is a bad choice for doing those kinds of on-the-fly transcoding due to seeking. So in essence: MP4 cannot be piped through ffmpeg, which kind of makes sense.

    But I do not have a contiguous mpegts stream, I have chunks of 5 seconds. So it's really just like:

    • Here is my 1 mb *.ts file
    • Please read it from pipe until you hit EOF
    • Please transmux it to mp4 (if you really have to seek, well use a buffer)
    • Please pipe the complete internal mp4 buffer to stdout

    I need these mp4 chunks for a HTML5 MediaSource, the fragmentation is no problem, I use mp4box.js, which works like a charm.

    Questions:

    • Can FFMPEG do this kind of internal buffering ?
    • Is there any better option to consider ?

    In essence: Can I (somehow) interact with ffmpeg without using files ? My current solutions works with files and polling for new chunks, which is ugly.

    If you are interested in my ffmpeg command, just let me know.