ffmpeg FreeBSD - no such file or directory (Fixed!)

Need help? Post your questions here.

Moderator: moderators

ffmpeg FreeBSD - no such file or directory (Fixed!)

Postby FUNTOWNE » Mon Apr 28, 2014 12:20 am

Update:

Using the launch flag tomcat7_java_home="/usr/local/openjdk*" breaks ffmpeg decoding, original post follows.

I now have the issue where I can not seek, please see 3 posts down. Thank you! :D


First some background on my server:

the server
FreeBSD-10.0 x64
openjdk version "1.7.0_55"
OpenJDK Runtime Environment (build 1.7.0_55-b13)
OpenJDK 64-Bit Server VM (build 24.55-b03, mixed mode)
Apache Tomcat 7.0.53
ffmpeg version 2.2.1 (built from latest port)
Subsonic 4.9

I have tried both a symlink and dumping the binary for ffmpeg into /var/subsonic/transcode. Both return the following errors when building my library and/or playing the video:

Code: Select all
[2014-04-27 18:02:54,943] WARN FFmpegParser - Error when parsing metadata in XXXXX
java.io.IOException: Cannot run program "/var/subsonic/transcode/ffmpeg": error=2, No such file or directory

[4/27/14 8:05:55 PM EDT]    DEBUG   TranscodeInputStream   Starting transcoder: [/var/subsonic/transcode/ffmpeg] [0] [-i] [XXXXX] [-async] [1] [-b] [1000k] [-s] [640x480] [-ar] [44100] [-ac] [2] [-v] [0] [-f] [flv] [-vcodec] [libx264] [-preset] [superfast] [-vn] [-threads] [0] [-]
[4/27/14 8:05:55 PM EDT]    WARN   TranscodingService   Failed to transcode XXXXX. Using original.


From subsonic.log, if I run the following I receive an error
Code: Select all
-bash: [/var/subsonic/transcode/ffmpeg]: No such file or directory
[/var/subsonic/transcode/ffmpeg] [-ss] [0] [-i] [XXXXX] [-async] [1] [-b] [1000k] [-s] [640x480] [-ar] [44100] [-ac] [2] [-v] [0] [-f] [flv] [-vcodec] [libx264] [-preset] [superfast] [-threads] [0] [-] 


(I changed my transcode string for giggles in the last entry, same issue regardless of string)

I can successfully execute /var/subsonic/transcode/ffmpeg as a normal user or root, with the following output:

testing my ffmpeg symlink

Code: Select all
/var/subsonic/transcode/ffmpeg
ffmpeg version 2.1.1 Copyright (c) 2000-2013 the FFmpeg developers
  built on Apr 27 2014 12:47:40 with FreeBSD clang version 3.3 (tags/RELEASE_33/final 183502) 20130610
  configuration: --enable-libaacplus --disable-indev=alsa --disable-outdev=alsa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libass --enable-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 --enable-libv4l2 --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 --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --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-stripping --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'


/var/subsonic has permissions 777 set on it for debugging purposes.

XXXXX is the file to be decoded. Subsonic is pointing to a path to which all users have read and write access.

Needless to say, I am stumped. Has anyone run into this issue before? My gut reaction is to rebuild my old centos 6 virtual machine to bypass this, however there is likely someone else here who could benefit from a discussion to fix the actual issue.

I've seen many similar threads with fixes, but none seem to apply with my setup.
Last edited by FUNTOWNE on Tue May 13, 2014 4:04 pm, edited 2 times in total.
FUNTOWNE
 
Posts: 8
Joined: Sun Apr 27, 2014 10:48 pm

Re: ffmpeg - no such file or directory

Postby baaldemon » Mon Apr 28, 2014 4:03 pm

Can you do an ls -la on the /var/subsonic/ directory and then on the /var/subsonic/transcode/ directories and paste the outputs here.
baaldemon
 
Posts: 99
Joined: Fri May 07, 2010 11:54 am

Re: ffmpeg - no such file or directory

Postby FUNTOWNE » Mon Apr 28, 2014 8:21 pm

baaldemon wrote:Can you do an ls -la on the /var/subsonic/ directory and then on the /var/subsonic/transcode/ directories and paste the outputs here.



Sure:

Code: Select all
ls -la /var/subsonic

total 148
drwxrwxrwx   6 nobody  wheel     512 Apr 27 20:18 .
drwxr-xr-x  29 root    wheel     512 Apr 27 16:17 ..
drwxr-xr-x   2 nobody  wheel     512 Apr 27 20:18 db
drwxr-xr-x   7 nobody  wheel     512 Apr 27 18:00 lucene2
-rw-r--r--   1 nobody  wheel  122721 Apr 28 12:49 subsonic.log
-rw-r--r--   1 nobody  wheel     709 Apr 28 03:00 subsonic.properties
drwxr-xr-x   7 nobody  wheel     512 Apr 27 23:54 thumbs
drwxrwxrwx   2 nobody  wheel     512 Apr 27 20:00 transcode



Code: Select all
ls -la /var/subsonic/transcode

total 8
drwxrwxrwx  2 nobody  wheel  512 Apr 27 20:00 .
drwxrwxrwx  6 nobody  wheel  512 Apr 27 20:18 ..
lrwxr-xr-x  1 root    wheel   21 Apr 27 20:00 ffmpeg -> /usr/local/bin/ffmpeg



For the latter, making the symlink as a normal user also has the same errors as noted in the OP. Nobody is my catch-all user; I had the same error with www being the owner. This is leading me to think that there was a fundamental change with ffmpeg 2.2.1, FreeBSD 10 or Tomcat... no clue at this point.
FUNTOWNE
 
Posts: 8
Joined: Sun Apr 27, 2014 10:48 pm

Re: ffmpeg - no such file or directory

Postby baaldemon » Tue Apr 29, 2014 6:01 pm

Yeah that seems odd, based on the output it seems like everything is setup properly.
baaldemon
 
Posts: 99
Joined: Fri May 07, 2010 11:54 am

Re: ffmpeg - no such file or directory

Postby FUNTOWNE » Tue Apr 29, 2014 6:14 pm

baaldemon wrote:Yeah that seems odd, based on the output it seems like everything is setup properly.


It is mighty puzzling. I tried running the stand-alone server (but against openjdk 1.7 as installed) with no success. There has to be some stupid little setting I am clearly overlooking..?

I also tried the FFMPEG0 (0.7.something) package, same issue. So I think I can safely rule out FFMPEG.
FUNTOWNE
 
Posts: 8
Joined: Sun Apr 27, 2014 10:48 pm

Re: ffmpeg - no such file or directory (Partially solved!)

Postby FUNTOWNE » Tue Apr 29, 2014 6:23 pm

Small update and some success! A quick triple check of my rc.conf lead me to this:


I removed the following from my /etc/rc.conf tomcat7_java_home="/usr/local/openjdk7" I have 6 and 7 currently installed, however 7 appears to be the default. This does not explain why the stand-alone wasn't working, though :?


It appears that setting this flag for tomcat7 does something wonky with where "home" is considered for directories etc?

The only problem that now remains is that I can not seek through my videos. I suppose this is a transcoding setting that I need to tweak? Currently I am using the defaults.

Code: Select all
ffmpeg -i XXXXX

Duration: 00:41:29.66, start: 0.000000, bitrate: 1182 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 624x352 [SAR 1:1 DAR 39:22], 29.97 tbr, 29.97 tbn, 29.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 130 kb/s


ffmpeg is properly getting the length of the file, so again, a bit perplexed.
FUNTOWNE
 
Posts: 8
Joined: Sun Apr 27, 2014 10:48 pm

Re: ffmpeg FreeBSD - no such file or directory (Fixed!)

Postby FUNTOWNE » Tue May 13, 2014 4:05 pm

Problem solved!

Added to /etc/rc.conf:

tomcat7_java_opts="-Djava.net.preferIPv4Stack=true -server -Xmn128M -Xmx256M -Xms256M"

Also did chown -R www:www /var/subsonic

Seeking works properly now!
FUNTOWNE
 
Posts: 8
Joined: Sun Apr 27, 2014 10:48 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 44 guests