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

[BUG] ffmpeg ProcessSignaled(11) #3575

Closed
helgehr opened this issue Jun 14, 2021 · 9 comments
Closed

[BUG] ffmpeg ProcessSignaled(11) #3575

helgehr opened this issue Jun 14, 2021 · 9 comments
Labels

Comments

@helgehr
Copy link

helgehr commented Jun 14, 2021

Details

When trying to save a animation with gif(anim, "anim.gif") an error is thrown:

ERROR: failed process: Process(`/home/test/.julia/artifacts/7f40eeb66d90d3026ae5fb68761c263b57adb840/bin/ffmpeg -v 16 -framerate 20 -i /tmp/jl_b1XznB/%06d.png -i /tmp/jl_b1XznB/palette.bmp -lavfi paletteuse=dither=sierra2_4a -loop 0 -y /home/helge/test.gif`, ProcessSignaled(11)) [0]

The Problem seems to be an segmentation violation by the ffmpeg executable. When I use the same command in a terminal with /bin/ffmpeg instead everything seems to work fine.
This seems to be related to the following issue. I am running Arch Linux as well.
My full stacktraces is attatched: anim.log

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pyplot x
plotly x
plotlyjs x
pgfplotsx x
inspectdr x

Versions

Plots.jl version: 1.16.5
Backend version (]st -m <backend(s)>): 0.57.5
Output of versioninfo():

Julia Version 1.6.1
Commit 6aaedecc44* (2021-04-23 05:59 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i5-3570 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.0 (ORCJIT, ivybridge)
@helgehr helgehr added the bug label Jun 14, 2021
@t-bltg
Copy link
Member

t-bltg commented Jul 6, 2021

@helgehr as a workaround you can use Overrides.toml in ~/.julia/artifacts (see https://pkgdocs.julialang.org/v1/artifacts/#Overriding-artifact-locations) to point to your system ffmpeg or a custom built one, and julia will use it.

Overrides.toml

[b22a6f82-2f65-5046-a5b2-351ab43fb4e5]
FFMPEG = "..."
# sha1(artifact)=7f40eeb66d90d3026ae5fb68761c263b57adb840

with FFMPEG a path to a directory containing bin/ffmpeg.

@mo8it
Copy link

mo8it commented Jul 9, 2021

@helgehr as a workaround you can use Overrides.toml in ~/.julia/artifacts (see https://pkgdocs.julialang.org/v1/artifacts/#Overriding-artifact-locations) to point to your system ffmpeg or a custom built one, and julia will use it.

Overrides.toml

[b22a6f82-2f65-5046-a5b2-351ab43fb4e5]
FFMPEG = "..."
# sha1(artifact)=7f40eeb66d90d3026ae5fb68761c263b57adb840

with FFMPEG a path to a directory containing bin/ffmpeg.

Did not work for me :(

@t-bltg
Copy link
Member

t-bltg commented Jul 9, 2021

Did not work for me :(

Still a SIGSEGV (11) ?

Try:

  1. Running julia under $ strace -o log <...> and find the ffmpeg path in the log
  2. $ catchsegv <...> or $ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libSegFault.so <...>

And post the results here.

Install ffmpeg with ] add FFMPEG
Run julia -e 'using FFPEG; @ffmpeg_env run(`ffmpeg -version`)'
or
julia -e 'using FFPEG; FFMPEG.exe("-version")'

My output:

ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 8.1.0 (GCC)
configuration: --enable-cross-compile --cross-prefix=/opt/x86_64-linux-gnu/bin/x86_64-linux-gnu- --arch=x86_64 --target-os=linux --cc=cc --cxx=c++ --dep-cc=cc --ar=ar --nm=nm --objcc=objc --sysinclude=/workspace/destdir/include --pkg-config=/usr/bin/pkg-config --pkg-config-flags=--static --prefix=/workspace/destdir --sysroot=/opt/x86_64-linux-gnu/x86_64-linux-gnu/sys-root --extra-libs=-lpthread --enable-gpl --enable-version3 --enable-nonfree --disable-static --enable-shared --enable-pic --disable-debug --disable-doc --enable-avresample --enable-libass --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libx264 --enable-libx265 --enable-libvpx --enable-encoders --enable-decoders --enable-muxers --enable-demuxers --enable-parsers --enable-openssl --disable-schannel --extra-cflags=-I/workspace/destdir/include --extra-ldflags=-L/workspace/destdir/lib --enable-nvenc --enable-cuda-llvm
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100
Process(`[...]/.julia/artifacts/7f40eeb66d90d3026ae5fb68761c263b57adb840/bin/ffmpeg -version`, ProcessExited(0))

@helgehr
Copy link
Author

helgehr commented Jul 12, 2021

Thanks for your advise!

For me it sadly does not work either. So I added this in my .julia/artifacts/Overrides.toml:

[b22a6f82-2f65-5046-a5b2-351ab43fb4e5]
FFMPEG = "/usr/bin/ffmpeg"

Now if I go to the julia REPL and type in using FFMPEG I get an InitError:

ERROR: InitError: Artifact "FFMPEG" was not installed correctly. Try `using Pkg; Pkg.instantiate()` to re-install all missing resources.

When I type in the suggested commands and afterwards try using FFMPEG; FFMPEG.exe("-version") I get the following error:

ERROR: MethodError: no method matching withenv_executable_wrapper(::FFMPEG.var"#4#6"{Cmd}, ::Nothing, ::String, ::String, ::Bool, ::Bool)
Closest candidates are:
  withenv_executable_wrapper(::Function, ::String, ::String, ::String, ::Bool, ::Bool) at /home/helge/.julia/packages/JLLWrappers/bkwIo/src/runtime.jl:37
Stacktrace:
 [1] #invokelatest#2
   @ ./essentials.jl:708 [inlined]
 [2] invokelatest
   @ ./essentials.jl:706 [inlined]
 [3] #ffmpeg#7
   @ ~/.julia/packages/JLLWrappers/bkwIo/src/products/executable_generators.jl:7 [inlined]
 [4] ffmpeg
   @ ~/.julia/packages/JLLWrappers/bkwIo/src/products/executable_generators.jl:7 [inlined]
 [5] #exe#2
   @ ~/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:111 [inlined]
 [6] #exe#1
   @ ~/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:64 [inlined]
 [7] exe(args::String)
   @ FFMPEG ~/.julia/packages/FFMPEG/OUpap/src/FFMPEG.jl:64
 [8] top-level scope
   @ REPL[3]:1

Did I do something wrong in editing the Overrides.toml?

@t-bltg
Copy link
Member

t-bltg commented Jul 12, 2021

For me it sadly does not work either. So I added this in my .julia/artifacts/Overrides.toml:

[b22a6f82-2f65-5046-a5b2-351ab43fb4e5]
FFMPEG = "/usr/bin/ffmpeg"

Did I do something wrong in editing the Overrides.toml?

Yes, it should be:

[b22a6f82-2f65-5046-a5b2-351ab43fb4e5]
FFMPEG = "/usr"

, so that "$(FFMPEG)/bin/ffmpeg" yields /usr/bin/ffmpeg.

When I type in the suggested commands and afterwards try using FFMPEG; FFMPEG.exe("-version") I get the following error:

It think it errors out because it fails to find FFMPEG in 1.

::FFMPEG.var"#4#6"{Cmd}, ::Nothing
                         ^^^^^^^^^^ nothing instead of "/usr/bin/ffmpeg"

@helgehr
Copy link
Author

helgehr commented Jul 12, 2021

Ok, thank you! I also had to install the libavresample library, because it was not in my /usr/lib/ path, but apparently julia needs it.

But now it works!

@t-bltg
Copy link
Member

t-bltg commented Jul 12, 2021

Glad to hear ! Don't forget to close the issue if all is resolved 😉 .

@helgehr helgehr closed this as completed Jul 12, 2021
@mo8it
Copy link

mo8it commented Jul 14, 2021

@t-bltg Thanks for your help! It did work :)
But I would not close the issue because this is only a workaround. The issue is not solved!

@t-bltg
Copy link
Member

t-bltg commented Jul 14, 2021

@mo8it, great !

It is a workaround, yes, but there is nothing Plots.jl can do here.

If julia -e 'using FFPEG; FFMPEG.exe("-version")' segfaults on Arch, then the issue should go in https://github.com/JuliaIO/FFMPEG.jl, not here.

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

No branches or pull requests

3 participants