FAQ  •  Register  •  Login

[SOLVED] FFMpeg command + Subtitles won't work

<<

FoH

Streaming enthusiast

Posts: 40

Joined: Fri Jan 06, 2012 5:14 pm

Post Sat Aug 10, 2013 7:43 pm

[SOLVED] FFMpeg command + Subtitles won't work

Update:
Version 1.3.1 seems to have fixed this problem.

Hi,
I'm experiencing a strange problem with subtitles. Here's the output from the log file:

  Code:
2013-08-10 21:10:47,377 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: /media/Storage/Serier/True.Blood/True.Blood.S06E03.Youre.No.Good.WEB-DL.x264.AAC.mp4
2013-08-10 21:10:47,378 DEBUG [ProcessExecutor] Starting /home/martin/.myprograms/serviio/bin/ffmpeg -threads 4 -i /media/Storage/Serier/True.Blood/True.Blood.S06E03.Youre.No.Good.WEB-DL.x264.AAC.mp4 -y -threads 4 -c:v mpeg2video -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -vf subtitles=filename="/media/Storage/Serier/True.Blood/True.Blood.S06E03.Youre.No.Good.WEB-DL.x264.AAC.srt":original_size=720x404:charenc=UTF-8 -r 24000/1001 -g 15 -c:a ac3 -b:a 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-467-sony2010-ORIGINAL-631acdc82af1e83aa410f631d2510a6e.stf
2013-08-10 21:10:47,408 WARN  [ProcessExecutor] Process /home/martin/.myprograms/serviio/bin/ffmpeg has a return code of 1! This is a possible error. Detailed output follows.
creation_time   : 2013-06-30 23:37:57
handler_name    : Sound Media Handler
[Parsed_subtitles_0 @ 0x1ca8cc0] Unable to open "/media/Storage/Serier/True.Blood/True.Blood.S06E03.Youre.No.Good.WEB-DL.x264.AAC.srt"
[AVFilterGraph @ 0x1c81e60] Error initializing filter 'subtitles' with args 'filename="/media/Storage/Serier/True.Blood/True.Blood.S06E03.Youre.No.Good.WEB-DL.x264.AAC.srt":original_size=720x404:charenc=UTF-8'
Error opening filters!
2013-08-10 21:10:47,408 DEBUG [TranscodingJobListener] Transcoding finished; successful: false
2013-08-10 21:10:57,389 DEBUG [TranscodingJobListener] Deleted temp file '/tmp/Serviio/transcoding-temp-467-sony2010-ORIGINAL-631acdc82af1e83aa410f631d2510a6e.stf': true
2013-08-10 21:10:57,390 DEBUG [AbstractTranscodingDeliveryEngine] Removing transcoding listener with id transcoding-temp-467-sony2010-ORIGINAL-631acdc82af1e83aa410f631d2510a6e.stf
2013-08-10 21:10:57,390 ERROR [ResourceTransportRequestHandler] Error while processing resource, sending back 500 error. Message: FFmpeg execution failed
java.io.IOException: FFmpeg execution failed
   at org.serviio.delivery.resource.transcode.FileBasedTranscodingDeliveryStrategy.createInputStream(FileBasedTranscodingDeliveryStrategy.java:49)
   at org.serviio.delivery.resource.transcode.AbstractTranscodingDeliveryEngine.retrieveTranscodedResource(AbstractTranscodingDeliveryEngine.java:134)
   at org.serviio.delivery.resource.AbstractDeliveryEngine.deliver(AbstractDeliveryEngine.java:110)
   at org.serviio.delivery.MediaResourceRetrievalStrategy.retrieveResource(MediaResourceRetrievalStrategy.java:153)
   at org.serviio.delivery.GETMethodProcessor.retrieveResource(GETMethodProcessor.java:121)
   at org.serviio.delivery.GETMethodProcessor.buildDeliveryContainer(GETMethodProcessor.java:48)
   at org.serviio.delivery.AbstractMethodProcessor.handleRequest(AbstractMethodProcessor.java:100)
   at org.serviio.delivery.ResourceDeliveryProcessor.deliverContent(ResourceDeliveryProcessor.java:81)
   at org.serviio.upnp.webserver.ResourceTransportRequestHandler.handleRequest(ResourceTransportRequestHandler.java:86)
   at org.serviio.upnp.webserver.AbstractRequestHandler.handle(AbstractRequestHandler.java:61)
   at org.apache.http.protocol.HttpService.doService(HttpService.java:293)
   at org.serviio.upnp.webserver.ServiioHttpService.doService(ServiioHttpService.java:77)
   at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:212)
   at org.serviio.upnp.webserver.WebServer$WorkerThread.run(WebServer.java:192)


But if I copy and paste the ffmpeg command in a Terminal, it actually works:

  Code:
martin@desktop:~$ /home/martin/.myprograms/serviio/bin/ffmpeg -threads 4 -i /media/Storage/Serier/True.Blood/True.Blood.S06E03.Youre.No.Good.WEB-DL.x264.AAC.mp4 -y -threads 4 -c:v mpeg2video -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -vf subtitles=filename="/media/Storage/Serier/True.Blood/True.Blood.S06E03.Youre.No.Good.WEB-DL.x264.AAC.srt":original_size=720x404:charenc=UTF-8 -r 24000/1001 -g 15 -c:a ac3 -b:a 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-467-sony2010-ORIGINAL-631acdc82af1e83aa410f631d2510a6e.stf
ffmpeg version 1.1.git Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug  9 2013 17:19:32 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
  configuration: --prefix=/home/martin/.myprograms/serviio/bin/src/ffmpeg --extra-cflags=-I/home/martin/.myprograms/serviio/bin/src/ffmpeg/include --extra-ldflags=-L/home/martin/.myprograms/serviio/bin/src/ffmpeg/lib --bindir=/home/martin/.myprograms/serviio/bin/src/ffmpeg/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-x11grab
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 16.100 / 55. 16.100
  libavformat    55.  9.100 / 55.  9.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/media/Storage/Serier/True.Blood/True.Blood.S06E03.Youre.No.Good.WEB-DL.x264.AAC.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2013-07-01 00:01:04
  Duration: 00:57:53.41, start: 0.000000, bitrate: 1092 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 720x404 [SAR 1:1 DAR 180:101], 960 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc
    Metadata:
      creation_time   : 2013-07-01 00:01:04
      handler_name    : True.Blood.S06E03.Youre.No.Good.WEB-DL.x264.AAC.264#trackID=1:fps=23.976@GPAC0.5.1-DEV-rev4283
    Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 127 kb/s
    Metadata:
      creation_time   : 2013-06-30 23:37:57
      handler_name    : Sound Media Handler
[mpeg2video @ 0x1b04e60] impossible bitrate constraints, this will fail
Output #0, mpegts, to '/tmp/Serviio/transcoding-temp-467-sony2010-ORIGINAL-631acdc82af1e83aa410f631d2510a6e.stf':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    encoder         : Lavf55.9.100
    Stream #0:0(und): Video: mpeg2video, yuv420p, 720x404 [SAR 1:1 DAR 180:101], q=2-31, 17000 kb/s, 90k tbn, 23.98 tbc
    Metadata:
      creation_time   : 2013-07-01 00:01:04
      handler_name    : True.Blood.S06E03.Youre.No.Good.WEB-DL.x264.AAC.264#trackID=1:fps=23.976@GPAC0.5.1-DEV-rev4283
    Stream #0:1(eng): Audio: ac3, 48000 Hz, stereo, fltp, 384 kb/s
    Metadata:
      creation_time   : 2013-06-30 23:37:57
      handler_name    : Sound Media Handler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mpeg2video)
  Stream #0:1 -> #0:1 (aac -> ac3)
Press [q] to stop, [?] for help
[Parsed_subtitles_0 @ 0x1d9b0e0] Neither PlayResX nor PlayResY defined. Assuming 384x288
frame=  784 fps=275 q=2.0 Lsize=   14291kB time=00:00:33.08 bitrate=3538.8kbits/s dup=2 drop=0   


As you can see I've compiled my own ffmpeg, and I'm running a 64-bit Ubuntu Linux. The command is indeed using my own compiled ffmpeg and not using the one provided with the distribution. Since the command doesn't show any faults when running in a Terminal, I don't really get what's wrong here. I need some information on the "internals" of Serviios handling of the ffmpeg command to continue troubleshooting.

I did have to do some "improvisation" when compiling ffmpeg, but since the command runs just fine in a terminal I'm not ready to begin anew there.

Other points of information:
* I have tried opening the .stf file with VLC and it plays fine and has the subtitles burnt in.
* Other files (without subtitles) works fine with the same ffmpeg binary
* The files have the same permission, that is both the .srt and the .mp4
Last edited by FoH on Sun Aug 18, 2013 2:40 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 Sat Aug 10, 2013 9:41 pm

Re: FFMpeg command + Subtitles won't work from within Servii

Do you have other videos with srt that you can play?

It does look like access rights, are you sure the srt file is readable by the user running the serviio process?
<<

FoH

Streaming enthusiast

Posts: 40

Joined: Fri Jan 06, 2012 5:14 pm

Post Sun Aug 11, 2013 12:03 am

Re: FFMpeg command + Subtitles won't work from within Servii

No, as of yet I have not found a working combination.

Serviio runs as the regular user, it's started upon login. These particular files are on an NTFS partition and has root as the owner, but both group and others have write and read access (as is the case with all files on the partition probably due to it being an NTFS format).

The movie file plays perfectly fine if I move the .srt file out of the directory, and as stated earlier they both have the same access rights. I have also tried now playing another movie on an EXT4 partition which also has a .srt file, and this didn't work either. Output below:
  Code:
2013-08-11 01:52:04,435 DEBUG [ProcessExecutor] Starting /home/martin/.myprograms/serviio/bin/ffmpeg -threads 4 -i /media/SSD/Movies/Magdalena/Twilight Saga/Eclipse/Eclipse.2010.avi -y -threads 4 -c:v mpeg2video -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -vf pad=640:360:0:44:black,setdar=4:3,subtitles=filename="/media/SSD/Movies/Magdalena/Twilight Saga/Eclipse/Eclipse.2010.srt":original_size=640x272:charenc=UTF-8 -r 24000/1001 -g 15 -c:a ac3 -b:a 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-5-sony2010-ORIGINAL-997ac8c493aadbac8467c8dbdc64be53.stf
2013-08-11 01:52:04,569 WARN  [ProcessExecutor] Process /home/martin/.myprograms/serviio/bin/ffmpeg has a return code of 1! This is a possible error. Detailed output follows.
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 136 kb/s
[Parsed_setdar_1 @ 0x1fd4ee0] num:den syntax is deprecated, please use num/den or named options instead
[Parsed_subtitles_2 @ 0x1fd6300] Unable to open "/media/SSD/Movies/Magdalena/Twilight Saga/Eclipse/Eclipse.2010.srt"
[AVFilterGraph @ 0x1fbc6e0] Error initializing filter 'subtitles' with args 'filename="/media/SSD/Movies/Magdalena/Twilight Saga/Eclipse/Eclipse.2010.srt":original_size=640x272:charenc=UTF-8'
Error opening filters!
2013-08-11 01:52:04,569 DEBUG [TranscodingJobListener] Transcoding finished; successful: false


That last particular movie I know for a fact worked before moving to Serviio 1.3 and recompiling ffmpeg. So although it is possible my recompiling has messed things up, I don't understand what's different when Serviio launches the command and I launch it in a terminal window. Does the executing environment differ somehow?

Earlier tonight I also tried an .mkv with embedded subs, and that didn't work either. I can't remember what the error message was exactly, but I think it was something to do with extracting the subs from the file that failed. (I did extract the subs manually to an .srt and tried also with the coresponding checkbox in Console unmarked, but ended up with the same fault as with the other files.)
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Aug 11, 2013 11:59 am

Re: FFMpeg command + Subtitles won't work from within Servii

Can you try with a file with no spaces (and weird characters) in the file path?
<<

FoH

Streaming enthusiast

Posts: 40

Joined: Fri Jan 06, 2012 5:14 pm

Post Sun Aug 11, 2013 11:32 pm

Re: FFMpeg command + Subtitles won't work from within Servii

zip wrote:Can you try with a file with no spaces (and weird characters) in the file path?


Sure. The first example didn't have any spaces and weird characters, but I can try the same with the other example from the other partition. I'll post at a later time, I'm not at my regular computer right now.
<<

FoH

Streaming enthusiast

Posts: 40

Joined: Fri Jan 06, 2012 5:14 pm

Post Mon Aug 12, 2013 2:12 pm

Re: FFMpeg command + Subtitles won't work from within Servii

Got the same error when removing the space:

  Code:
2013-08-12 16:03:49,559 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: /media/SSD/Movies/Magdalena/TwilightSaga/Twilight/Twilight.2008.avi
2013-08-12 16:03:49,560 DEBUG [ProcessExecutor] Starting /home/martin/.myprograms/serviio/bin/ffmpeg -threads 4 -i /media/SSD/Movies/Magdalena/TwilightSaga/Twilight/Twilight.2008.avi -y -threads 4 -c:v mpeg2video -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -vf pad=656:369:0:52:black,setdar=4:3,subtitles=filename="/media/SSD/Movies/Magdalena/TwilightSaga/Twilight/Twilight.2008.srt":original_size=656x264:charenc=UTF-8 -r 24000/1001 -g 15 -c:a ac3 -b:a 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-473-sony2010-ORIGINAL-886d598d77faaf28e1997876182a310a.stf
2013-08-12 16:03:49,614 WARN  [ProcessExecutor] Process /home/martin/.myprograms/serviio/bin/ffmpeg has a return code of 1! This is a possible error. Detailed output follows.
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 96 kb/s
[Parsed_setdar_1 @ 0x1d66d40] num:den syntax is deprecated, please use num/den or named options instead
[Parsed_subtitles_2 @ 0x1d68080] Unable to open "/media/SSD/Movies/Magdalena/TwilightSaga/Twilight/Twilight.2008.srt"
[AVFilterGraph @ 0x1d82fe0] Error initializing filter 'subtitles' with args 'filename="/media/SSD/Movies/Magdalena/TwilightSaga/Twilight/Twilight.2008.srt":original_size=656x264:charenc=UTF-8'
Error opening filters!
2013-08-12 16:03:49,614 DEBUG [TranscodingJobListener] Transcoding finished; successful: false
2013-08-12 16:03:59,571 DEBUG [TranscodingJobListener] Deleted temp file '/tmp/Serviio/transcoding-temp-473-sony2010-ORIGINAL-886d598d77faaf28e1997876182a310a.stf': true


Executing the command from terminal works. Only terminated with my Ctrl-C:
  Code:
martin@desktop:~/.myprograms/serviio/log$ /home/martin/.myprograms/serviio/bin/ffmpeg -threads 4 -i /media/SSD/Movies/Magdalena/TwilightSaga/Twilight/Twilight.2008.avi -y -threads 4 -c:v mpeg2video -b:v 17000k -maxrate:v 17000k -bufsize:v 17000k -vf pad=656:369:0:52:black,setdar=4:3,subtitles=filename="/media/SSD/Movies/Magdalena/TwilightSaga/Twilight/Twilight.2008.srt":original_size=656x264:charenc=UTF-8 -r 24000/1001 -g 15 -c:a ac3 -b:a 384k -ac 2 -map 0:0 -map 0:1 -sn -f mpegts /tmp/Serviio/transcoding-temp-473-sony2010-ORIGINAL-886d598d77faaf28e1997876182a310a.stf
ffmpeg version 1.1.git Copyright (c) 2000-2013 the FFmpeg developers
  built on Aug  9 2013 17:19:32 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
  configuration: --prefix=/home/martin/.myprograms/serviio/bin/src/ffmpeg --extra-cflags=-I/home/martin/.myprograms/serviio/bin/src/ffmpeg/include --extra-ldflags=-L/home/martin/.myprograms/serviio/bin/src/ffmpeg/lib --bindir=/home/martin/.myprograms/serviio/bin/src/ffmpeg/bin --extra-libs=-ldl --enable-gpl --enable-libass --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-nonfree --enable-x11grab
  libavutil      52. 37.101 / 52. 37.101
  libavcodec     55. 16.100 / 55. 16.100
  libavformat    55.  9.100 / 55.  9.100
  libavdevice    55.  2.100 / 55.  2.100
  libavfilter     3. 77.101 /  3. 77.101
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  3.100 / 52.  3.100
[avi @ 0x1b97360] non-interleaved AVI
Input #0, avi, from '/media/SSD/Movies/Magdalena/TwilightSaga/Twilight/Twilight.2008.avi':
  Metadata:
    encoder         : VirtualDubMod 1.5.10.1 (build 2366/release)
  Duration: 02:01:50.06, start: 0.000000, bitrate: 804 kb/s
    Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (DX50 / 0x30355844), yuv420p, 656x264 [SAR 1:1 DAR 82:33], 23.98 tbr, 23.98 tbn, 23.98 tbc
    Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 96 kb/s
[Parsed_setdar_1 @ 0x1b82160] num:den syntax is deprecated, please use num/den or named options instead
[mpeg2video @ 0x1b9f200] impossible bitrate constraints, this will fail
Output #0, mpegts, to '/tmp/Serviio/transcoding-temp-473-sony2010-ORIGINAL-886d598d77faaf28e1997876182a310a.stf':
  Metadata:
    encoder         : Lavf55.9.100
    Stream #0:0: Video: mpeg2video, yuv420p, 656x368 [SAR 92:123 DAR 4:3], q=2-31, 17000 kb/s, 90k tbn, 23.98 tbc
    Stream #0:1: Audio: ac3, 48000 Hz, stereo, fltp, 384 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 -> mpeg2video)
  Stream #0:1 -> #0:1 (mp3 -> ac3)
Press [q] to stop, [?] for help
[Parsed_subtitles_2 @ 0x1b834a0] Neither PlayResX nor PlayResY defined. Assuming 384x288
frame= 6524 fps=257 q=2.0 Lsize=   98014kB time=00:04:32.18 bitrate=2949.9kbits/s dup=1 drop=0   
video:76361kB audio:12759kB subtitle:0 global headers:0kB muxing overhead 9.979820%
Received signal 2: terminating.
<<

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 8:42 pm

Re: FFMpeg command + Subtitles won't work from within Servii

Are you sure it's using the right ffmpeg binary? If you have multiple, you can give Serviio the required one by adding system property ffmpeg.location

http://www.serviio.org/index.php?option ... icle&id=43
<<

FoH

Streaming enthusiast

Posts: 40

Joined: Fri Jan 06, 2012 5:14 pm

Post Mon Aug 12, 2013 11:43 pm

Re: FFMpeg command + Subtitles won't work from within Servii

That's what I've done :) As you can see from the log posted, the path to ffmpeg is absolute, and the binary is in Serviios bin folder. I used this technique with 1.2.1 and another compiled ffmpeg, which worked fine.

If I use the ffmpeg binary that comes with the distribution, it actually fails in terminal as well (doesn't support subtitles at all, it seems). So yeah, it's using the right binary but I'm not sure if it uses some external libraries. But then I don't understand why the command executed from Serviio fails. How does the shell command given from a Java environment differ from the actual OS environment? Is the ffmpeg command given launching another command for the subs that might not get the required privileges?
<<

bartek_75

Serviio newbie

Posts: 6

Joined: Sun Dec 30, 2012 5:09 pm

Post Tue Aug 13, 2013 7:00 pm

Re: FFMpeg command + Subtitles won't work from within Servii

Have you found the solution?

I have the exact same problem. Movie played on TV, plays fine and the subtitles work (TV is capable of displaying external subtitles). When i try to play it on PS3 it fails with the same error as yours
Delivering item '11871' for client 'Identifier=192.168.2.91, Profile=Playstation 3'
2013-08-13 20:48:10,417 DEBUG [MediaItemDAOImpl] Getting file of media item 11871
2013-08-13 20:48:10,417 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Godfather_Trilogy/Godfather_part_II.srt
2013-08-13 20:48:10,418 DEBUG [MediaItemDAOImpl] Getting file of media item 11871
2013-08-13 20:48:10,418 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Godfather_Trilogy/Godfather_part_II.srt
2013-08-13 20:48:10,418 DEBUG [VideoDeliveryEngine] Delivering file 'Godfather_part_II.avi' using transcoding
2013-08-13 20:48:10,418 DEBUG [MediaItemDAOImpl] Getting file of media item 11871
2013-08-13 20:48:10,418 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Godfather_Trilogy/Godfather_part_II.srt
2013-08-13 20:48:10,418 DEBUG [AbstractTranscodingDeliveryEngine] No suitable transcoding job exists yet, start one for client 'Identifier=192.168.2.91, Profile=Playstation 3'
2013-08-13 20:48:10,418 DEBUG [MediaItemDAOImpl] Getting file of media item 11871
2013-08-13 20:48:10,419 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: /multimedia/filmy/Godfather_Trilogy/Godfather_part_II.avi
2013-08-13 20:48:10,419 DEBUG [ProcessExecutor] Starting ffmpeg -threads 2 -i /multimedia/filmy/Godfather_Trilogy/Godfather_part_II.avi -y -threads 2 -c:v mpeg2video -qscale:v 1 -vf subtitles=filename="/multimedia/filmy/Godfather_Trilogy/Godfather_part_II.srt":original_size=720x416:charenc=UTF-8 -r 25 -g 15 -c:a ac3 -b:a 384k -ac 2 -map 0:0 -map 0:1 -sn -f vob /tmp/Serviio/transcoding-temp-11871-4-ORIGINAL-384f351b14770a8e85e08de004f67fb8.stf
2013-08-13 20:48:10,884 WARN [ProcessExecutor] Process ffmpeg has a return code of 1! This is a possible error. Detailed output follows.
Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 720x416 [SAR 1:1 DAR 45:26], 25 tbr, 25 tbn, 25 tbc
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 48000 Hz, stereo, s16p, 140 kb/s
[Parsed_subtitles_0 @ 0x35da160] Unable to open "/multimedia/filmy/Godfather_Trilogy/Godfather_part_II.srt"
[AVFilterGraph @ 0x35fc220] Error initializing filter 'subtitles' with args 'filename="/multimedia/filmy/Godfather_Trilogy/Godfather_part_II.srt":original_size=720x416:charenc=UTF-8'
Error opening filters!


ffmpeg info
ffmpeg version git-2013-08-12-53f309c Copyright (c) 2000-2013 the FFmpeg developers
built on Aug 12 2013 20:27:06 with gcc 4.7 (Ubuntu/Linaro 4.7.2-2ubuntu1)
configuration: --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
libavutil 52. 42.100 / 52. 42.100
libavcodec 55. 27.100 / 55. 27.100
libavformat 55. 13.102 / 55. 13.102
libavdevice 55. 3.100 / 55. 3.100
libavfilter 3. 82.100 / 3. 82.100
libswscale 2. 4.100 / 2. 4.100
libswresample 0. 17.103 / 0. 17.103
libpostproc 52. 3.100 / 52. 3.100


But when invoking ffmpeg from command line there are errors:
  Code:
 Unable to recode subtitle event "www.NapiProjekt.pl - nowa jako▒▒ napis▒w.
Napisy zosta▒y specjalnie dopasowane do Twojej wersji filmu." from UTF-8 to UTF-8
[Parsed_subtitles_0 @ 0x2e1e160] Error decoding: Invalid or incomplete multibyte or wide character (ignored)
[AVFilterGraph @ 0x2e40220] Error initializing filter 'subtitles' with args 'filename=/multimedia/filmy/Godfather_Trilogy/Godfather_part_II.srt:original_size=720x416:charenc=UTF-8'
Error opening filters!

Subtitles are in UTF-8, and play just fine on TV set

Regards
LG 42LS570S
<<

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 7:32 pm

Re: FFMpeg command + Subtitles won't work from within Servii

bartek_75 wrote:Have you found the solution?

I have the exact same problem. Movie played on TV, plays fine and the subtitles work (TV is capable of displaying external subtitles). When i try to play it on PS3 it fails with the same error as yours

Can you try to remove :charenc=UTF-8 from the command line and run it manually again? If it works, does it render the special characters correctly on the video?
<<

bartek_75

Serviio newbie

Posts: 6

Joined: Sun Dec 30, 2012 5:09 pm

Post Wed Aug 14, 2013 7:13 pm

Re: FFMpeg command + Subtitles won't work from within Servii

I switched to another movie. There is the same error. But running ffmpeg from command line is successfull. It produced file /tmp/serviio/transcoding-temp-268-4-ORIGINAL-913355c862c916ad9b22c2b4e5ebfa34.stf . It has subtitles.

Log from serviio:
  Code:
Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-08-14 20:52:02,893 DEBUG [AbstractTranscodingDeliveryEngine] No suitable transcoding job exists yet, start one for client 'Identifier=192.168.2.91, Profile=Playstation 3'
2013-08-14 20:52:02,893 DEBUG [MediaItemDAOImpl] Getting file of media item 268
2013-08-14 20:52:02,893 DEBUG [FFMPEGWrapper] Invoking FFmpeg to transcode video file: /multimedia/filmy/Aliens/Aliens.avi
2013-08-14 20:52:02,893 DEBUG [ProcessExecutor] Starting ffmpeg -threads 2 -i /multimedia/filmy/Aliens/Aliens.avi -y -threads 2 -c:v mpeg2video -qscale:v 1 -vf subtitles=filename="/multimedia/filmy/Aliens/Aliens.srt":original_size=576x288:charenc=UTF-8 -r 25 -g 15 -c:a ac3 -b:a 384k -ar 48000 -ac 2 -map 0:0 -map 0:1 -sn -f vob /tmp/Serviio/transcoding-temp-268-4-ORIGINAL-913355c862c916ad9b22c2b4e5ebfa34.stf
2013-08-14 20:52:03,090 WARN  [ProcessExecutor] Process ffmpeg has a return code of 1! This is a possible error. Detailed output follows.
Stream #0:0: Video: msmpeg4v3 (DIV3 / 0x33564944), yuv420p, 576x288, 25 tbr, 25 tbn, 25 tbc
Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 24000 Hz, stereo, s16p, 64 kb/s
[Parsed_subtitles_0 @ 0x1a9a8a0] Unable to open "/multimedia/filmy/Aliens/Aliens.srt"
[AVFilterGraph @ 0x1ac8940] Error initializing filter 'subtitles' with args 'filename="/multimedia/filmy/Aliens/Aliens.srt":original_size=576x288:charenc=UTF-8'
Error opening filters!
2013-08-14 20:52:03,090 DEBUG [TranscodingJobListener] Transcoding finished; successful: false
LG 42LS570S
<<

FoH

Streaming enthusiast

Posts: 40

Joined: Fri Jan 06, 2012 5:14 pm

Post Sun Aug 18, 2013 2:39 pm

Re: FFMpeg command + Subtitles won't work from within Servii

Downloaded and installed version 1.3.1 and subtitles seems to work now :) I used the same ffmpeg binary as before.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Aug 18, 2013 2:49 pm

Re: [SOLVED] FFMpeg command + Subtitles won't work

cool
<<

bartek_75

Serviio newbie

Posts: 6

Joined: Sun Dec 30, 2012 5:09 pm

Post Sun Sep 08, 2013 9:35 am

Re: [SOLVED] FFMpeg command + Subtitles won't work

Hi, upgrading to 1.3.1 solved the problem , sort of. Playing files on PS3 works when i switch profile to Generic DLNA, here is the log:
  Code:
2013-09-08 11:23:19,860 DEBUG [ServiioHttpService] Incoming request from /192.168.2.91:53402: GET /resource/298/MEDIA_ITEM/MPEG_PS_PAL-0/ORIGINAL HTTP/1.1, headers = [Host: 192.168.2.10:8895,User-Agent: PLAYSTATION 3,Connection: Keep-Alive,Accept-Encoding: identity,transferMode.dlna.org: Streaming,X-AV-Client-Info: av=5.0; cn="Sony Computer Entertainment"; mn="PLAYSTATION 3"; mv="1.0";,TimeSeekRange.dlna.org: npt=0.000-]]
2013-09-08 11:23:19,861 DEBUG [RendererDAOImpl] Reading a Renderer with ip address 192.168.2.91
2013-09-08 11:23:19,861 DEBUG [RendererDAOImpl] Reading a Renderer with ip address 192.168.2.91
2013-09-08 11:23:19,861 DEBUG [ResourceDeliveryProcessor] Resource request accepted. Using client 'Identifier=192.168.2.91, Profile=Generic DLNA profile'
2013-09-08 11:23:19,861 DEBUG [ResourceDeliveryProcessor] Request for resource 298 and type 'MEDIA_ITEM' received
2013-09-08 11:23:19,861 DEBUG [MediaResourceRetrievalStrategy] Getting information about media item 298 (local)
2013-09-08 11:23:19,861 DEBUG [MediaItemDAOImpl] Reading a MediaItem (id = 298)
2013-09-08 11:23:19,867 DEBUG [VideoDAOImpl] Reading a Video (id = 298)
2013-09-08 11:23:19,874 DEBUG [VideoDeliveryEngine] Retrieving resource information for item 298, format MPEG_PS_PAL and profile Generic DLNA profile
2013-09-08 11:23:19,874 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:23:19,878 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:23:19,879 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:23:19,879 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:23:19,879 DEBUG [AbstractTranscodingDeliveryEngine] Getting media info for transcoded version of file Aliens.avi
2013-09-08 11:23:19,879 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:23:19,879 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:23:19,879 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file Aliens.avi: MPEG_PS_PAL
2013-09-08 11:23:19,879 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file Aliens.avi: MPEG_PS_NTSC
2013-09-08 11:23:19,880 DEBUG [MediaResourceRetrievalStrategy] Getting information about media item 298 (local)
2013-09-08 11:23:19,880 DEBUG [MediaItemDAOImpl] Reading a MediaItem (id = 298)
2013-09-08 11:23:19,880 DEBUG [VideoDAOImpl] Reading a Video (id = 298)
2013-09-08 11:23:19,880 DEBUG [VideoDeliveryEngine] Delivering item '298' for client 'Identifier=192.168.2.91, Profile=Generic DLNA profile'
2013-09-08 11:23:19,880 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:23:19,880 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:23:19,881 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:23:19,881 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:23:19,881 DEBUG [VideoDeliveryEngine] Delivering file 'Aliens.avi' using transcoding
2013-09-08 11:23:19,881 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:23:19,881 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:23:19,882 DEBUG [AbstractTranscodingDeliveryEngine] A suitable transcoding job already exists, re-use it for client 'Identifier=192.168.2.91, Profile=Generic DLNA profile'
2013-09-08 11:23:19,882 DEBUG [FileBasedTranscodingDeliveryStrategy] Transcoded file '/tmp/Serviio/transcoding-temp-298-1-ORIGINAL-913355c862c916ad9b22c2b4e5ebfa34.stf' is complete, sending simple stream
2013-09-08 11:23:19,882 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:23:19,882 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:23:19,882 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file Aliens.avi: MPEG_PS_PAL
2013-09-08 11:23:19,883 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file Aliens.avi: MPEG_PS_NTSC
2013-09-08 11:23:19,883 DEBUG [MediaItemDAOImpl] Marking MediaItem (id = 298) as read
2013-09-08 11:23:19,906 DEBUG [LocalContentCacheDecorator] Cleared cache (local_resetafterplay)
2013-09-08 11:23:19,907 DEBUG [GETMethodProcessor] Stream entity has length: 2303543296
2013-09-08 11:23:19,907 DEBUG [ResourceTransportRequestHandler] Creating entity with chunked transfer
2013-09-08 11:23:19,907 DEBUG [ResourceTransportRequestHandler] HTTP/1.1 200 OK, headers = [[Content-Type: video/mpeg,Date: Sun, 08 Sep 2013 09:23:19 GMT,Server: Linux, UPnP/1.0 DLNADOC/1.50, Serviio/1.3.1,Cache-control: no-cache,TimeSeekRange.dlna.org: npt=0-8730/8730,transferMode.dlna.org: Streaming,realTimeInfo.dlna.org: DLNA.ORG_TLAG=*]]
2013-09-08 11:23:19,913 DEBUG [LocalContentCacheDecorator] Stored entry in the cache (local_default), returning it
2013-09-08 11:23:19,920 DEBUG [ServiceControlRequestHandler] Returning OK SOAP message


Setting the profile to Playstation 3 gives an error "500 Bad request", log:
  Code:
2013-09-08 11:03:44,161 DEBUG [ServiioHttpService] Incoming request from /192.168.2.91:53727: GET /resource/298/MEDIA_ITEM/AVI-0/ORIGINAL HTTP/1.1, headers = [Host: 192.168.2.10:8895,User-Agent: PLAYSTATION 3,Connection: Keep-Alive,Accept-Encoding: identity,transferMode.dlna.org: Streaming,X-AV-Client-Info: av=5.0; cn="Sony Computer Entertainment"; mn="PLAYSTATION 3"; mv="1.0";,Range: bytes=0-]]
2013-09-08 11:03:44,161 DEBUG [RendererDAOImpl] Reading a Renderer with ip address 192.168.2.91
2013-09-08 11:03:44,162 DEBUG [RendererDAOImpl] Reading a Renderer with ip address 192.168.2.91
2013-09-08 11:03:44,162 DEBUG [ResourceDeliveryProcessor] Resource request accepted. Using client 'Identifier=192.168.2.91, Profile=Playstation 3'
2013-09-08 11:03:44,162 DEBUG [ResourceDeliveryProcessor] Request for resource 298 and type 'MEDIA_ITEM' received
2013-09-08 11:03:44,162 DEBUG [MediaResourceRetrievalStrategy] Getting information about media item 298 (local)
2013-09-08 11:03:44,162 DEBUG [MediaItemDAOImpl] Reading a MediaItem (id = 298)
2013-09-08 11:03:44,163 DEBUG [VideoDAOImpl] Reading a Video (id = 298)
2013-09-08 11:03:44,163 DEBUG [VideoDeliveryEngine] Retrieving resource information for item 298, format AVI and profile Playstation 3
2013-09-08 11:03:44,163 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:03:44,164 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:03:44,164 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:03:44,165 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:03:44,165 DEBUG [AbstractTranscodingDeliveryEngine] Getting media info for transcoded version of file Aliens.avi
2013-09-08 11:03:44,165 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:03:44,165 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:03:44,166 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file Aliens.avi: MPEG_PS_PAL
2013-09-08 11:03:44,166 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file Aliens.avi: MPEG_PS_NTSC
2013-09-08 11:03:44,166 WARN  [ResourceDeliveryProcessor] Invalid request, sending back 500 error
org.serviio.dlna.UnsupportedDLNAMediaFileFormatException: No media description available for required version: AVI
   at org.serviio.delivery.resource.AbstractDeliveryEngine.findMediaInfoForFileProfile(AbstractDeliveryEngine.java:292)
   at org.serviio.delivery.resource.transcode.AbstractTranscodingDeliveryEngine.retrieveTranscodedMediaInfoForVersion(AbstractTranscodingDeliveryEngine.java:158)
   at org.serviio.delivery.resource.AbstractDeliveryEngine.getMediaInfoForMediaItem(AbstractDeliveryEngine.java:124)
   at org.serviio.delivery.MediaResourceRetrievalStrategy.retrieveResourceInfo(MediaResourceRetrievalStrategy.java:181)
   at org.serviio.delivery.ResourceDeliveryProcessor.deliverContent(ResourceDeliveryProcessor.java:80)
   at org.serviio.upnp.webserver.ResourceTransportRequestHandler.handleRequest(ResourceTransportRequestHandler.java:86)
   at org.serviio.upnp.webserver.AbstractRequestHandler.handle(AbstractRequestHandler.java:61)
   at org.apache.http.protocol.HttpService.doService(HttpService.java:293)
   at org.serviio.upnp.webserver.ServiioHttpService.doService(ServiioHttpService.java:77)
   at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:212)
   at org.serviio.upnp.webserver.WebServer$WorkerThread.run(WebServer.java:192)
2013-09-08 11:03:44,181 DEBUG [ServiioHttpService] Incoming request from /192.168.2.91:53726: GET /resource/298/MEDIA_ITEM/AVI-0/ORIGINAL HTTP/1.1, headers = [Host: 192.168.2.10:8895,User-Agent: PLAYSTATION 3,Connection: Keep-Alive,Accept-Encoding: identity,transferMode.dlna.org: Streaming,X-AV-Client-Info: av=5.0; cn="Sony Computer Entertainment"; mn="PLAYSTATION 3"; mv="1.0";,Range: bytes=0-]]
2013-09-08 11:03:44,181 DEBUG [RendererDAOImpl] Reading a Renderer with ip address 192.168.2.91
2013-09-08 11:03:44,182 DEBUG [RendererDAOImpl] Reading a Renderer with ip address 192.168.2.91
2013-09-08 11:03:44,182 DEBUG [ResourceDeliveryProcessor] Resource request accepted. Using client 'Identifier=192.168.2.91, Profile=Playstation 3'
2013-09-08 11:03:44,182 DEBUG [ResourceDeliveryProcessor] Request for resource 298 and type 'MEDIA_ITEM' received
2013-09-08 11:03:44,182 DEBUG [MediaResourceRetrievalStrategy] Getting information about media item 298 (local)
2013-09-08 11:03:44,182 DEBUG [MediaItemDAOImpl] Reading a MediaItem (id = 298)
2013-09-08 11:03:44,182 DEBUG [VideoDAOImpl] Reading a Video (id = 298)
2013-09-08 11:03:44,182 DEBUG [VideoDeliveryEngine] Retrieving resource information for item 298, format AVI and profile Playstation 3
2013-09-08 11:03:44,182 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:03:44,183 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:03:44,183 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:03:44,184 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:03:44,184 DEBUG [AbstractTranscodingDeliveryEngine] Getting media info for transcoded version of file Aliens.avi
2013-09-08 11:03:44,184 DEBUG [MediaItemDAOImpl] Getting file of media item 298
2013-09-08 11:03:44,184 DEBUG [SubtitlesService] Found external subtitle file: /multimedia/filmy/Aliens/Aliens.srt
2013-09-08 11:03:44,184 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file Aliens.avi: MPEG_PS_PAL
2013-09-08 11:03:44,184 DEBUG [VideoDeliveryEngine] Found Format profile for transcoded file Aliens.avi: MPEG_PS_NTSC
2013-09-08 11:03:44,184 WARN  [ResourceDeliveryProcessor] Invalid request, sending back 500 error
org.serviio.dlna.UnsupportedDLNAMediaFileFormatException: No media description available for required version: AVI
   at org.serviio.delivery.resource.AbstractDeliveryEngine.findMediaInfoForFileProfile(AbstractDeliveryEngine.java:292)
   at org.serviio.delivery.resource.transcode.AbstractTranscodingDeliveryEngine.retrieveTranscodedMediaInfoForVersion(AbstractTranscodingDeliveryEngine.java:158)
   at org.serviio.delivery.resource.AbstractDeliveryEngine.getMediaInfoForMediaItem(AbstractDeliveryEngine.java:124)
   at org.serviio.delivery.MediaResourceRetrievalStrategy.retrieveResourceInfo(MediaResourceRetrievalStrategy.java:181)
   at org.serviio.delivery.ResourceDeliveryProcessor.deliverContent(ResourceDeliveryProcessor.java:80)
   at org.serviio.upnp.webserver.ResourceTransportRequestHandler.handleRequest(ResourceTransportRequestHandler.java:86)
   at org.serviio.upnp.webserver.AbstractRequestHandler.handle(AbstractRequestHandler.java:61)
   at org.apache.http.protocol.HttpService.doService(HttpService.java:293)
   at org.serviio.upnp.webserver.ServiioHttpService.doService(ServiioHttpService.java:77)
   at org.apache.http.protocol.HttpService.handleRequest(HttpService.java:212)
   at org.serviio.upnp.webserver.WebServer$WorkerThread.run(WebServer.java:192)


It looks like Playstation 3 profile is broken. Are there any disadvantages of using Generic DLNA profile for PS3?

Best regards.
LG 42LS570S
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 17215

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Sun Sep 08, 2013 6:47 pm

Re: [SOLVED] FFMpeg command + Subtitles won't work

It looks like the device you are using caches the media URLs and is trying to access a Generic profile's file via PS3 profile. You will have to somehow remove the player's cache.

Return to Serviio Support & Help

Who is online

Users browsing this forum: No registered users and 66 guests

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