apc-llc / moviemaker-cpp

Encode video frame by frame in C++ using FFmpeg
MIT License
88 stars 14 forks source link

Executable segmentation fault #7

Closed Luca737 closed 2 years ago

Luca737 commented 2 years ago

After a successful compilation and running moviemaker-cpp_test I got the following output:

[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from movie
[ RUN      ] movie.random_pixels
[libvpx-vp9 encoder @ 0x55cc14088ac0] [Eval @ 0x7ffe98d66260] Undefined constant or missing '(' in 'zerolatency'
[libvpx-vp9 encoder @ 0x55cc14088ac0] Unable to parse option value "zerolatency"
[libvpx-vp9 encoder @ 0x55cc14088ac0] Error setting option tune to value zerolatency.
Output #0, mp4, to 'random_pixels.mp4':
  Stream #0:0: Unknown: none
[mp4 @ 0x55cc14063f00] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.
[1]    823225 segmentation fault (core dumped)  ./moviemaker-cpp_test

I get the same errors and segmentation fault when I run the example code from the README.md and dynamically linking it against libmoviemaker-cpp.so.

I'm very new to Linux and c++ so forgive me if I'm missing something. I'm using ArcoLinux and the packages installed are:

dmikushin commented 2 years ago

Hello, could you please make the following experiment: please comment out the line 51, recompile and run.

Luca737 commented 2 years ago

That worked! Thank you so much! I thought I searched all files for zerolatency...

Another question: Is the writing random pixels test supposed to take ~220 seconds? I also tried it with the example code getting similar times. When I wrote the png's to my SSD using LodePNG (taking ~18sec) and then used ffmpeg to create the mp4 (taking ~3sec) the total time was ~21 seconds. I just want to make sure that my setup is not to blame, since my Laptop has a few issues with Linux.

dmikushin commented 2 years ago

OK, zerolatency should actually be removed, because it belongs to H264 settings, not to VP9. That's why it complains. Furthermore, there is no null pointer check in the next lines, hence a segmentation fault. I need to address this.

dmikushin commented 2 years ago
$ ./moviemaker-cpp_test 
[==========] Running 2 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 2 tests from movie
[ RUN      ] movie.random_pixels
...
[       OK ] movie.svg_image (23891 ms)
[----------] 2 tests from movie (147946 ms total)

[----------] Global test environment tear-down
[==========] 2 tests from 1 test suite ran. (147946 ms total)
[  PASSED  ] 2 tests.

real    2m28.181s
user    2m27.653s
sys 0m0.168s

Although this test is not really a speed test, different codec and quality settings affect the performance. The goal of this project is to produce small-sized videos from a lot of images.