FAQ  •  Register  •  Login

Problem with FFMPEG or Java

<<

Zikofski

Serviio newbie

Posts: 6

Joined: Mon Aug 12, 2013 10:43 am

Post Mon Aug 12, 2013 9:22 pm

Problem with FFMPEG or Java

im new to this, i managed to get serviio working minus a few profile issues but il try and get that sorted later.

something happened that i needed to reinstall everything again time consuming but since that i have an error in my log which is preventing serviio from finding and adding files

here is part of the log in question

2013-08-12 22:08:03,801 DEBUG [VideoExtractionStrategy] Extracting metadata of video file: /mnt/raid/Storage/Movies/DVD/The Fog (2005).mkv
2013-08-12 22:08:03,801 DEBUG [FFMPEGWrapper] Invoking FFMPEG to retrieve media information for file: /mnt/raid/Storage/Movies/DVD/The Fog (2005).mkv
2013-08-12 22:08:03,802 DEBUG [ProcessExecutor] Starting ffmpeg -i /mnt/raid/Storage/Movies/DVD/The Fog (2005).mkv
2013-08-12 22:08:03,811 ERROR [ProcessExecutor] Fatal error in process starting: Cannot run program "ffmpeg": java.io.IOException: error=2, No such file or directory
java.io.IOException: Cannot run program "ffmpeg": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:488)
at org.serviio.external.ProcessExecutor.run(ProcessExecutor.java:135)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
at java.lang.ProcessImpl.start(ProcessImpl.java:81)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:470)
... 1 more
2013-08-12 22:08:03,812 WARN [ProcessExecutor] Cannot retrieve results, output reader is null
2013-08-12 22:08:03,812 WARN [LibraryManager] Skipping processing metadata for an unsupported file (The Fog (2005).mkv). Message: Unknown video file type.

now from reading it i am unsure what is causing the error but i think its one of two things java or FFMPEG

this is the process i used to build ffmpeg on my system

  Code:
cd ~/src
wget http://download.serviio.org/opensource/ffmpeg-N-54096-ge41bf19.tar.gz
tar xzvf ffmpeg-N-54096-ge41bf19.tar.gz
cd ffmpeg
./configure --enable-gpl --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \
    --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libx264 \
    --enable-nonfree --enable-postproc --enable-version3 --enable-x11grab --enable-librtmp \
    --enable-libxvid --enable-libass
make
sudo checkinstall --pkgname=ffmpeg --pkgversion="99:$(date +%Y%m%d%H%M)-git" --backup=no --deldoc=yes --fstrans=no --default


forgot to mention i am using ubuntu 12.04 server, and i did use this walkthrough here to help me (http://wiki.serviio.org/doku.php?id=build_ffmpeg_linux), altho i changed to the source linked from the serviio main website
Last edited by Zikofski on Mon Aug 12, 2013 9:29 pm, edited 1 time in total.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Aug 12, 2013 9:29 pm

Re: Problem with FFMPEG or Java

where did it install the ffmpeg binary? Is it on path? If not, you can point to it with ffmpeg.location system variable (see FAQ for how to do that)
<<

Zikofski

Serviio newbie

Posts: 6

Joined: Mon Aug 12, 2013 10:43 am

Post Mon Aug 12, 2013 9:33 pm

Re: Problem with FFMPEG or Java

no idea tbh i am no good with linux myself i presume it is left in ~/src/ffmpeg

il scan through hte FAQ and have a look maybe that is the issue here,

another question regarding the LOG, how oftern dose it clear its content's and if i delete its contents will that cause issues?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Aug 12, 2013 9:47 pm

Re: Problem with FFMPEG or Java

you can delete the log, no problem
<<

Zikofski

Serviio newbie

Posts: 6

Joined: Mon Aug 12, 2013 10:43 am

Post Tue Aug 13, 2013 9:26 am

Re: Problem with FFMPEG or Java

okay so i found out where it is installed by using the command

  Code:
which ffmpeg
usr/local/bin/ffmpeg


okay so i added this to serviio.sh

  Code:
-ffmpeg.location=$usr/local/bin/ffmpeg


in the line JAVA_OPTS

but now my serviio will not run and when i try to start i get this

  Code:
serviio
Unrecognized option: -ffmpeg.location=/local/bin/ffmpeg
Could not create the Java virtual machine.


not sure if my syntax is correct?

EDIT: i have removed the $ from the string and now i get

  Code:
Unrecognized option: -ffmpeg.location=usr/local/bin/ffmpeg
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Aug 13, 2013 9:34 am

Re: Problem with FFMPEG or Java

You have to add

  Code:
-Dffmpeg.location=/usr/....


to the list of other -D parameters
<<

asharp

Serviio newbie

Posts: 9

Joined: Mon Jun 09, 2014 1:59 am

Post Mon Jun 09, 2014 2:12 am

Re: Problem with FFMPEG or Java

It appears that this issue has "re-appeared". OS: FreeBSD v10 and Serviio Pro (1.4.1.2). Unfortunately, this may have been happening since I moved to v10. The system was completely rebuilt and I may have missed that this was happening.

Log:

2014-06-08 21:56:27,981 ERROR [ProcessExecutor] Fatal error in process starting: Cannot run program "/usr/local/bin/ffmpeg": error=2, No such file or directory
java.io.IOException: Cannot run program "/usr/local/bin/ffmpeg": error=2, No such file or directory

And yet, the file is there:

# which ffmpeg
/usr/local/bin/ffmpeg
# ffmpeg
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Apr 22 2014 23:56:04 with FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
configuration: --enable-libaacplus --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-libass --disable-libcdio --enable-libcelt --enable-libfaac --enable-libfdk-aac --enable-ffserver --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-iconv --disable-indev=jack --enable-libmp3lame --enable-libbluray --disable-libv4l2 --disable-indev=v4l2 --disable-outdev=v4l2 --enable-libmodplug --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --disable-libpulse --disable-indev=pulse --disable-outdev=pulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --disable-vaapi --disable-vdpau --enable-libvorbis --disable-libvo-aacenc --disable-libvo-amrwbenc --enable-libvpx --enable-libx264 --enable-libxvid --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --enable-shared --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-memalign-hack --disable-libstagefright-h264 --disable-libutvideo --disable-libsoxr --cc=cc --extra-cflags='-msse -I/usr/local/include/vorbis -I/usr/local/include' --extra-ldflags='-L/usr/local/lib ' --extra-libs=-pthread --disable-debug --enable-nonfree --enable-version3
libavutil 52. 48.101 / 52. 48.101
libavcodec 55. 39.101 / 55. 39.101
libavformat 55. 19.104 / 55. 19.104
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libavresample 1. 1. 0 / 1. 1. 0
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

Tried the "-Dffmpeg.location" and didn't help. Any recommendations on how to resolve this? Experiencing the **same** issue with dcraw. Both dcraw and ffmpeg were installed prior to the installation of Serviio. Is there a means to increase logging (to a greater debug level)? Certainly willing to try to track down the specifics, but not being a java developer - not sure where to begin looking without some minor guidance.

FWIW - I do have some other applications (same machine) that use/rely on ffmpeg and those operate without issue.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Mon Jun 09, 2014 7:50 pm

Re: Problem with FFMPEG or Java

perhaps the user running serviio doesn't have access to the executable?
<<

asharp

Serviio newbie

Posts: 9

Joined: Mon Jun 09, 2014 1:59 am

Post Mon Jun 09, 2014 10:32 pm

Re: Problem with FFMPEG or Java

As the user, ffmpeg can be executed. Shouldn't be a permissions issue with ffmpeg unless there is some change in how it operates from previous versions. Looking again at the log file, it appears that perhaps: Is it possible that if a file is an "unknown" format or type to ffmpeg that serviio will still show this error? ie: ffmpeg is there, get's executed, but serviio thinks that ffmpeg didn't actually run because there is no output from ffmpeg? Suggesting that there is a difference between "I can't find and/or run ffmpeg" vs. "I executed it, but I received no data from it". At present, the log "implies" that it couldn't find/execute ffmpeg, even if it did.

Thoughts?
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue Jun 10, 2014 4:31 pm

Re: Problem with FFMPEG or Java

The error means the Java process cannot find the file or is not readable.

I assume if you execute /usr/local/bin/ffmpeg it works in the terminal?
<<

asharp

Serviio newbie

Posts: 9

Joined: Mon Jun 09, 2014 1:59 am

Post Wed Jun 11, 2014 12:51 am

Re: Problem with FFMPEG or Java

Correct. Results when executed as the same user (via "su - dlna") that serviio runs as (the path to ffmpeg is also correct - as stated in the serviio log file):

dlna$ ffmpeg
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers
built on Apr 22 2014 23:56:04 with FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
configuration: --enable-libaacplus --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-libass --disable-libcdio --enable-libcelt --enable-libfaac --enable-libfdk-aac --enable-ffserver --enable-fontconfig --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-iconv --disable-indev=jack --enable-libmp3lame --enable-libbluray --disable-libv4l2 --disable-indev=v4l2 --disable-outdev=v4l2 --enable-libmodplug --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --disable-libpulse --disable-indev=pulse --disable-outdev=pulse --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --disable-vaapi --disable-vdpau --enable-libvorbis --disable-libvo-aacenc --disable-libvo-amrwbenc --enable-libvpx --enable-libx264 --enable-libxvid --prefix=/usr/local --mandir=/usr/local/man --datadir=/usr/local/share/ffmpeg --enable-shared --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --enable-pthreads --enable-memalign-hack --disable-libstagefright-h264 --disable-libutvideo --disable-libsoxr --cc=cc --extra-cflags='-msse -I/usr/local/include/vorbis -I/usr/local/include' --extra-ldflags='-L/usr/local/lib ' --extra-libs=-pthread --disable-debug --enable-nonfree --enable-version3
libavutil 52. 48.101 / 52. 48.101
libavcodec 55. 39.101 / 55. 39.101
libavformat 55. 19.104 / 55. 19.104
libavdevice 55. 5.100 / 55. 5.100
libavfilter 3. 90.100 / 3. 90.100
libavresample 1. 1. 0 / 1. 1. 0
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg'

A point to my previous statement. Here is a snippet from the log file (filename obscured):

2014-06-10 20:00:20,236 WARN [ProcessExecutor] Cannot retrieve results, output reader is null
2014-06-10 20:00:20,236 WARN [LibraryManager] Skipping processing metadata for an unsupported file (<PATH_TO_FILE/FILENAME>). Message: Unknown video file type.
2014-06-10 20:00:20,236 ERROR [ProcessExecutor] Fatal error in process starting: Cannot run program "/usr/local/bin/ffmpeg": error=2, No such file or directory
java.io.IOException: Cannot run program "/usr/local/bin/ffmpeg": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1041)
at org.serviio.external.ProcessExecutor.run(ProcessExecutor.java:135)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:184)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1022)
... 1 more

Hopefully this helps.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Jun 11, 2014 11:31 pm

Re: Problem with FFMPEG or Java

Try to play with the access rights (eg give the executable access to everyone).
<<

asharp

Serviio newbie

Posts: 9

Joined: Mon Jun 09, 2014 1:59 am

Post Fri Jun 13, 2014 6:30 pm

Re: Problem with FFMPEG or Java

Permissions are already (and have been) the stock permissions of 0755. All users can execute. There should not be any permissions problems.

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 27 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.