Cannot seek in videos (web player)

Need help? Post your questions here.

Moderator: moderators

Cannot seek in videos (web player)

Postby Knetic » Mon Dec 31, 2012 1:19 am

I'm running debian, on a little media/miscelleneous headless server. I recently put Subsonic (the war version) through Tomcat, and have had a pretty good time using it, and it works perfectly for music.

However, with any format of video and any codec, it doesn't supporting seeking. I can change the bit rate with no problem, and the video actually plays fine, but i can't seek either with the JWPlayer bar, or the little dropdown keyframe box (it only lists 0:00, no others). Whenever i try to seek, it just restarts the video. Every video shows a current/total time of "NaN:NaN".

I should note that with something like VLC or WMP, there's no problems seeking. All the videos work fine, it's just JWPlayer that won't seek.

My relevant transcoder settings (the flac one is, predictably, for flac).

Code: Select all
mp3 audio (recommended)
ffmpeg -i %s -ab %bk -v 0 -f mp3 -

flv/h264
ffmpeg -i %s -ss %o -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset superfast -threads 0 -g 1 -

flac
ffmpeg -i %s -v 0 -f wav -
lame -b %b --tt %t --ta %a --tl %l -S --resample 44.1 - -


Stock install from the subsonic site as of about a day ago. Version info is:

Code: Select all
4.7 (build 3105) – September 11, 2012
Apache Tomcat/6.0.35, java 1.6.0_18

Does anyone have any ideas?
Knetic
 
Posts: 5
Joined: Mon Dec 31, 2012 1:06 am

Re: Cannot seek in videos (web player)

Postby GJ51 » Mon Dec 31, 2012 8:39 am

Video not seeking is usually a problem with the original video encoding. Mp4 files routinely put the index atom at the end of the file which means that seeking won't work until the file has fimished transcoding. Ther's a utility for mp4 called QTIndexSwapper2 that will modify the file and put the index info up front.

I've also found that not all versions of ffmpeg are created equal. I keep several older versions that I know work better with certain transcoding that some of the newer releases.

Then as you already know, there are tons of settings that can be modified in the transcoding string.

NaN just means "Not a Number" so either the info isn't in the source file or ffmpeg isn't passing the info properly during the transcode.

ffmpeg -ss %o -i %s -async 1 -b %bk -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset superfast -threads 0 -

and

ffmpeg -ss %o -i %s -async 30 -b %bk -r 23-.976 -s %wx%h -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset fast -threads 0 -

are two strings that I frequently use that seem to work well for me. I'm on Windows running the WAR on Tomcat 6.035 and Java 7

Version 4.8.beta2 (build 3292) – December 6, 2012
Server Apache Tomcat/6.0.35, java 1.7.0_05, Windows Server 2008 (92.6 MB / 294.2 MB)
on Madsonic

and

Version 4.7 (build 3105) – September 11, 2012
Server Apache Tomcat/6.0.35, java 1.7.0_07, Windows Server 2008 R2 (106.7 MB / 987.7 MB)

on standard Subsonic

Both play all video formats very well.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: Cannot seek in videos (web player)

Postby Knetic » Mon Dec 31, 2012 9:45 am

Thanks for the reply!

My problem isn't limited to mp4. It occurs with *.mkv and *.avi as well. All video files have this issue, regardless of encoder used. I've got a few dozen test files to mess with, with a good mix of encoders. I'd like to think that at least some of them would be good, if it were an original encoding problem.

But, after looking at the log after trying a few videos, it looks like something is certainly wrong. Every video i try always has a line that looks like:
"Unknown duration for <name of video>. Unable to estimate transcoded size."

But, after doing a -v 1 with ffmpeg (to get more verbose output), i discovered that ffmpeg DOES know the duration, just that subsonic doesn't seem to pick up on it, or tries to pick up on it too early. (see quote below, emphasis mine)

Does subsonic determine video length separately from ffmpeg's determination of video length? Is there a setting or option i need to use to make subsonic use ffmpeg's duration?


[12/31/12 1:16:52 AM PST] WARN StreamController
Unknown duration for aaf-courage.the.cowardly.dog.s02e02.curse.of.shirley. Unable to estimate transcoded size.
[12/31/12 1:16:52 AM PST] INFO PlayQueueInputStream knetic listening to "aaf-courage.the.cowardly.dog.s02e02.curse.of.shirley.avi"
[12/31/12 1:16:52 AM PST] DEBUG TranscodeInputStream Starting transcoder: [/var/subsonic/transcode/ffmpeg] [-ss] [0] [-i] [/t/shared/tv/Courage the Cowardly Dog/aaf-courage.the.cowardly.dog.s02e02.curse.of.shirley.avi] [-async] [30] [-b] [1000k] [-r] [23-.976] [-s] [480x360] [-ar] [44100] [-ac] [2] [-f] [flv] [-vcodec] [libx264] [-preset] [fast] [-threads] [0] [-g] [1] [-]
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) ffmpeg version 0.8.4-6:0.8.4-1, Copyright (c) 2000-2012 the Libav developers
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) built on Oct 22 2012 21:36:00 with gcc 4.7.2
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) *** THIS PROGRAM IS DEPRECATED ***
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) Input #0, avi, from '/t/shared/tv/Courage the Cowardly Dog/aaf-courage.the.cowardly.dog.s02e02.curse.of.shirley.avi':
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) Metadata:
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) encoder : VirtualDubMod 1.5.10.2 (build 2540/release)
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg)
Duration: 00:21:49.28, start: 0.000000, bitrate: 1120 kb/s
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) Stream #0.0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 512x384 [PAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 125 kb/s
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) [buffer @ 0x16c0a60] w:512 h:384 pixfmt:yuv420p
[12/31/12 1:16:52 AM PST] DEBUG InputStreamReaderThread (/var/subsonic/transcode/ffmpeg) [scale @ 0x16bfae0] w:512 h:384 fmt:yuv420p -> w:480 h:360 fmt:yuv420p flags:0x4

Knetic
 
Posts: 5
Joined: Mon Dec 31, 2012 1:06 am

Re: Cannot seek in videos (web player)

Postby GJ51 » Mon Dec 31, 2012 5:02 pm

[2012-12-31 11:38:03,313] INFO PlayQueueInputStream - Dad listening to "AVI\Kung Fu Panda.avi"
[2012-12-31 11:38:03,313] DEBUG TranscodeInputStream - Starting transcoder: [c:\subsonic\transcode\ffmpeg] [-ss] [0] [-i] [\\MAPLEGROVE\Videos\AVI\Kung Fu Panda.avi] [-async] [30] [-b] [1000k] [-r] [23-.976] [-s] [700x292] [-ar] [44100] [-ac] [2] [-v] [0] [-f] [flv] [-vcodec] [libx264] [-preset] [fast] [-threads] [0] [-]
[2012-12-31 11:38:15,465] INFO PlayQueueInputStream - Dad listening to "AVI\Kung Fu Panda.avi"
[2012-12-31 11:38:15,465] DEBUG TranscodeInputStream - Starting transcoder: [c:\subsonic\transcode\ffmpeg] [-ss] [540] [-i] [\\MAPLEGROVE\Videos\AVI\Kung Fu Panda.avi] [-async] [30] [-b] [1000k] [-r] [23-.976] [-s] [700x292] [-ar] [44100] [-ac] [2] [-v] [0] [-f] [flv] [-vcodec] [libx264] [-preset] [fast] [-threads] [0] [-]


I just ran an avi for comparison to see what my log output looked like.

There were track length problems in version 4.6 of Subsonic, and I can't use seeking on the seek bar right away, it takes some time for the transcoding to get ahead of the playback, but the drop down works. Also remember that video transcoding takes a lot of hardware horsepower and takes more time on lower poweres CPU's. My server is on dual quad core Xeon's and it still takes a few minutes to build out the seek bar. Regardless, I'm not seeing errors in my logs like you have.

I also use the latest versions of java and ffmpeg on my system, so I'd recommend making sure you have the latest vesions installed. http://ffmpeg.org/download.html has the latest builds

Are you using ver 4.7?

I also see -g 1 - at the end of your transcode string and I'm not familiar with that switch. Have you tried using either of the strings I've listed? What was the result?

That's about all I can think of - other than I'm on a Windows server.

HTH
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: Cannot seek in videos (web player)

Postby Knetic » Tue Jan 01, 2013 9:38 pm

I did try the transcoding strings you recommended, but they didn't have any noticeable effect. The "-g" switch i stumbled across while googling, i don't recall what it was for, but it hasn't had any effect either.

I'm using the most recent stable versions of java, ffmpeg, and subsonic (4.7). I even went so far as to do a full package update on my server, so i ought to be completely up to date with everything. Does Subsonic use the "downsample" string for video playback? Is there something i need to use for that, perhaps?

Even if i wait until the whole video has finished playback, the seek bar still doesn't show, and there's no times given. It's not that it doesn't show how much is buffered, it's that it just doesn't show anything at all.
Knetic
 
Posts: 5
Joined: Mon Dec 31, 2012 1:06 am

Re: Cannot seek in videos (web player)

Postby Knetic » Wed Jan 02, 2013 1:16 am

I found out that i can use the querystring parameters of the pop-out window to skip around in videos. It's not the most elegant solution ever devised, but it at least works.

http://stagger/subsonic/videoPlayer.view?id=2984&maxBitRate=1000&timeOffset=1234&popout=true
Knetic
 
Posts: 5
Joined: Mon Dec 31, 2012 1:06 am

Re: Cannot seek in videos (web player)

Postby Knetic » Sun Mar 03, 2013 11:59 pm

I know this is months later, but i wanted to post my solution in case anyone else finds this in a google search or something.

While looking for help on a separate (non-subsonic) issue, i found out that my version of ffmpeg/avconv was from the LibAV fork. I didn't know this, since it was what was in the debian repositories, but LibAV is a bit of a stunted version of ffmpeg, and hasn't merged all the fixes and updates since they forked.

Because of this, i had to completely remove ffmpeg from my server, and re-download ffmpeg from the Debian-Multimedia link (which i had thought i'd done, but there must be a libAV version in the official repositories somewhere which took precedence).

After wiping out ffmpeg and installing the good version, everything works like a charm - i can seek and see the times for any video in my collection.
Knetic
 
Posts: 5
Joined: Mon Dec 31, 2012 1:06 am


Return to Help

Who is online

Users browsing this forum: No registered users and 6 guests