Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoded file is invalid #179

Open
mvasin opened this issue Sep 5, 2017 · 2 comments
Open

encoded file is invalid #179

mvasin opened this issue Sep 5, 2017 · 2 comments

Comments

@mvasin
Copy link

mvasin commented Sep 5, 2017

I'm on Ubuntu 16.04.3 with the ffmpeg installed via apt install ffmpeg. ffmpeg version appears to be 2.8.11-0ubuntu0.16.04.1.

I have a very annoying encoded file is invalid error that I haven't had before, so I decided to run tests, and 9 specs out of 190 fail.

One test fails because of a harmless timezone misassumption

  1) FFMPEG::Movie initializing given an awesome movie file should parse the creation_time
     Failure/Error: expect(movie.creation_time).to eq(Time.parse("2010-02-05 16:05:04 UTC"))

       expected: 2010-02-05 16:05:04.000000000 +0000
            got: 2010-02-05 16:05:04.000000000 +0300

       (compared using ==)

       Diff:
       @@ -1,2 +1,2 @@
       -2010-02-05 16:05:04 UTC
       +2010-02-05 16:05:04 +0300

     # ./spec/ffmpeg/movie_spec.rb:392:in `block (4 levels) in <module:FFMPEG>'

and the reason for the rest to fail is 'encoded file is invalid', something like

  2) FFMPEG::Transcoder transcoding with default transcoder_options should encode to the specified duration if given
     Failure/Error: raise Error, "Failed encoding.#{errors}Full output: #{@output}"

     FFMPEG::Error:
       Failed encoding.Errors: ffmpeg returned non-zero exit code, encoded file is invalid. Full output: ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
         built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 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 '/root/streamio-ffmpeg/spec/fixtures/movies/awesome movie.mov':
         Metadata:
           major_brand     : qt
           minor_version   : 0
           compatible_brands: qt
           creation_time   : 2010-02-05 16:05:04
         Duration: 00:00:07.56, start: 0.000000, bitrate: 481 kb/s
           Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 75 kb/s (default)
           Metadata:
             creation_time   : 2010-02-05 16:05:04
             handler_name    : Core Media Data Handler
           Stream #0:1(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 640x480 [SAR 1:1 DAR 4:3], 371 kb/s, 16.75 fps, 600 tbr, 600 tbn, 1200 tbc (default)
           Metadata:
             creation_time   : 2010-02-05 16:05:04
             handler_name    : Core Media Data Handler
             encoder         : H.264
       [libx264 @ 0x1718440] using SAR=1/1
       [libx264 @ 0x1718440] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
       [libx264 @ 0x1718440] profile High, level 2.2
       [libx264 @ 0x1718440] 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=1 lookahead_threads=1 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=16 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 @ 0x16c6ae0] The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.
     # ./lib/ffmpeg/transcoder.rb:113:in `validate_output_file'
     # ./lib/ffmpeg/transcoder.rb:43:in `run'
     # ./spec/ffmpeg/transcoder_spec.rb:193:in `block (4 levels) in <module:FFMPEG>'
@mvasin
Copy link
Author

mvasin commented Sep 5, 2017

Tried this on a mac laptop, and all tests passed (ffmpeg version 3.3.1).

@mvasin
Copy link
Author

mvasin commented Sep 5, 2017

Tried on Debian, and all tests passed but

  1) FFMPEG.ffmpeg_binary should default to finding from path
     Failure/Error: expect(FFMPEG.ffmpeg_binary).to eq FFMPEG.which('ffprobe')

       expected: "/usr/local/bin/ffmpeg"
            got: "/usr/bin/ffmpeg"

       (compared using ==)
     # ./spec/streamio-ffmpeg_spec.rb:33:in `block (3 levels) in <top (required)>'

The same error when using ruby:2.4.1 docker container.

apt install ffmpeg on Debian 9 brings ffmpeg version 3.2.7-1~deb9u1.

So, moving to Debian is a sort of a workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant