Playback only begins after I run 'killall ffmpeg'
I have tried with four separate clients.. my BlackBerry 10 app using its native media player and VLC on my local machine. I have also tried in both Firefox and Chrome.
I am trancoding to x264 inside an MP4 container. If a video is small enough say about 4 or 5 minutes in length, the clients will begin to play in about 15 or so seconds.. however If I try to transcode a movie say 2 hours in length, then it wont. I have to manually kill the ffmpeg process thats running, which then causes the client to make a third range request which then for some reason begins to play perfectly.
Here is the first two requests before I run killall ffmpeg..
At this point all clients have a black screen.. but if I run killall ffmpeg from the cli, a third range request is made by each client automatically.. this time the range is different
once this happens.. the video begins to play perfectly in each of the clients.
interestingly enough.. if I transcode to Matroska, the browsers and each of the clients begin to play perfectly almost immediately. and even more weird.. heres the output for transcoding to mkv
my transcode steps
MP4 (Fragmented)
Matroska
It seems to me as though the ffmpeg process that is running before I run killall is running and piping to stdout even though the client has already disconnected ?
if anyone wants to test the streams themselves.. i can provide the urls via pm.
cheers
I am trancoding to x264 inside an MP4 container. If a video is small enough say about 4 or 5 minutes in length, the clients will begin to play in about 15 or so seconds.. however If I try to transcode a movie say 2 hours in length, then it wont. I have to manually kill the ffmpeg process thats running, which then causes the client to make a third range request which then for some reason begins to play perfectly.
Here is the first two requests before I run killall ffmpeg..
- Code: Select all
[2013-08-15 06:13:52,603] INFO StreamController - Got range: Range[0,9223372036854775807]
[2013-08-15 06:13:52,603] INFO PlayQueueInputStream - guest listening to "Billy.Madison.1995/billy.madison.1995.dvdrip.xvid.particle.avi"
[2013-08-15 06:13:52,605] DEBUG TranscodeInputStream - Starting transcoder: [/var/subsonic/transcode/ffmpeg] [-y] [-ss] [0] [-i] [/media/raidone/Media/Movies/SD/Billy.Madison.1995/billy.madison.1995.dvdrip.xvid.particle.avi] [-async] [1] [-f] [mp4] [-avioflags] [direct] [-fflags] [nobuffer] [-vsync] [1] [-rtbufsize] [1M] [-g] [25] [-sc_threshold] [0] [-analyzeduration] [0] [-threads] [0] [-acodec] [libfdk_aac] [-b:a] [96k] [-ac] [2] [-vcodec] [libx264] [-preset] [medium] [-profile:v] [high] [-b:v] [1000k] [-s] [1280x720] [-movflags] [frag_keyframe+empty_moov] [-loglevel] [quiet] [-]
[2013-08-15 06:13:53,333] INFO StreamController - Got range: Range[673874996,9223372036854775807]
[2013-08-15 06:13:53,333] INFO PlayQueueInputStream - guest listening to "Billy.Madison.1995/billy.madison.1995.dvdrip.xvid.particle.avi"
[2013-08-15 06:13:53,334] DEBUG TranscodeInputStream - Starting transcoder: [/var/subsonic/transcode/ffmpeg] [-y] [-ss] [0] [-i] [/media/raidone/Media/Movies/SD/Billy.Madison.1995/billy.madison.1995.dvdrip.xvid.particle.avi] [-async] [1] [-f] [mp4] [-avioflags] [direct] [-fflags] [nobuffer] [-vsync] [1] [-rtbufsize] [1M] [-g] [25] [-sc_threshold] [0] [-analyzeduration] [0] [-threads] [0] [-acodec] [libfdk_aac] [-b:a] [96k] [-ac] [2] [-vcodec] [libx264] [-preset] [medium] [-profile:v] [high] [-b:v] [1000k] [-s] [1280x720] [-movflags] [frag_keyframe+empty_moov] [-loglevel] [quiet] [-]
[2013-08-15 06:13:54,180] WARN RESTFilter - Error in REST API: EofException
org.mortbay.jetty.EofException
at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:760)
...
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcher.write0(Native Method)
---
at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:693)
... 68 more
At this point all clients have a black screen.. but if I run killall ffmpeg from the cli, a third range request is made by each client automatically.. this time the range is different
- Code: Select all
[2013-08-15 06:17:47,043] INFO StreamController - Got range: Range[1237,9223372036854775807]
[2013-08-15 06:17:47,043] INFO PlayQueueInputStream - guest listening to "Billy.Madison.1995/billy.madison.1995.dvdrip.xvid.particle.avi"
[2013-08-15 06:17:47,045] DEBUG TranscodeInputStream - Starting transcoder: [/var/subsonic/transcode/ffmpeg] [-y] [-ss] [0] [-i] [/media/raidone/Media/Movies/SD/Billy.Madison.1995/billy.madison.1995.dvdrip.xvid.particle.avi] [-async] [1] [-f] [mp4] [-avioflags] [direct] [-fflags] [nobuffer] [-vsync] [1] [-rtbufsize] [1M] [-g] [25] [-sc_threshold] [0] [-analyzeduration] [0] [-threads] [0] [-acodec] [libfdk_aac] [-b:a] [96k] [-ac] [2] [-vcodec] [libx264] [-preset] [medium] [-profile:v] [high] [-b:v] [1000k] [-s] [1280x720] [-movflags] [frag_keyframe+empty_moov] [-loglevel] [quiet] [-]
once this happens.. the video begins to play perfectly in each of the clients.
interestingly enough.. if I transcode to Matroska, the browsers and each of the clients begin to play perfectly almost immediately. and even more weird.. heres the output for transcoding to mkv
- Code: Select all
[2013-08-15 07:11:02,013] INFO PlayQueueInputStream - guest listening to "Finding.Nemo.2003/failed-fn.dvdrip.xvid.repack.avi"
[2013-08-15 07:11:02,014] DEBUG TranscodeInputStream - Starting transcoder: [/var/subsonic/transcode/ffmpeg] [-y] [-ss] [0] [-i] [/media/raidone/Media/Movies/SD/Finding.Nemo.2003/failed-fn.dvdrip.xvid.repack.avi] [-async] [1] [-f] [matroska] [-avioflags] [direct] [-fflags] [nobuffer] [-vsync] [1] [-rtbufsize] [1M] [-g] [25] [-sc_threshold] [0] [-analyzeduration] [0] [-threads] [0] [-acodec] [libfdk_aac] [-b:a] [96k] [-ac] [2] [-vcodec] [libx264] [-preset] [medium] [-profile:v] [high] [-b:v] [1000k] [-s] [1280x720] [-loglevel] [quiet] [-]
[2013-08-15 07:11:02,330] INFO StreamController - Got range: Range[0,9223372036854775807]
[2013-08-15 07:11:02,330] INFO PlayQueueInputStream - guest listening to "Finding.Nemo.2003/failed-fn.dvdrip.xvid.repack.avi"
[2013-08-15 07:11:02,331] DEBUG TranscodeInputStream - Starting transcoder: [/var/subsonic/transcode/ffmpeg] [-y] [-ss] [0] [-i] [/media/raidone/Media/Movies/SD/Finding.Nemo.2003/failed-fn.dvdrip.xvid.repack.avi] [-async] [1] [-f] [matroska] [-avioflags] [direct] [-fflags] [nobuffer] [-vsync] [1] [-rtbufsize] [1M] [-g] [25] [-sc_threshold] [0] [-analyzeduration] [0] [-threads] [0] [-acodec] [libfdk_aac] [-b:a] [96k] [-ac] [2] [-vcodec] [libx264] [-preset] [medium] [-profile:v] [high] [-b:v] [1000k] [-s] [1280x720] [-loglevel] [quiet] [-]
[2013-08-15 07:11:02,616] WARN RESTFilter - Error in REST API: EofException
org.mortbay.jetty.EofException
at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:760)
---
at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)
Caused by: java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcher.write0(Native Method)
---
at org.mortbay.jetty.HttpGenerator.flush(HttpGenerator.java:693)
... 67 more
my transcode steps
MP4 (Fragmented)
- Code: Select all
ffmpeg -y -ss %o -i %s -async 1 -f mp4 -avioflags direct -fflags nobuffer -vsync 1 -rtbufsize 1M -g 25 -sc_threshold 0 -analyzeduration 0 -threads 0 -acodec libfdk_aac -b:a 96k -ac 2 -vcodec libx264 -preset medium -profile:v high -b:v %bk -s %wx%h -movflags frag_keyframe+empty_moov -loglevel quiet -
Matroska
- Code: Select all
ffmpeg -y -ss %o -i %s -async 1 -f matroska -avioflags direct -fflags nobuffer -vsync 1 -rtbufsize 1M -g 25 -sc_threshold 0 -analyzeduration 0 -threads 0 -acodec libfdk_aac -b:a 96k -ac 2 -vcodec libx264 -preset medium -profile:v high -b:v %bk -s %wx%h -loglevel quiet -
It seems to me as though the ffmpeg process that is running before I run killall is running and piping to stdout even though the client has already disconnected ?
if anyone wants to test the streams themselves.. i can provide the urls via pm.
cheers