Can't play video files (No such file or directory)

Need help? Post your questions here.

Moderator: moderators

Can't play video files (No such file or directory)

Postby Tozo » Sat Oct 18, 2014 8:33 am

Hi,

I am trying to set up the subsonic on my VPS, but for some reason I can't play any videos(avi/mkv files). This is the error message I see:

Code: Select all
Video not found or access denied


Here is the small part of my subsonic.log file:

Code: Select all
[2014-10-18 08:41:46,972] WARN FFmpegParser - Error when parsing metadata in /mnt/ebs/programs/subsonic/series/GilmoreGirls/Gilmore.Girls.Season.5.DVDRip.XviD.DualAudio/5x01 - Say Goodbye to Daisy Miller.avi
java.io.IOException: Cannot run program "/mnt/ebs/programs/subsonic/transcode/ffmpeg": error=2, No such file or directory
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
        at java.lang.Runtime.exec(Runtime.java:617)
        at java.lang.Runtime.exec(Runtime.java:485)
        at net.sourceforge.subsonic.service.metadata.FFmpegParser.getRawMetaData(FFmpegParser.java:68)
        at net.sourceforge.subsonic.service.metadata.MetaDataParser.getMetaData(MetaDataParser.java:47)
        at net.sourceforge.subsonic.service.MediaFileService.createMediaFile(MediaFileService.java:475)
        at net.sourceforge.subsonic.service.MediaFileService.updateChildren(MediaFileService.java:356)
        at net.sourceforge.subsonic.service.MediaFileService.getChildrenOf(MediaFileService.java:192)
        at net.sourceforge.subsonic.service.MediaScannerService.scanFile(MediaScannerService.java:228)
        at net.sourceforge.subsonic.service.MediaScannerService.scanFile(MediaScannerService.java:232)
        at net.sourceforge.subsonic.service.MediaScannerService.doScanLibrary(MediaScannerService.java:178)
        at net.sourceforge.subsonic.service.MediaScannerService.access$000(MediaScannerService.java:48)
        at net.sourceforge.subsonic.service.MediaScannerService$2.run(MediaScannerService.java:147)
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:186)
        at java.lang.ProcessImpl.start(ProcessImpl.java:130)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
        ... 12 more


Interesting thing: If I try to play any other file (or even the same one for the second time), this error will not be regenerated.

Now the details:

The machine is an Ubuntu 14.04.1 LTS, which means that I couldn't install ffmpeg just typing one line command. I went through the steps detailed on this page: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

And at the end I ran this command (so you can see which components were installed):

Code: Select all
PATH="$PATH:$HOME/bin" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
  --prefix="$HOME/ffmpeg_build" \
  --extra-cflags="-I$HOME/ffmpeg_build/include" \
  --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
  --bindir="$HOME/bin" \
  --enable-gpl \
  --enable-libass \
  --enable-libfreetype \
  --enable-libmp3lame \
  --enable-libtheora \
  --enable-libvorbis \
  --enable-libx264 \
  --enable-nonfree


I downloaded the latest stand-alone version (5.0) of Subsonic, configured a little bit just so that it points to the right folders and I started up. I created a transcode folder under the subsonic folder and symlinked the ffmpeg:

Code: Select all
/mnt/ebs/programs/subsonic/transcode$ ls -l
total 0
lrwxrwxrwx 1 ubuntu ubuntu 15 Oct 18 09:09 ffmpeg -> /usr/bin/ffmpeg


If I run the which ffmpeg command, this is the result:
Code: Select all
/usr/bin/ffmpeg


If I run the ./ffmpeg from the transcode folder or this (/mnt/ebs/programs/subsonic/transcode/ffmpeg):

Code: Select all
ffmpeg version 1.2.6-7:1.2.6-1~trusty1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Apr 26 2014 18:52:58 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
  configuration: --arch=amd64 --disable-stripping --enable-avresample --enable-pthreads --enable-runtime-cpudetect --extra-version='7:1.2.6-1~trusty1' --libdir=/usr/lib/x86_64-linux-gnu --prefix=/usr --enable-bzlib --enable-libdc1394 --enable-libfreetype --enable-frei0r --enable-gnutls --enable-libgsm --enable-libmp3lame --enable-librtmp --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-vaapi --enable-vdpau --enable-libvorbis --enable-libvpx --enable-zlib --enable-gpl --enable-postproc --enable-libcdio --enable-x11grab --enable-libx264 --shlibdir=/usr/lib/x86_64-linux-gnu --enable-shared --disable-static
  libavutil      52. 18.100 / 52. 18.100
  libavcodec     54. 92.100 / 54. 92.100
  libavformat    54. 63.104 / 54. 63.104
  libavdevice    53.  5.103 / 53.  5.103
  libavfilter     3. 42.103 /  3. 42.103
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.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'


Also I tried to copy the ffmpeg into the transcode folder, but the result was the same.

I restarted the subsonic several times, it didn't help.

My java version:

Code: Select all
java -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.2) (7u65-2.5.2-3~14.04)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)


An other thing that worth mentioning:

Since there is not much space on the VPS, I can't store any video files there, so I am connected to my NAS (which is in my home where I have a running openVPN server). The VPS is configured and connected to the openVPN server, the shared drive is mounted and I can browse the folders/can copy any files.

If I want to play some music (from the shared drive), it is working, the only problem I have is with the video files.

Another thing:

I searched for this problem and found some similar threads, I tried all the suggestions there, but none of them worked.

Thanks,
Tozo
Tozo
 
Posts: 4
Joined: Mon Feb 11, 2013 8:13 pm

Re: Can't play video files (No such file or directory)

Postby Tozo » Sat Oct 18, 2014 5:55 pm

Ok,
I found the problem(s).

I will write the solution here for future reference.

Problem #1:
The ffmpeg version was not right. The very first I tried to install it by this commands:

Code: Select all
sudo add-apt-repository ppa:jon-severinsson/ffmpeg
sudo apt-get update
sudo apt-get install ffmpeg

But something didn't work for me, so I went with the other option (without reverting the changes that the first install made...) I mentioned in the original post: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
After I finished with this setup, I ran this command:
Code: Select all
which ffmpeg

and it said this location:
Code: Select all
/usr/bin/ffmpeg

This is wrong (for some reason it was in this thread, I just wasn't sure if they said the right thing there)!

Anyway, I wanted a fresh start so I removed the repository. It was here:

Code: Select all
/etc/apt/sources.list.d/

I just opened the jon-severinsson-ffmpeg-trusty.list file and commented out the repository.

Next, I removed all the ffmpeg references/packages.
Then I went through the previously mentioned ffmpeg setup: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu

After it was installed and I ran the which ffmpeg command, this was the result:

Code: Select all
/home/ubuntu/bin/ffmpeg

This is the right location!

But after all this it still didn't work.

Problem #2:
I created a new subdomain for the subsonic, but the VirtualHost configuration was not right. For some reason I was able to play musics, but not movies.

Anyway, after I changed the apache configuration, it started working.
An example, in case somebody else needs it:
Code: Select all
<VirtualHost *:443>
    ServerAdmin webmaster@localhost
    ServerName subsonic.domain.com

    ProxyPreserveHost on

    <location />
        allow from all
    </location>

    ProxyPass / http://127.0.0.1:4040/
    ProxyPassReverse / http://127.0.0.1:4040/

    SSLProxyEngine On
    SSLEngine On
    SSLCertificateFile /path/to/cert/domain.crt
    SSLCertificateKeyFile /path/to/cert/domain.key
    SSLCACertificateFile /path/to/cert/intermediate_domain_ca.crt

    ErrorLog ${APACHE_LOG_DIR}/subsonic_domain_error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/subsonic_domain_access.log combined
</VirtualHost>


Source thread for the apache config.

Tozo
Tozo
 
Posts: 4
Joined: Mon Feb 11, 2013 8:13 pm


Return to Help

Who is online

Users browsing this forum: No registered users and 21 guests