1

Updates:

Successful:

relocated -strict -2

ffmpeg -i Dwell-2019-09-19_13.23.14.mp4 -filter:v "crop=1366:556:1:212" -strict -2 Dwell_out.mp4

Unsuccesful:

'-strict -2' did not make a difference.

ffmpeg -strict -2 -i Dwell-2019-09-19_13.23.14.mp4 -filter:v "crop=1366:556:1:212" Dwell_out.mp4 

Original Post

ffmpeg is invoked to crop a .mp4 video of resolution 720X1366. Specifically the goal is crop out the first 212 rows of the video's pixels:

ffmpeg -i Dwell-2019-09-19_13.23.14.mp4 -filter:v "crop=1366:556:1:213" Dwell_out.mp4

An .mp4 file of zero bytes is returned along with

ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg developers built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609 configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv libavutil 54. 31.100 / 54. 31.100 libavcodec 56. 60.100 / 56. 60.100 libavformat 56. 40.101 / 56. 40.101 libavdevice 56. 4.100 / 56. 4.100 libavfilter 5. 40.101 / 5. 40.101 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 1.101 / 3. 1.101 libswresample 1. 2.101 / 1. 2.101 libpostproc 53. 3.100 / 53. 3.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Dwell-2019-09-19_13.23.14.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf56.40.101 Duration: 00:00:33.94, start: 0.001333, bitrate: 526 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1366x768 [SAR 1:1 DAR 683:384], 518 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: vorbis (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 0 kb/s (default) Metadata: handler_name : SoundHandler File 'Dwell_out.mp4' already exists. Overwrite ? [y/N] y [libx264 @ 0x1cd1600] using SAR=1/1 [libx264 @ 0x1cd1600] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 [libx264 @ 0x1cd1600] profile High, level 3.1 [libx264 @ 0x1cd1600] 264 - core 148 r2643 5c65704 - 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 [aac @ 0x1cd2560] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

Where to begin troubleshooting?

3
  • Best start simple and simply add -strict -2 to your command line. Mind you it would be just as well to simply copy the audio rather than re-encode it: -c:a copy.
    – andrew.46
    Sep 20, 2019 at 1:10
  • @andrew.46 Thanks for the suggestion. OP updated.
    – gatorback
    Sep 20, 2019 at 4:12
  • 1
    Oops, you have put -strict -2 in the wrong spot, try ffmpeg -i Dwell-2019-09-19_13.23.14.mp4 -filter:v "crop=1366:556:1:213" -strict -2 Dwell_out.mp4 or better: ffmpeg -i Dwell-2019-09-19_13.23.14.mp4 -filter:v "crop=1366:556:1:213" -c:a copy Dwell_out.mp4.
    – andrew.46
    Sep 20, 2019 at 7:09

1 Answer 1

2

Your ffmpeg is really old

The FFmpeg AAC encoder is no longer considered to be experimental (it's been several years now at least), so you won't need -strict -2. You should upgrade and your original command will work. Go to johnvansickle.com, download and extract ffmpeg, and put it in ~/bin or /usr/local/bin, then log out and log in. Or follow a step-by-step guide to compile ffmpeg.

Vorbis audio in MP4?

That's certainly not common. I don't believe many non-FFmpeg based players will like that.

Otherwise, if it were AAC, which is common for the MP4 container, you could simply add the -c:a copy output option to stream copy (re-mux) instead of re-encode.

If you can't update your ancient ffmpeg

Add the -strict experimental (or the alias -strict -2) output option. Option placement matters, so make sure it is after the input and before the output:

ffmpeg -i Dwell-2019-09-19_13.23.14.mp4 -filter:v "crop=1366:556:1:212" -strict experimental Dwell_out.mp4 

This is the least recommended option because you're going to miss out on thousands of bug fixes and improvements: especially to the AAC encoder.

2
  • What is the difference between the johnvansickle.com download and the PPA: ubuntuhandbook.org/index.php/2018/10/…?
    – gatorback
    Sep 21, 2019 at 12:50
  • @gatorback Different authors. Jon only offers a simple executable file. The PPA will integrate it into your package management system: I don't know if it conflicts with the repo ffmpeg. PPA requires addition to your sources.list. PPA is FFmpeg 4.1 release branch. Jon's is more recent and offers either a daily snapshot from the current development branch or the latest release version which is FFmpeg 4.2. I don't know what is different in terms of supported external libraries. I wouldn't have to see the console output of the ffmpeg command of each.
    – llogan
    Sep 23, 2019 at 17:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .