Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • how ffmpeg internally works to create clip from remote videos

    26 août 2018, par Nitishkumar Singh

    We needed to create clips from the remote video by providing the time duration. This is the command we are using

    ffmpeg -i {{remote_video}} -ss {{start_time}} -flush_packets 1 -codec copy -t {{duration}} -y {{output_file}}
    

    What We are unable to figure out is how actually FFmpeg does this. It does not download the entire video & still is able to generate clip for remote video.

    Looked into documentation but found none.

  • Rotate Video- Could not write header for output file #0 (incorrect codec parameters ?)

    26 août 2018, par varmashrivastava

    I am using below command to rotate video-

    {"-y", "-ss", "" + startMs / 1000, "-t", "" + (endMs - startMs) / 1000, "-i", inputPath, "-vf", "transpose=" + type,"-c:a", "copy", outputPath}
    

    I am getting below failure message in Android Oreo-

    "ffmpeg version n3.0.1 Copyright (c) 2000-2016 the FFmpeg developers\n built with gcc 4.8 (GCC)\n configuration: --target-os=linux --cross-prefix=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/bin/arm-linux-androideabi- --arch=arm --cpu=cortex-a8 --enable-runtime-cpudetect --sysroot=/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/sysroot --enable-pic --enable-libx264 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-fontconfig --enable-pthreads --disable-debug --disable-ffserver --enable-version3 --enable-hardcoded-tables --disable-ffplay --disable-ffprobe --enable-gpl --enable-yasm --disable-doc --disable-shared --enable-static --pkg-config=/home/vagrant/SourceCode/ffmpeg-android/ffmpeg-pkg-config --prefix=/home/vagrant/SourceCode/ffmpeg-android/build/armeabi-v7a --extra-cflags='-I/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/include -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all' --extra-ldflags='-L/home/vagrant/SourceCode/ffmpeg-android/toolchain-android/lib -Wl,-z,relro -Wl,-z,now -pie' --extra-libs='-lpng -lexpat -lm' --extra-cxxflags=\n libavutil 55. 17.103 / 55. 17.103\n libavcodec 57. 24.102 / 57. 24.102\n libavformat 57. 25.100 / 57. 25.100\n libavdevice 57. 0.101 / 57. 0.101\n libavfilter 6. 31.100 / 6. 31.100\n libswscale 4. 0.100 / 4. 0.100\n libswresample 2. 0.101 / 2. 0.101\n libpostproc 54. 0.100 / 54. 0.100\nInput #0, mov,mp4,m4a,3gp,3g2,mj2, from '/storage/emulated/0/Download/dolbycanyon.3gp':\n Metadata:\n
    major_brand : 3gp4\n minor_version : 512\n
    compatible_brands: isomiso23gp4\n Duration: 00:00:38.07, start: 0.006250, bitrate: 402 kb/s\n Stream #0:0(und): Video: h263 (s263 / 0x33363273), yuv420p, 704x576 [SAR 12:11 DAR 4:3], 384 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 29.97 tbc (default)\n Metadata:\n
    handler_name : VideoHandler\n Stream #0:1(und): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, flt, 12 kb/s (default)\n
    Metadata:\n handler_name : SoundHandler\n[libx264 @ 0xf64e5400] using SAR=11/12\n[libx264 @ 0xf64e5400] using cpu capabilities: none!\n[libx264 @ 0xf64e5400] profile High, level 3.1\n[libx264 @ 0xf64e5400] 264 - core 148 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=12 lookahead_threads=2 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00\n[mp4 @ 0xf64a8600] Could not find tag for codec amr_nb in stream #1, codec not currently supported in container\nOutput #0, mp4, to '/storage/emulated/0/Movies/rotate_video4.mp4':\n Metadata:\n
    major_brand : 3gp4\n minor_version : 512\n
    compatible_brands: isomiso23gp4\n encoder : Lavf57.25.100\n Stream #0:0(und): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 576x704 [SAR 11:12 DAR 3:4], q=-1--1, 29.97 fps, 30k tbn, 29.97 tbc (default)\n Metadata:\n handler_name : VideoHandler\n encoder : Lavc57.24.102 libx264\n Side data:\n unknown side data type 10 (24 bytes)\n Stream 0:1(und): Audio: amr_nb (samr / 0x726D6173), 8000 Hz, mono, 12 kb/s (default)\n Metadata:\n handler_name : SoundHandler\nStream mapping:\n Stream #0:0 -> #0:0 (h263 (native) -> h264 (libx264))\n Stream #0:1 -> #0:1 (copy)\nCould not write header for output file #0 (incorrect codec parameters ?): Invalid argument\n"

    Why am i getting this error and how can i resolve it?

  • How can I remove metadata from a flv file ?

    26 août 2018, par vbnewbie

    with ffmpeg I can use the command below to remove the metadata in General section

    ffmpeg -i input.flv -c copy -metadata description= -metadata title= output.flv
    

    enter image description here

    What if I want to remove the metadata in Video and Audio section?

    EDIT: I want to remove writing library

    enter image description here

  • FFmpeg/x264 “subq” or “subme” Settings

    26 août 2018, par RRN

    I am using FFmpeg 4, FFmpeg x264 has an option called “subq” or “subme”, the document mentioned the default is ‘6’, but I tried to skip this option, then if I use “MediaInfo” to check the output video, the default should be ‘0’ instead of ‘6’. The document doesn’t’ mention about ’0’, anybody knows?

  • Which player can play call center recoding file or convert

    26 août 2018, par Wida

    I'm working with call center recording file but it's sound gibberish which mediainfo shows detail

    Format                                   : Wave
    File size                                : 239 KiB
    Duration                                 : 3 min 3 s
    Overall bit rate                         : 10.7 kb/s
    
    Audio
    Format                                   : G.723.1
    Codec ID                                 : A100
    Duration                                 : 3 min 3 s
    Bit rate                                 : 10.7 kb/s
    Channel(s)                               : 2 channels
    Sampling rate                            : 8 000 Hz
    Stream size                              : 239 KiB (100%)
    

    and detail in from ffmpeg show as

    ffmpeg version 4.0 Copyright (c) 2000-2018 the FFmpeg developers
      built with Apple LLVM version 9.1.0 (clang-902.0.39.1)
      configuration: --prefix=/usr/local/Cellar/ffmpeg/4.0 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --disable-lzma
      libavutil      56. 14.100 / 56. 14.100
      libavcodec     58. 18.100 / 58. 18.100
      libavformat    58. 12.100 / 58. 12.100
      libavdevice    58.  3.100 / 58.  3.100
      libavfilter     7. 16.100 /  7. 16.100
      libavresample   4.  0.  0 /  4.  0.  0
      libswscale      5.  1.100 /  5.  1.100
      libswresample   3.  1.100 /  3.  1.100
      libpostproc    55.  1.100 / 55.  1.100
    Input #0, wav, from 'test.wav':
      Duration: 00:03:03.84, bitrate: 10 kb/s
        Stream #0:0: Audio: g723_1 ([0][161][0][0] / 0xA100), 8000 Hz, mono, s16, 10 kb/s
    At least one output file must be specified
    

    I have used so many player : Audacity, VLC, WMP. But it's sound gibberish. My case is very similar to

    Converting a call center recording to something useful

    in this link, he can fix by using Goldwave for converting file. I also tried Goldwave too but still didn't work.

    So, Do I have to config more with Goldwave or any solution at least I want to listen to it

    I use MacOs but don't mind if have to use window for open it.

    Ps. can listen sample audio in the link (my recoding is the same as the sample in this link)

    more detail from Switch by NCH Software

    format : WAVE
    codec : Comverse Infosys Ltd. G723 1
    Sample Rate : 8000
    Channels : 1 (Mono)