maxcurzi / tplay

A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.
MIT License
239 stars 16 forks source link

[BUG] Fail install tplay, at compile ffmpeg-next (lib) #24

Closed Zaptrouiyerxi closed 1 year ago

Zaptrouiyerxi commented 1 year ago

Describe the bug cargo install tplay fails on one of the last compiling steps. error[E0004]: non-exhaustive patterns: "sys::AVPixelFormat::AV_PIX_FMT_RPI", "sys::AVPixelFormat::AV_PIX_FMT_SAND128", "sys::AVPixelFormat::AV_PIX_FMT_SAND64_10" and 3 more not covered ^^^ Backticks replaced with double quotes to not break markdown.

To Reproduce Follow steps from readme.

Expected behavior Expected tplay to finish installing. Have "intermediate artifacts" from /tmp/cargo-install if needed.

Screenshots image

Desktop (please complete the following information):

Additional context Don't know Rust, can't provide any more intuition to the problem.

maxcurzi commented 1 year ago

@Zaptrouiyerxi There may be a couple of things: What version of ffmpeg have you installed? $ffmpeg -version I have version 4.4.2, please check that you have at least version 3 or 4, new versions won't work with the crate I'm using (ffmpeg-next-6.0.0) :(. "Currently supported FFmpeg versions: 3.4.x through 4.4.x."

I'll update the README accordingly, I noticed that the ffmpeg link now points to version 6!!

Also, I haven't tested this crate with OpenCV 3. You may still encounter issues after using the right ffmpeg version

Zaptrouiyerxi commented 1 year ago
ffmpeg version 4.1.11-0+deb10u1+rpt1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
configuration: --prefix=/usr --extra-version=0+deb10u1+rpt1 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-omx-rpi --enable-mmal --enable-neon --enable-rpi --enable-vout-drm --enable-v4l2-request --enable-libudev --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --libdir=/usr/lib/arm-linux-gnueabihf --cpu=arm1176jzf-s --arch=arm
libavutil      56. 22.100 / 56. 22.100
libavcodec     58. 35.100 / 58. 35.100
libavformat    58. 20.100 / 58. 20.100
libavdevice    58.  5.100 / 58.  5.100
libavfilter     7. 40.101 /  7. 40.101
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  3.100 /  5.  3.100
libswresample   3.  3.100 /  3.  3.100
libpostproc    55.  3.100 / 55.  3.100

Should I try 4.4.2?

maxcurzi commented 1 year ago

If you can, yes. I will try to troubleshoot this on a raspberry Pi, but it may take a few days.

maxcurzi commented 1 year ago

@Zaptrouiyerxi this may a bit tricky than expected. I tested it on a RPi 4 with a fresh Buster install and your same versions.

I managed to move forward the ffmpeg installation by modifying the Cargo.toml of this crate like this:

ffmpeg-next = { version = "6.0", features = ['rpi']}

This will ensure that ffmpeg-next builds. (To do this you'd want to clone this repository, modify Cargo.toml and install tplay locally with cargo install --path .)

After that, the crate compilation continues but when building the opencv crate if fails with a ton of errors (see below). This is probably expected because the OpenCV Version on the Raspberry Pi is 3.2 and not the supported (3.4 to 4.x) by the OpenCV crate. I'll check about updating OpenCV.

To manage your expectations though, it's likely that the performance of this crate will be quite bad when trying to tplay a video file as the process is CPU intensive and the Raspi is not exactly a powerhouse. I'm curious about making it work anyway so if I have any additional findings I'll post here.


error[E0425]: cannot find function `sub_scalar_matexpr` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:149:11
    |
149 | impl_ops!(sub_scalar_matexpr, Sub, Scalar, MatExpr, sub);
    |           ^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `mul_mat_mat` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:151:11
    |
151 | impl_ops!(mul_mat_mat, Mul, Mat, Mat, mul);
    |           ^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `mul_mat_matexpr` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:152:11
    |
152 | impl_ops!(mul_mat_matexpr, Mul, Mat, MatExpr, mul);
    |           ^^^^^^^^^^^^^^^ help: a function with a similar name exists: `elemmul_mat_matexpr`
...
174 | fn elemmul_mat_matexpr(a: &Mat, b: &MatExpr) -> Result<MatExpr> {
    | --------------------------------------------------------------- similarly named function `elemmul_mat_matexpr` defined here

error[E0425]: cannot find function `mul_matexpr_mat` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:153:11
    |
153 | impl_ops!(mul_matexpr_mat, Mul, MatExpr, Mat, mul);
    |           ^^^^^^^^^^^^^^^ help: a function with a similar name exists: `elemmul_matexpr_mat`
...
177 | fn elemmul_matexpr_mat(a: &MatExpr, b: &Mat) -> Result<MatExpr> {
    | --------------------------------------------------------------- similarly named function `elemmul_matexpr_mat` defined here

error[E0425]: cannot find function `mul_matexpr_matexpr` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:154:11
    |
154 | impl_ops!(mul_matexpr_matexpr, Mul, MatExpr, MatExpr, mul);
    |           ^^^^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `elemmul_matexpr_matexpr`
...
180 | fn elemmul_matexpr_matexpr(a: &MatExpr, b: &MatExpr) -> Result<MatExpr> {
    | ----------------------------------------------------------------------- similarly named function `elemmul_matexpr_matexpr` defined here

error[E0425]: cannot find function `mul_mat_f64` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:156:11
    |
156 | impl_ops!(mul_mat_f64, Mul, Mat, f64, mul);
    |           ^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `mul_matexpr_f64` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:157:11
    |
157 | impl_ops!(mul_matexpr_f64, Mul, MatExpr, f64, mul);
    |           ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `mul_f64_mat` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:158:11
    |
158 | impl_ops!(mul_f64_mat, Mul, f64, Mat, mul);
    |           ^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `mul_f64_matexpr` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:159:11
    |
159 | impl_ops!(mul_f64_matexpr, Mul, f64, MatExpr, mul);
    |           ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `div_mat_mat` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:161:11
    |
161 | impl_ops!(div_mat_mat, Div, Mat, Mat, div);
    |           ^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `div_mat_matexpr` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:162:11
    |
162 | impl_ops!(div_mat_matexpr, Div, Mat, MatExpr, div);
    |           ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `div_matexpr_mat` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:163:11
    |
163 | impl_ops!(div_matexpr_mat, Div, MatExpr, Mat, div);
    |           ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `div_matexpr_matexpr` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:164:11
    |
164 | impl_ops!(div_matexpr_matexpr, Div, MatExpr, MatExpr, div);
    |           ^^^^^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `div_mat_f64` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:166:11
    |
166 | impl_ops!(div_mat_f64, Div, Mat, f64, div);
    |           ^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `div_matexpr_f64` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:167:11
    |
167 | impl_ops!(div_matexpr_f64, Div, MatExpr, f64, div);
    |           ^^^^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `div_f64_mat` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:168:11
    |
168 | impl_ops!(div_f64_mat, Div, f64, Mat, div);
    |           ^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `div_f64_matexpr` in this scope
   --> /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src/manual/core/mat_ops.rs:169:11
    |
169 | impl_ops!(div_f64_matexpr, Div, f64, MatExpr, div);
    |           ^^^^^^^^^^^^^^^ not found in this scope

Some errors have detailed explanations: E0405, E0412, E0425, E0432, E0433.
For more information about an error, try `rustc --explain E0405`.
The following warnings were emitted during compilation:

warning: In file included from /usr/include/c++/8/vector:69,
warning:                  from /usr/include/opencv2/core/types.hpp:53,
warning:                  from /usr/include/opencv2/core.hpp:58,
warning:                  from /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src_cpp/ocvrs_common.hpp:15,
warning:                  from /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src_cpp/core.hpp:1,
warning:                  from /home/pi/tplay/target/release/build/opencv-8b79ee02d9c36668/out/core.cpp:1:
warning: /usr/include/c++/8/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const cv::Vec<double, 2>&}; _Tp = cv::Vec<double, 2>; _Alloc = std::allocator<cv::Vec<double, 2> >]’:
warning: /usr/include/c++/8/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector<cv::Vec<double, 2> >::iterator’ {aka ‘__gnu_cxx::__normal_iterator<cv::Vec<double, 2>*, std::vector<cv::Vec<double, 2> > >’} changed in GCC 7.1
warning:        vector<_Tp, _Alloc>::
warning:        ^~~~~~~~~~~~~~~~~~~
warning: In file included from /usr/include/c++/8/vector:64,
warning:                  from /usr/include/opencv2/core/types.hpp:53,
warning:                  from /usr/include/opencv2/core.hpp:58,
warning:                  from /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src_cpp/ocvrs_common.hpp:15,
warning:                  from /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src_cpp/core.hpp:1,
warning:                  from /home/pi/tplay/target/release/build/opencv-8b79ee02d9c36668/out/core.cpp:1:
warning: /usr/include/c++/8/bits/stl_vector.h: In function ‘void std_vectorLcv_Vec2dG_push_const_Vec2d(std::vector<cv::Vec<double, 2> >*, const Vec2d*)’:
warning: /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<cv::Vec<double, 2>*, std::vector<cv::Vec<double, 2> > >’ changed in GCC 7.1
warning:     _M_realloc_insert(end(), __x);
warning:     ^~~~~~~~~~~~~~~~~
warning: In file included from /usr/include/c++/8/vector:69,
warning:                  from /usr/include/opencv2/core/types.hpp:53,
warning:                  from /usr/include/opencv2/core.hpp:58,
warning:                  from /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src_cpp/ocvrs_common.hpp:15,
warning:                  from /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src_cpp/core.hpp:1,
warning:                  from /home/pi/tplay/target/release/build/opencv-8b79ee02d9c36668/out/core.cpp:1:
warning: /usr/include/c++/8/bits/vector.tcc: In function ‘void std_vectorLcv_Vec2dG_insert_size_t_const_Vec2d(std::vector<cv::Vec<double, 2> >*, size_t, const Vec2d*)’:
warning: /usr/include/c++/8/bits/vector.tcc:149:2: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<cv::Vec<double, 2>*, std::vector<cv::Vec<double, 2> > >’ changed in GCC 7.1
warning:   _M_realloc_insert(begin() + (__position - cbegin()), __x);
warning:   ^~~~~~~~~~~~~~~~~
warning: /usr/include/c++/8/bits/vector.tcc: In member function ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const cv::Vec<double, 3>&}; _Tp = cv::Vec<double, 3>; _Alloc = std::allocator<cv::Vec<double, 3> >]’:
warning: /usr/include/c++/8/bits/vector.tcc:413:7: note: parameter passing for argument of type ‘std::vector<cv::Vec<double, 3> >::iterator’ {aka ‘__gnu_cxx::__normal_iterator<cv::Vec<double, 3>*, std::vector<cv::Vec<double, 3> > >’} changed in GCC 7.1
warning:        vector<_Tp, _Alloc>::
warning:        ^~~~~~~~~~~~~~~~~~~
warning: In file included from /usr/include/c++/8/vector:64,
warning:                  from /usr/include/opencv2/core/types.hpp:53,
warning:                  from /usr/include/opencv2/core.hpp:58,
warning:                  from /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src_cpp/ocvrs_common.hpp:15,
warning:                  from /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src_cpp/core.hpp:1,
warning:                  from /home/pi/tplay/target/release/build/opencv-8b79ee02d9c36668/out/core.cpp:1:
warning: /usr/include/c++/8/bits/stl_vector.h: In function ‘void std_vectorLcv_Vec3dG_push_const_Vec3d(std::vector<cv::Vec<double, 3> >*, const Vec3d*)’:
warning: /usr/include/c++/8/bits/stl_vector.h:1085:4: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<cv::Vec<double, 3>*, std::vector<cv::Vec<double, 3> > >’ changed in GCC 7.1
warning:     _M_realloc_insert(end(), __x);
warning:     ^~~~~~~~~~~~~~~~~
warning: In file included from /usr/include/c++/8/vector:69,
warning:                  from /usr/include/opencv2/core/types.hpp:53,
warning:                  from /usr/include/opencv2/core.hpp:58,
warning:                  from /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src_cpp/ocvrs_common.hpp:15,
warning:                  from /home/pi/.cargo/registry/src/index.crates.io-1cd66030c949c28d/opencv-0.84.4/src_cpp/core.hpp:1,
warning:                  from /home/pi/tplay/target/release/build/opencv-8b79ee02d9c36668/out/core.cpp:1:
warning: /usr/include/c++/8/bits/vector.tcc: In function ‘void std_vectorLcv_Vec3dG_insert_size_t_const_Vec3d(std::vector<cv::Vec<double, 3> >*, size_t, const Vec3d*)’:
warning: /usr/include/c++/8/bits/vector.tcc:149:2: note: parameter passing for argument of type ‘__gnu_cxx::__normal_iterator<cv::Vec<double, 3>*, std::vector<cv::Vec<double, 3> > >’ changed in GCC 7.1
warning:   _M_realloc_insert(begin() + (__position - cbegin()), __x);
warning:   ^~~~~~~~~~~~~~~~~

error: could not compile `opencv` (lib) due to 1889 previous errors
Zaptrouiyerxi commented 1 year ago

I may leave it there, then. The Pi was just a quick way to have this running somewhere. I tried (while the install routines were running on the Pi -- slow) to run it on a slim ubuntu docker container, but I stopped when I found that theres special steps required to be able to ssh to such a container..

Just so I can see if tplay can be used remotely that way. Last attempt will be to install on one of my real ubuntu machines. I'd like to keep it as portable as possible.
Thanks for your time.

maxcurzi commented 1 year ago

Understood, I hope to make it more portable in the future!

maxcurzi commented 1 year ago

After several unsuccessful attempts in trying to install OpenCV 4 and install the crate on a Raspberry Pi 4 I'm now throwing the towel.

Zaptrouiyerxi commented 1 year ago

pyimagesearch works a lot with OpenCV and IIRC applied some of his dev to raspberries. Maybe some of his tutorials could offer some useful info, even if this here is not interesting anymore :) Thanks for trying.