Newest 'libx264' Questions - Stack Overflow

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

Les articles publiés sur le site

  • webm to mp4 conversion using ffmpeg

    25 juillet 2022, par Pavan K

    When I try to convert a webm file to mp4 the output is very very choppy and it appears as if many frames have been dropped by ffmpeg

    I used the following commands to convert

    ffmpeg -i movie.webm movie.mp4
    ffmpeg -i movie.webm -vcodec libx264 movie.mp4
    ffmpeg -i movie.webm -vcodec libx264 -qscale 0 movie.mp4
    

    All of them have the same problem. When I use ffprobe it seems to show the frames more or less properly.

    UPDATE:

     built on Jun 14 2013 14:31:50 with gcc 4.7 (Ubuntu/Linaro 4.7.2-2ubuntu1)
      configuration: --prefix=/home/user2/ffmpeg_build --extra-cflags=-I/home/user2/ffmpeg_build/include --extra-ldflags=-L/home/pavan4/ffmpeg_build/lib --bindir=/home/pavan4/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfdk-aac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-nonfree --enable-x11grab
      libavutil      52. 35.101 / 52. 35.101
      libavcodec     55. 16.100 / 55. 16.100
      libavformat    55.  8.102 / 55.  8.102
      libavdevice    55.  2.100 / 55.  2.100
      libavfilter     3. 77.101 /  3. 77.101
      libswscale      2.  3.100 /  2.  3.100
      libswresample   0. 17.102 /  0. 17.102
      libpostproc    52.  3.100 / 52.  3.100
    Hyper fast Audio and Video encoder
    usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
    
    Use -h to get full help or, even better, run 'man ffmpeg'
    
    Input #0, matroska,webm, from '1.webm':
      Duration: 00:00:10.64, start: 0.000000, bitrate: 5024 kb/s
        Stream #0:0(eng): Video: vp8, yuv420p, 1280x720, SAR 1:1 DAR 16:9, 1k fps, 1k tbr, 1k tbn, 1k tbc (default)
    [libx264 @ 0x1d966a0] using SAR=1/1
    [libx264 @ 0x1d966a0] MB rate (3600000) > level limit (2073600)
    [libx264 @ 0x1d966a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
    [libx264 @ 0x1d966a0] profile High, level 5.2
    [libx264 @ 0x1d966a0] 264 - core 133 r2 a3ac64b - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - 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
    Output #0, mp4, to '1_conv4.mp4':
      Metadata:
        encoder         : Lavf55.8.102
        Stream #0:0(eng): Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 16k tbn, 1k tbc (default)
    Stream mapping:
    Stream #0:0 -> #0:0 (vp8 -> libx264)
    Press [q] to stop, [?] for help
    frame=  168 fps=0.0 q=33.0 size=      62kB time=00:00:00.11 bitrate=4606.0kbits/frame=  293 fps=230 q=33.0 size=     138kB time=00:00:00.23 bitrate=4809.7kbits/
    
    video:5620kB audio:0kB subtitle:0 global headers:0kB muxing overhead 2.212461%
    [libx264 @ 0x1d966a0] frame I:46    Avg QP:18.50  size: 39849
    [libx264 @ 0x1d966a0] frame P:2940  Avg QP:18.27  size:  1222
    [libx264 @ 0x1d966a0] frame B:7651  Avg QP:17.68  size:    43
    [libx264 @ 0x1d966a0] consecutive B-frames:  4.0%  0.2%  0.3% 95.5%
    [libx264 @ 0x1d966a0] mb I  I16..4: 19.9% 63.2% 16.9%
    [libx264 @ 0x1d966a0] mb P  I16..4:  0.2%  0.5%  0.1%  P16..4:  3.9%  1.1%  0.6%  0.0%  0.0%    skip:93.6%
    [libx264 @ 0x1d966a0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.2%  0.0%  0.0%  direct: 0.0%  skip:99.8%  L0:25.1% L1:74.9% BI: 0.0%
    [libx264 @ 0x1d966a0] 8x8 transform intra:63.6% inter:75.9%
    [libx264 @ 0x1d966a0] coded y,uvDC,uvAC intra: 61.5% 53.4% 24.4% inter: 0.5% 0.5% 0.0%
    [libx264 @ 0x1d966a0] i16 v,h,dc,p: 52% 19% 19% 11%
    [libx264 @ 0x1d966a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 17% 13%  4%  6%  9%  5%  8%  6%
    [libx264 @ 0x1d966a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 30% 18% 14%  5%  8% 10%  6%  6%  3%
    [libx264 @ 0x1d966a0] i8c dc,h,v,p: 55% 17% 24%  4%
    [libx264 @ 0x1d966a0] Weighted P-Frames: Y:0.0% UV:0.0%
    [libx264 @ 0x1d966a0] ref P L0: 82.5% 13.2%  4.0%  0.3%
    [libx264 @ 0x1d966a0] ref B L0: 60.2% 39.2%  0.6%
    [libx264 @ 0x1d966a0] ref B L1: 98.5%  1.5%
    [libx264 @ 0x1d966a0] kb/s:4327.77
    
  • Why does FFMPEG b-frames and b_pyramid offset start_pts (and start_time) in fragmented output ?

    13 juillet 2022, par Vans S

    It seems when transcoding something into fragmented or segmented output the start_pts is not 0, and no combination of options can make it 0 other than setting bframes to 0 and bpyramid to 0. This does not happen with regular nonfragmented output.

    Does anyone know why this is, and how to prevent it as I believe this is causing weird timesync issues with playback in browsers (every fragment slightly delays the video more and more) where after 2-3 hours the stream can end up 15minutes+ delayed.

    Example where each segment start_pts is not 0:

    ffmpeg -i in.mp4 -pix_fmt yuv420p -an -f yuv4mpegpipe -frames:v 150 - | ffmpeg -f yuv4mpegpipe -i - -y -force_key_frames 1,2,3,4 -map 0 -codec:v libx264 -f segment -segment_list out.csv -segment_times 2,4 -segment_time_delta 0.05 -preset:v fast -segment_format_options movflags=+faststart out%03d.mp4
    

    start_pts is 0 here if we add:

    -x264opts b_pyramid=0 -bf 0 
    #or change codec to
    -codec:v mpeg4
    #or output regular mp4
    ffmpeg -i in.mp4 -pix_fmt yuv420p -an -f yuv4mpegpipe -frames:v 150 - | ffmpeg -f yuv4mpegpipe -i - -y out.mp4
    

    EDIT: Looking into this further I am starting to think this is a bug with how empty_moov interacts with the negative_cts_offsets flag. (when empty_moov is used, negative_cts_offsets seems to be ignored, and we need empty_moov for full webbrowser support.)

  • Ffmpeg nvenc encoder on gpu does not compress files as much as compared to libx264

    30 mai 2022, par Srinjoy Choudhury

    I wanted to encode a video file which was initially encoded by a libx264 encoder on a non gpu machine with ultrafast preset and crf 23 , i typically re-encode it with preset medium and get a good compression but the process is very slow , so i am considering a gpu based solution

    my current command to use ffmpeg on a nvidia turing gpu

    ffmpeg -y -vsync passthrough -hwaccel cuda -i a.mp4 -max_muxing_queue_size 9999 -pix_fmt yuv420p -c:v h264_nvenc -preset medium -tune ll -b:v 4M -bufsize 4M -maxrate 10M -qmin 0 b.mp4
    

    usual command i use to do the same

    ffmpeg -i a.mp4 -max_muxing_queue_size 9999 -pix_fmt yuv420p -c:v libx264 -preset medium b.mp4
    enter code here
    

    How can i make this command do a better job at reducing file size , i am okay to compromise on the quality of the video for a good reduction in size

  • Video conversion (using ffmpeg) fails only on apache server

    25 avril 2022, par wb.waldemar

    I'm trying to convert a video using latest static build of ffmpeg and following command:

    ffmpeg -report -y -loglevel info -i en--story-video.mp4 -c:v libx264 -preset slow -crf 22 -c:a copy en--story-video-out.mp4
    

    This works actually fine on Ubuntu (desktop) and the same command works also on Win 10 but not on the server (Debian GNU/Linux 10) where it should actually work. I can't install or build ffmpeg directly so I've to use a static build. Also simple remux works on the server but not the converion and I do not understand why. I've also read and tried different approaches and suggestions, but none of them could solve the problem.

    Does someone have an idea what goes wrong?

    ffmpeg started on 2022-04-22 at 13:02:44
    Report written to "ffmpeg-20220422-130244.log"
    Log level: 48
    Command line:
    /dev/tools/ffmpeg -report -y -loglevel info -i en--story-video.mp4 -c:v libx264 -preset slow -crf 22 -c:a copy en--story-video-out.mp4
    ffmpeg version N-60837-ge81242bb13-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2022 the FFmpeg developers
      built with gcc 8 (Debian 8.3.0-6)
      configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
      libavutil      57. 22.100 / 57. 22.100
      libavcodec     59. 21.103 / 59. 21.103
      libavformat    59. 17.102 / 59. 17.102
      libavdevice    59.  5.100 / 59.  5.100
      libavfilter     8. 27.100 /  8. 27.100
      libswscale      6.  5.100 /  6.  5.100
      libswresample   4.  4.100 /  4.  4.100
      libpostproc    56.  4.100 / 56.  4.100
    Splitting the commandline.
    Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
    Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
    Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'info'.
    Reading option '-i' ... matched as input url with argument 'en--story-video.mp4'.
    Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
    Reading option '-preset' ... matched as AVOption 'preset' with argument 'slow'.
    Reading option '-crf' ... matched as AVOption 'crf' with argument '22'.
    Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'.
    Reading option 'en--story-video-out.mp4' ... matched as output url.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option report (generate a report) with argument 1.
    Applying option y (overwrite output files) with argument 1.
    Applying option loglevel (set logging level) with argument info.
    Successfully parsed a group of options.
    Parsing a group of options: input url en--story-video.mp4.
    Successfully parsed a group of options.
    Opening an input file: en--story-video.mp4.
    [NULL @ 0xb9b3b80] Opening 'en--story-video.mp4' for reading
    [file @ 0xb9b41c0] Setting default whitelist 'file,crypto,data'
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] ISO: File Type Major Brand: isom
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Unknown dref type 0x206c7275 size 12
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Processing st: 0, edit list 0 - media time: 512, duration: 522240
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Offset DTS by 512 to make first pts zero.
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Setting codecpar->delay to 2 for stream st: 0
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Unknown dref type 0x206c7275 size 12
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Processing st: 1, edit list 0 - media time: 0, duration: 1502222
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Before avformat_find_stream_info() pos: 15666151 bytes read:88959 seeks:1 nb_streams:2
    [h264 @ 0xb9b6380] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0xb9b6380] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0xb9b6380] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0xb9b6380] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0xb9b6380] nal_unit_type: 6(SEI), nal_ref_idc: 0
    [h264 @ 0xb9b6380] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0xb9b6380] Format yuv420p chosen by get_format().
    [h264 @ 0xb9b6380] Reinit context to 1920x1088, pix_fmt: yuv420p
    [h264 @ 0xb9b6380] no picture 
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] All info found
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] After avformat_find_stream_info() pos: 43534 bytes read:155045 seeks:2 frames:4
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'en--story-video.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf59.17.102
      Duration: 00:00:34.06, start: 0.000000, bitrate: 3679 kb/s
      Stream #0:0[0x1](und), 3, 1/15360: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 3544 kb/s, 60 fps, 60 tbr, 15360 tbn (default)
        Metadata:
          handler_name    : ISO Media file produced by Google Inc. Created on: 04/10/2019.
          vendor_id       : [0][0][0][0]
      Stream #0:1[0x2](eng), 1, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
        Metadata:
          handler_name    : ISO Media file produced by Google Inc. Created on: 04/10/2019.
          vendor_id       : [0][0][0][0]
    Successfully opened the file.
    Parsing a group of options: output url en--story-video-out.mp4.
    Applying option c:v (codec name) with argument libx264.
    Applying option c:a (codec name) with argument copy.
    Successfully parsed a group of options.
    Opening an output file: en--story-video-out.mp4.
    [file @ 0xb9fbec0] Setting default whitelist 'file,crypto,data'
    Successfully opened the file.
    detected 20 logical cores
    [h264 @ 0xba04680] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0xba04680] nal_unit_type: 8(PPS), nal_ref_idc: 3
    Stream mapping:
      Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
      Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xba04680] nal_unit_type: 6(SEI), nal_ref_idc: 0
    [h264 @ 0xba04680] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0xba04680] Format yuv420p chosen by get_format().
    [h264 @ 0xba04680] Reinit context to 1920x1088, pix_fmt: yuv420p
    [h264 @ 0xba04680] no picture 
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbaa3b80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    [h264 @ 0xbaa3b80] no picture 
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xba067c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xba9c2c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xba21fc0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbab8e80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbac7b00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbad6840] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbae5580] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbaf42c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb03000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb11d40] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb20a80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb2f7c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb3e500] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb4d240] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xba04680] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
    [h264 @ 0xbaa3b80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    [graph 0 input from stream 0:0 @ 0xba9f800] Setting 'video_size' to value '1920x1080'
    [graph 0 input from stream 0:0 @ 0xba9f800] Setting 'pix_fmt' to value '0'
    [graph 0 input from stream 0:0 @ 0xba9f800] Setting 'time_base' to value '1/15360'
    [graph 0 input from stream 0:0 @ 0xba9f800] Setting 'pixel_aspect' to value '1/1'
    [graph 0 input from stream 0:0 @ 0xba9f800] Setting 'frame_rate' to value '60/1'
    [graph 0 input from stream 0:0 @ 0xba9f800] w:1920 h:1080 pixfmt:yuv420p tb:1/15360 fr:60/1 sar:1/1
    [format @ 0xbaa0540] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21|yuv420p10le|yuv422p10le|yuv444p10le|nv20le|gray|gray10le'
    [AVFilterGraph @ 0xba16380] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
    [libx264 @ 0xba03c80] using mv_range_thread = 24
    [libx264 @ 0xba03c80] using SAR=1/1
    [libx264 @ 0xba03c80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
    [AVIOContext @ 0xb9fba00] Statistics: 0 bytes written, 0 seeks, 0 writeouts
    [AVIOContext @ 0xb9b4480] Statistics: 220581 bytes read, 2 seeks
    Conversion failed!
    
  • Video conversion (using ffmpeg) fails only on server

    22 avril 2022, par wb.waldemar

    I'm trying to convert a video using latest static build of ffmpeg and following command:

    ffmpeg -report -y -loglevel info -i en--story-video.mp4 -c:v libx264 -preset slow -crf 22 -c:a copy en--story-video-out.mp4
    

    This works actually fine on Ubuntu (desktop) and the same command works also on Win 10 but not on the server (Debian GNU/Linux 10) where it should actually work. I can't install or build ffmpeg directly so I've to use a static build. Also simple remux works on the server but not the converion and I do not understand why. I've also read and tried different approaches and suggestions, but none of them could solve the problem.

    Does someone have an idea what goes wrong?

    ffmpeg started on 2022-04-22 at 13:02:44
    Report written to "ffmpeg-20220422-130244.log"
    Log level: 48
    Command line:
    /dev/tools/ffmpeg -report -y -loglevel info -i en--story-video.mp4 -c:v libx264 -preset slow -crf 22 -c:a copy en--story-video-out.mp4
    ffmpeg version N-60837-ge81242bb13-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2022 the FFmpeg developers
      built with gcc 8 (Debian 8.3.0-6)
      configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libfribidi --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg
      libavutil      57. 22.100 / 57. 22.100
      libavcodec     59. 21.103 / 59. 21.103
      libavformat    59. 17.102 / 59. 17.102
      libavdevice    59.  5.100 / 59.  5.100
      libavfilter     8. 27.100 /  8. 27.100
      libswscale      6.  5.100 /  6.  5.100
      libswresample   4.  4.100 /  4.  4.100
      libpostproc    56.  4.100 / 56.  4.100
    Splitting the commandline.
    Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
    Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
    Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'info'.
    Reading option '-i' ... matched as input url with argument 'en--story-video.mp4'.
    Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
    Reading option '-preset' ... matched as AVOption 'preset' with argument 'slow'.
    Reading option '-crf' ... matched as AVOption 'crf' with argument '22'.
    Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'copy'.
    Reading option 'en--story-video-out.mp4' ... matched as output url.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option report (generate a report) with argument 1.
    Applying option y (overwrite output files) with argument 1.
    Applying option loglevel (set logging level) with argument info.
    Successfully parsed a group of options.
    Parsing a group of options: input url en--story-video.mp4.
    Successfully parsed a group of options.
    Opening an input file: en--story-video.mp4.
    [NULL @ 0xb9b3b80] Opening 'en--story-video.mp4' for reading
    [file @ 0xb9b41c0] Setting default whitelist 'file,crypto,data'
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] ISO: File Type Major Brand: isom
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Unknown dref type 0x206c7275 size 12
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Processing st: 0, edit list 0 - media time: 512, duration: 522240
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Offset DTS by 512 to make first pts zero.
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Setting codecpar->delay to 2 for stream st: 0
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Unknown dref type 0x206c7275 size 12
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Processing st: 1, edit list 0 - media time: 0, duration: 1502222
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] Before avformat_find_stream_info() pos: 15666151 bytes read:88959 seeks:1 nb_streams:2
    [h264 @ 0xb9b6380] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0xb9b6380] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0xb9b6380] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0xb9b6380] nal_unit_type: 8(PPS), nal_ref_idc: 3
    [h264 @ 0xb9b6380] nal_unit_type: 6(SEI), nal_ref_idc: 0
    [h264 @ 0xb9b6380] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0xb9b6380] Format yuv420p chosen by get_format().
    [h264 @ 0xb9b6380] Reinit context to 1920x1088, pix_fmt: yuv420p
    [h264 @ 0xb9b6380] no picture 
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] All info found
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0xb9b3b80] After avformat_find_stream_info() pos: 43534 bytes read:155045 seeks:2 frames:4
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'en--story-video.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41
        encoder         : Lavf59.17.102
      Duration: 00:00:34.06, start: 0.000000, bitrate: 3679 kb/s
      Stream #0:0[0x1](und), 3, 1/15360: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 3544 kb/s, 60 fps, 60 tbr, 15360 tbn (default)
        Metadata:
          handler_name    : ISO Media file produced by Google Inc. Created on: 04/10/2019.
          vendor_id       : [0][0][0][0]
      Stream #0:1[0x2](eng), 1, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
        Metadata:
          handler_name    : ISO Media file produced by Google Inc. Created on: 04/10/2019.
          vendor_id       : [0][0][0][0]
    Successfully opened the file.
    Parsing a group of options: output url en--story-video-out.mp4.
    Applying option c:v (codec name) with argument libx264.
    Applying option c:a (codec name) with argument copy.
    Successfully parsed a group of options.
    Opening an output file: en--story-video-out.mp4.
    [file @ 0xb9fbec0] Setting default whitelist 'file,crypto,data'
    Successfully opened the file.
    detected 20 logical cores
    [h264 @ 0xba04680] nal_unit_type: 7(SPS), nal_ref_idc: 3
    [h264 @ 0xba04680] nal_unit_type: 8(PPS), nal_ref_idc: 3
    Stream mapping:
      Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
      Stream #0:1 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xba04680] nal_unit_type: 6(SEI), nal_ref_idc: 0
    [h264 @ 0xba04680] nal_unit_type: 5(IDR), nal_ref_idc: 3
    [h264 @ 0xba04680] Format yuv420p chosen by get_format().
    [h264 @ 0xba04680] Reinit context to 1920x1088, pix_fmt: yuv420p
    [h264 @ 0xba04680] no picture 
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbaa3b80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    [h264 @ 0xbaa3b80] no picture 
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xba067c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xba9c2c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xba21fc0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbab8e80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbac7b00] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbad6840] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbae5580] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbaf42c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb03000] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb11d40] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb20a80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb2f7c0] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb3e500] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xbb4d240] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    cur_dts is invalid st:0 (0) [init:0 i_done:0 finish:0] (this is harmless if it occurs once at the start per stream)
    [h264 @ 0xba04680] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 0
    [h264 @ 0xbaa3b80] nal_unit_type: 1(Coded slice of a non-IDR picture), nal_ref_idc: 2
    [graph 0 input from stream 0:0 @ 0xba9f800] Setting 'video_size' to value '1920x1080'
    [graph 0 input from stream 0:0 @ 0xba9f800] Setting 'pix_fmt' to value '0'
    [graph 0 input from stream 0:0 @ 0xba9f800] Setting 'time_base' to value '1/15360'
    [graph 0 input from stream 0:0 @ 0xba9f800] Setting 'pixel_aspect' to value '1/1'
    [graph 0 input from stream 0:0 @ 0xba9f800] Setting 'frame_rate' to value '60/1'
    [graph 0 input from stream 0:0 @ 0xba9f800] w:1920 h:1080 pixfmt:yuv420p tb:1/15360 fr:60/1 sar:1/1
    [format @ 0xbaa0540] Setting 'pix_fmts' to value 'yuv420p|yuvj420p|yuv422p|yuvj422p|yuv444p|yuvj444p|nv12|nv16|nv21|yuv420p10le|yuv422p10le|yuv444p10le|nv20le|gray|gray10le'
    [AVFilterGraph @ 0xba16380] query_formats: 4 queried, 3 merged, 0 already done, 0 delayed
    [libx264 @ 0xba03c80] using mv_range_thread = 24
    [libx264 @ 0xba03c80] using SAR=1/1
    [libx264 @ 0xba03c80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
    Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
    [AVIOContext @ 0xb9fba00] Statistics: 0 bytes written, 0 seeks, 0 writeouts
    [AVIOContext @ 0xb9b4480] Statistics: 220581 bytes read, 2 seeks
    Conversion failed!