Streaming Video in JWPlayer with Subsonic 3.8 (with FFMpeg)

Tutorials, tips and tricks.

Moderator: moderators

How useful was this Tutorial:

Mohican is God!
13
57%
Mohican is Satan!
3
13%
I don't believe in either...
7
30%
 
Total votes : 23

Re: skipping forward on player

Postby Mohican » Tue Jan 26, 2010 3:00 pm

LeTsRiPiT wrote:I think that I have all parts of this inplace but I am unable to skip forward during the playing of a video is there a work around on this?


Not that I know of, sorry.
Image
Image
User avatar
Mohican
 
Posts: 8
Joined: Mon Dec 28, 2009 11:04 am
Location: Wales, UK

Flash Problem?

Postby onewalrus » Tue Jan 26, 2010 10:32 pm

This is a more concise edit containing information from 2-3 posts detailing what I have found to be improvements, adjustments and repairs (for me) of Mohican's excellent tutorial.

With new versions of Flash, swfobject and jwplayer as of this writing, there are a few things which have changed with respect to Mohican's tutorial. The information below pertains to those updates as they apply to transcoding and streaming avi movie files through ffmpeg.

1. Flash v.10,0,42,34 is the latest release. You can detect your version of Flash HERE With it's release, I found that jwplayer v. 4.4 no longer behaved consistently. I replaced the reference to flash version in C:\subsonic\jetty\1130\webapp\WEB-INF\jsp\playlist.jsp
from 9.0.0.0 to 10.0.42.34.

2. Swfobject: This file has also been updated to v.2.2 since the release of Subsonic 3.8. You can download it from HERE, extract and replace it in
C:\subsonic\jetty\1130\webapp\script
and
C:\subsonic\jetty\1130\webapp\flash

3. Jwplayer is now in version 5.0.753. The Subsonic package contains v.4.4. I downloaded this latest release HERE, and replaced it in C:\subsonic\jetty\1130\webapp\flash. When you do this, you also have to change the Subsonic reference to calling it.
Open the file C:\subsonic\jetty\1130\webapp\WEB-INF\jsp\playlist.jsp
Search for "swfobject"
Replace the
value="
Code: Select all
/flash/jw-player-4.4.swf

with
value="
Code: Select all
/flash/flash/player-viral.swf


4. Transcoding: My desire was for the highest quality video trancoding, to elimate "blocks" in the video output. (My input files are all 16:9 video format.) I was successful in achieving this by doing the following:
I changed the transcoding in step-1 of name/avi from
Code: Select all
ffmpeg -i %s -f flv -y

to
Code: Select all
ffmpeg -re -y -i %s -ar 44100 -sameq -deinterlace -f flv -

The "-s" value in the above example makes ffmpeg transcode the file in the same quality as the input file, hence "same".

5. Finally, if you do not want your videos displayed in jwplayer stretched to fill the screen:
In the file C:\subsonic\jetty\1130\webapp\WEB-INF\jsp\playlist.jsp
under
Code: Select all
function skip(index)

I added
Code: Select all
stretching:"none"

right below
Code: Select all
type:"sound"

so that my 16:9 format movies are not stretched to fill the screen.
Last edited by onewalrus on Sat Jan 30, 2010 6:56 pm, edited 1 time in total.
Pablo
User avatar
onewalrus
 
Posts: 22
Joined: Tue Feb 26, 2008 3:46 am
Location: Colorado Springs, Colorado USA

Re: skipping forward on player

Postby onewalrus » Sat Jan 30, 2010 7:30 am

EDIT 2 FEB:

Testing of TVersity server (suggested below) was disappointing. There are major issues with the server integrity itself.

There is an excellent article here explaining the technical issues in detail relating to metadata/keyframe/seeking in transcoding to flv. The conclusion is that flvtool++ is the only flv conversion tool which overcomes a weakness shared by all others.

Mohican wrote:
LeTsRiPiT wrote:I think that I have all parts of this inplace but I am unable to skip forward during the playing of a video is there a work around on this?


Not that I know of, sorry.


Addendum Jan. 31:
After spending many hours experimenting with different configurations/encoders/players/switches, I am happy to report success. However, it has nothing to do with Subsonic (sorry).

If you want to stream any video/audio/image file through network/web/iphone/Sony PSP/Blackberry/Sony PS3/Xbox 360/Wii/Windows Media Center you can. Easily and without battling with correct transcoding settings. How?

TVersity

From my setup and testing, I can say, without pause or hesitation, and not as a knock to Subsonic, it is far superior and easier to both set up and use than Subsonic.

------------------------------------------------------------------------------

I would search for "ffmpeg keyframes". I could be wrong, but I believe keyframes are necessary for "seeking". I don't know if it's possible, or practical, to have ffmpeg transcode keyframes. At least I haven't found anything promising on it yet, as I would like to be able to do this too!

After a little research, it turns out that ffmpeg refers to keyframes as GOP or group of pictures. You can set the keyframe encoding rate simply by using the switch -g. So in order to convert an uncompressed movie file into a flv of the same quality with a keyframe at every frame use the -g switch command: -g 1

EDIT:Some other ideas to explore.

Am investigating jwplayer Javascript API for a possible method to enable "seeking". According to jwplayer javascript API documentation:

The commands "VOLUME" or "SEEK" also takes arguments, here the position...
Code: Select all
<a href="JavaScript:player.sendEvent('SEEK', 10)">seek absolute position (10th. second)</a>


Please note: When seeking/scrubbing in videos:
The player can only stop where the file contain keyframes.

So, if you set ffmpeg to transcode with keyframes using -g 1, and after the call to the swfobject in playlist.js, add the line:
Code: Select all
so.addParam('allowscriptaccess','always');


You might take a look at this example:
API Seeking

Addendum:Jan.31
I am now looking at the ffmpeg switch
Code: Select all
-vhook module       insert video processing module

to see if it is possible to use a tool like Yamdi or FLVTool2 to handle the flv metadata injection (keyframes) in parallel during transcoding.

I enjoy pursuing solutions for things like this, and, due to persistence, am usually successful, even though I am not an expert, but due to the diligence and sharing of information from people who are experts. While it's always good to maintain optimism, this particular "puzzle" is not looking very promising.

Ideally, if the intent is (as mine is) to stream flv's through jwplayer, it is better, and does not require a server load, to convert files to flv first using Adobe Flash Video Encoder, which will transcode and inject all the metadata for seeking.

I will do an experiment and transcode a small avi to flv using Adobe, and add it to my Subsonic video library to see if jwplayer is able to seek in the file. We'll see. ???
Pablo
User avatar
onewalrus
 
Posts: 22
Joined: Tue Feb 26, 2008 3:46 am
Location: Colorado Springs, Colorado USA

Re: skipping forward on player

Postby onewalrus » Sat Feb 06, 2010 10:39 pm

SOLVED:
Read post here.




Mohican wrote:
LeTsRiPiT wrote:I think that I have all parts of this inplace but I am unable to skip forward during the playing of a video is there a work around on this?


Not that I know of, sorry.
Pablo
User avatar
onewalrus
 
Posts: 22
Joined: Tue Feb 26, 2008 3:46 am
Location: Colorado Springs, Colorado USA

Flash required

Postby ov3r0n » Sat Feb 13, 2010 1:40 pm

I'm running subsonic standalone on ubuntu and, after makings changes suggested by mohican and onewalrus I'm unable to play any file (video or music).

In the place where the flash player used to be now it only sais "Get flash player".

I've tried on Google chrome, chromium and Firefox browsers and same results for the three browsers.

Any ideas?

Thanks in advance.
ov3r0n
 
Posts: 3
Joined: Sat Feb 13, 2010 1:37 pm

Re: Flash required

Postby onewalrus » Sat Feb 13, 2010 3:33 pm

ov3r0n wrote:I'm running subsonic standalone on ubuntu and, after makings changes suggested by mohican and onewalrus I'm unable to play any file (video or music).

In the place where the flash player used to be now it only sais "Get flash player".

I've tried on Google chrome, chromium and Firefox browsers and same results for the three browsers.

Any ideas?

Thanks in advance.


Did you replace jwplayer and swf object with the latest versions as indicated?
Did you update to the latest version of flash?
The "get flash player" message indicates you didn't.
Pablo
User avatar
onewalrus
 
Posts: 22
Joined: Tue Feb 26, 2008 3:46 am
Location: Colorado Springs, Colorado USA

Postby Migz93 » Tue Feb 16, 2010 3:35 am

Works fine for me in 3.9.

Im just wondering though, is there anyway to get some sort of if code to check if whats playing is audio or video, and depending on which it is resize the player?

So if its audio the player height is 20 (not showing video area) and if its video the player height is 150 (showing video area).

I tried adding an if statement to check if the type was audio or video but it didn't work.

So anyone have any clue?
Migz93
 
Posts: 3
Joined: Sun Feb 14, 2010 2:12 am

Postby anitract » Tue Feb 16, 2010 5:49 pm

I am having issues as well. I am running Ubuntu 9.04. I get audio, but no video pop up on my videos...

If I attempt to use the new Swfobject & Jwplayer linked to above, nothing will play. Even with the latest flash update.

Thoughts?
anitract
 
Posts: 28
Joined: Wed Sep 23, 2009 5:27 pm

Postby onewalrus » Tue Feb 16, 2010 6:14 pm

anitract wrote:I am having issues as well. I am running Ubuntu 9.04. I get audio, but no video pop up on my videos...

If I attempt to use the new Swfobject & Jwplayer linked to above, nothing will play. Even with the latest flash update.

Thoughts?


Check your transcoding and player settings. Make sure you have all the coding boxes checked for the player you're using.

What do you mean by "video pop up"? You have to right-click on the player and go to full screen to see the video. It doesn't automatically pop.
Pablo
User avatar
onewalrus
 
Posts: 22
Joined: Tue Feb 26, 2008 3:46 am
Location: Colorado Springs, Colorado USA

Postby anitract » Tue Feb 16, 2010 6:29 pm

Oh crap....somehow I missed the fact that you had to right click and toggle full screen mode. Okay, that works great!

Now the only problem is that I can't use the updated swfobject and jwplayer. Once I attempt to do so, I cannot play anything. I hit play and nothing happens.

In the swfobject_2_2_zip file, do I want to use swfobject.js listed in the root, or the one in the src folder?
anitract
 
Posts: 28
Joined: Wed Sep 23, 2009 5:27 pm

Postby onewalrus » Tue Feb 16, 2010 6:48 pm

anitract wrote:Oh crap....somehow I missed the fact that you had to right click and toggle full screen mode. Okay, that works great!

Now the only problem is that I can't use the updated swfobject and jwplayer. Once I attempt to do so, I cannot play anything. I hit play and nothing happens.

In the swfobject_2_2_zip file, do I want to use swfobject.js listed in the root, or the one in the src folder?


In:
Code: Select all
subsonic\jetty\1130\webapp\WEB-INF\jsp\playlist.jsp
are you referencing the new player?

I can't recall which swfobject.js to use. Try them both. Don't forget to clear you cache between changes, and sometimes, restart the server.
Pablo
User avatar
onewalrus
 
Posts: 22
Joined: Tue Feb 26, 2008 3:46 am
Location: Colorado Springs, Colorado USA

Postby anitract » Tue Feb 16, 2010 10:18 pm

yes I was changing the reference in the playlist file.
I will try both versions again and see if i can get it.
about the only thing I wasn't doing was clearing my browser cache, although I would restart the browser.
anitract
 
Posts: 28
Joined: Wed Sep 23, 2009 5:27 pm

Postby utopian » Thu Feb 18, 2010 1:18 pm

Hi i'm using v3.9.. have made the changes from the step by step guide.. added in the vid folders which i can see thru subsonic..but no individual avi files showing up..what am i doing wrong ? any ideas.. have loaded all the codecs etc.. if i could get this working it would be great

thanks.
User avatar
utopian
 
Posts: 111
Joined: Sun Feb 14, 2010 3:52 pm

Postby anitract » Fri Feb 19, 2010 6:26 pm

Did you add the avi > flv transcoding entry, click the checkbox next to it to enable it, and browsed to Settings -> Players and enabled it there as well?

If you have done all that your files should show up. If not, check your video's directory permissions on your computer.
anitract
 
Posts: 28
Joined: Wed Sep 23, 2009 5:27 pm

Postby utopian » Tue Feb 23, 2010 2:12 pm

anitract wrote:Did you add the avi > flv transcoding entry, click the checkbox next to it to enable it, and browsed to Settings -> Players and enabled it there as well?

If you have done all that your files should show up. If not, check your video's directory permissions on your computer.


yep checked all them and they are enabled..still not showing the files...:(
User avatar
utopian
 
Posts: 111
Joined: Sun Feb 14, 2010 3:52 pm

PreviousNext

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 3 guests