Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • [ffmpeg] : programmatically determine output format when ripping audio from video files

    8 août 2018, par fastily

    I have some assorted video files (e.g. mkv, webm, mp4, mts) with various codecs (aac, opus, vorbis) that I'd like to extract the audio from. Does ffmpeg offer a way to intelligently determine the correct output format to use?

    Up until now, I've been using ffprobe + sed to achieve this result, but it feels sloppy/verbose. Is there a best practice or am I out of luck?

    Thanks in advance

  • HTML5 mp4 video autoplay issue

    8 août 2018, par Fernando Guimarães

    I am doing a website that requires a 16s video to autoplay on the frontpage, pretty standard. But it has some issues, on firefox it tells me that the video could not be decoded, and on chrome autoplaying just works sometimes.

    The original video .mov (1Gbs) was converted with ffmpeg to .mp4 (30Mbs).

    ffmpeg -i 30389617-4k.mov out.mp4
    

    My HTML video code is the following:

    
    

    And if helpful, my CSS:

    video {
        object-fit: fill;
    
        position: relative;
        z-index: 1;
        max-height: 100vh;
        width: 100%;
    }
    

    It's a nodeJS project, the video is located inside /public/assets. Who can I fix this mess? Is there any good practice I may be missing?

    Regards

  • HTML 5 Video tag not supported by Chrome or Firefox.

    8 août 2018, par avanib

    My .mp4 file(created and saved on server) has audio and video, but when I play it on the browser only the audio plays, are there any alternatives to tag in HTML to display the .mp4 file that shows on all browsers.

    I tried changing the encoding of my video file to H264 using FFMPEG, but it still doesn't work..instead it stops creating the video entirely.

    recorder.setVideoCodec(avcodec.AV_CODEC_ID_H264);
    

    Any help is appreciated! :)

  • FFMPEG command causing audio issues

    7 août 2018, par alan samuel

    I am converting multiple mp4 video to ts and then stitching it together.

    But this sometimes causes audio issues on my videos where the audio sounds like it was recorded with two mics at the same time causing loud sound.

    I can only reproduce it sometimes and I am still not sure why it's doing that? Can anyone help?

    Here is how I am converting to ts from mp4. I have noticed that the longer the video gets, the audio gets worse and its also off by a couple of seconds.

    ffmpeg -i video1.mp4 -f lavfi -i anullsrc=channel_layout=mono:sample_rate=48000 -shortest -c copy -bsf:v h264_mp4toannexb -c:a aac video1.ts
    
    ffmpeg -i video2.mp4 -f lavfi -i anullsrc=channel_layout=mono:sample_rate=48000 -shortest -c copy -bsf:v h264_mp4toannexb -c:a aac video2.ts
    
    ffmpeg -i video3.mp4 -f lavfi -i anullsrc=channel_layout=mono:sample_rate=48000 -shortest -c copy -bsf:v h264_mp4toannexb -c:a aac video3.ts
    

    and then I save these paths to a txt and call my stitching command like this

    ffmpeg -f concat -safe 0 -i list.txt -c copy -bsf:a aac_adtstoasc finalvideo.mp4
    

    Here is the complete output of the 4 videos

    C:\Users\Alan\Desktop\videos>ffmpeg -i video1.mp4 -i video2.mp4 -i video3.mp4 -i video4.mp4
    ffmpeg version N-90433-g5b31dd1c6b Copyright (c) 2000-2018 the FFmpeg developers
      built with gcc 7.3.0 (GCC)
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth
      libavutil      56. 12.100 / 56. 12.100
      libavcodec     58. 15.100 / 58. 15.100
      libavformat    58. 10.100 / 58. 10.100
      libavdevice    58.  2.100 / 58.  2.100
      libavfilter     7. 13.100 /  7. 13.100
      libswscale      5.  0.102 /  5.  0.102
      libswresample   3.  0.101 /  3.  0.101
      libpostproc    55.  0.100 / 55.  0.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video1.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf57.71.100
      Duration: 00:00:10.80, start: 0.000000, bitrate: 1034 kb/s
        Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 879 kb/s, 4.17 fps, 4.17 tbr, 12800 tbn, 8.33 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 165 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'video2.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf57.71.100
      Duration: 00:00:01.62, start: 0.000000, bitrate: 3208 kb/s
        Stream #1:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 3203 kb/s, 16.67 fps, 16.67 tbr, 12800 tbn, 33.33 tbc (default)
        Metadata:
          handler_name    : VideoHandler
    Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'video3.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf57.71.100
      Duration: 00:00:05.58, start: 0.000000, bitrate: 1954 kb/s
        Stream #2:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1805 kb/s, 16.67 fps, 16.67 tbr, 12800 tbn, 33.33 tbc (default)
        Metadata:
          handler_name    : VideoHandler
        Stream #2:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono, fltp, 166 kb/s (default)
        Metadata:
          handler_name    : SoundHandler
    Input #3, mov,mp4,m4a,3gp,3g2,mj2, from 'video4.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf57.71.100
      Duration: 00:00:03.90, start: 0.000000, bitrate: 1746 kb/s
        Stream #3:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1744 kb/s, 16.67 fps, 16.67 tbr, 12800 tbn, 33.33 tbc (default)
        Metadata:
          handler_name    : VideoHandler
    
  • How how can i frame cut between, using ffmpeg ?

    7 août 2018, par Celil Şahin

    enter image description here

    ffmpeg -i in.mp4 -vf "select='if(gt(scene,0.03),st(1,t),lte(t-ld(1),4))',setpts=N/FRAME_RATE/TB" -an trimmed2.mp4
    

    my code but, it did not work for my case. help pls