ResourceSpace 7 and HTML Video Setup

1,535 views
Skip to first unread message

Mike Smith

unread,
Feb 18, 2015, 11:09:57 AM2/18/15
to resour...@googlegroups.com
Good Morning All - 

I have just installed the newest update and have been playing with the new video player and running into issues with creating H264 Previews that work with iOS. 

The install check looks fine 

PHP version5.5.9-1ubuntu4.6  (config: /etc/php5/apache2/php.ini)OK
MySQL version5.5.41-0ubuntu0.14.04.1  (client-encoding: latin1)OK
GD version2.1.1-devOK
PHP.INI value for 'memory_limit'1024MOK
PHP.INI value for 'post_max_size'1024MOK
PHP.INI value for 'upload_max_filesize'1024MOK
Write access to /var/www/rs7/include/../filestoreOK
Write access to gfx/homeanim/gfxOK
Blocked browsing of 'filestore' directoryOK
Large file support (64 bit platform)OK
ImageMagickVersion: ImageMagick 6.7.7-10 2014-03-06 Q16 http://www.imagemagick.orgOK
FFmpegffmpeg version 1.2.6-7:1.2.6-1~trusty1OK
GhostscriptGPL Ghostscript 9.10 (2013-08-30)OK
EXIF extensionOK
ExifTool9.46OK


I can upload video and make a preview that plays fine in a browser, but the video I am creating for that preview when I try to play it back on an mobile device says that there are no playable files for this device. 

I have looked in the filestore and I am creating a .mp4 video file, there are no .flv files there. 

My settings from config.php are as follows: 


# Use VideoJS for video playback (as opposed to FlashPlayer, which we are deprecating)
$videojs=true;

$ffmpeg_preview=true; 
$ffmpeg_preview_seconds=600; # how many seconds to preview
$ffmpeg_preview_extension="mp4";
$ffmpeg_preview_min_width=32;
$ffmpeg_preview_min_height=18;
$ffmpeg_preview_max_width=480;
$ffmpeg_preview_max_height=270;
$ffmpeg_preview_options="-acodec mp3 -ar 48000 -vcodec h264";
# ffmpeg_global_options: options to be applied to every ffmpeg command. 
#$ffmpeg_global_options = "-loglevel panic"; # can be used for recent versions of ffmpeg when verbose output prevents run_command completing
#$ffmpeg_global_options = "-v panic"; # use for older versions of ffmpeg  as above
$ffmpeg_global_options = "";
#$ffmpeg_snapshot_fraction=0.1; # Set this to specify a point in the video at which snapshot image is taken. Expressed as a proportion of the video duration so must be set between 0 and 1. Only valid if duration is greater than 10 seconds.
$ffmpeg_snapshot_seconds=10;  # Set this to specify the number of seconds into the video at which snapshot should be taken, overrides the $ffmpeg_snapshot_fraction setting


I am making alternate versions of the uploaded video and they are working fine, I have the debug log turned on and I am not seeing any errors there. 

Thoughts anyone ? 




paulvInet

unread,
Feb 19, 2015, 10:06:20 AM2/19/15
to resour...@googlegroups.com
Mike,

The problem is not in your config settings. 

I believe we need an update to '"video_player.php". IOS devices require the explicit type defined as on the line below:
     <source src="<?php echo $flashpath_raw?>" type="video/mp4" />

Here is the line in context in "video_player.php":

<!-- START VIDEOJS -->
<link href="<?php echo $baseurl_short?>lib/videojs/video-js.css" rel="stylesheet">
<script src="<?php echo $baseurl_short?>lib/videojs/video.js"></script>
<video id="introvideo" controls width="<?php echo $width?>" height="<?php echo $height?>" data-setup="" class="video-js vjs-default-skin vjs-big-play-centered" poster="<?php echo $thumb_raw?>" preload="auto" >
     <source src="<?php echo $flashpath_raw?>" type="video/mp4" />
     <source src="<?php echo $flashpath_raw?>" type="video/flv" />
     <p class="vjs-no-js">To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a></p>
</video>
<!-- END VIDEOJS -->

Jens_RS

unread,
Feb 19, 2015, 4:34:56 PM2/19/15
to resour...@googlegroups.com
Hi there,

can confirm, the lines that Paul points out needs to be changed. I had the same issue - video_player.php sends the files as MIME video/flv, regardless wether there are MP4 files.
Another problem: All browsers plays the file with flash and not HTML5 as they think it´s an flv video coming in....

So somebody might change the code and place that into then downloadable package.

Also some interesting point for anybody dealing with High Quality videos (Prores, DNxHD): Had a lot of trouble with the ffmpeg settings playing correctly in chrome, but not in firefox or safari nor in QT Player or MPEG Streamclip.
It might be adressed to my used ffmpeg version, but I have to explicit point ffmpeg to use pix_fmt yuv420p in order to get a correct MP4 file. Just for everybody who´s fiddling around with that.

Cheers

Jens

Christopher May

unread,
Mar 17, 2015, 12:00:37 PM3/17/15
to resour...@googlegroups.com
I too can confimr. I was experiencing the same issue on multiple devices, not just iOS. By adding that line I was able to view the .mp4 preview.

The only thing it did break was IE8. It was defaulting to the flash .flv preview but once I added the line, all I got was the .jpg preview and no video in IE8. Probably need to add some browser sniffing?

Chris

Chris Blair

unread,
Mar 17, 2015, 4:19:56 PM3/17/15
to resour...@googlegroups.com
To add to what everyone posted so far...I believe the audio should be aac (low-complexity) and not mp3 for reliable playback on iOS devices. Apple used to have pretty tight specs on mobile and tablet video playback although they've been relaxed some as mobile processors have gotten more powerful. I know they support mp3 for audio playback but I don't think h.264 video with mp3 is listed as a valid combination. If you just use -strict -2 for your audio preview settings it will use aac-lc at 44.1k and someting like 128kb/s. 

Chris Blair

paulvInet

unread,
Mar 18, 2015, 1:49:48 PM3/18/15
to resour...@googlegroups.com
This works well on all devices. 
$ffmpeg_preview_options="-c:a libfaac -ar 48000  -c:v libx264 -crf 23 -vf scale=960:-2 -movflags +faststart";

Eric G

unread,
Mar 19, 2015, 11:27:33 AM3/19/15
to resour...@googlegroups.com
Hi,

@ paulvlnet, in addition to your encoding settings, do you "manually" add the line suggested to the video_player.php file ?

<source src="<?php echo $flashpath_raw?>" type="video/mp4" />

Thanks for your help 

paulvInet

unread,
Mar 20, 2015, 2:46:54 PM3/20/15
to resour...@googlegroups.com
Yes, that is what I did. But the latest version of video-player.php on the svn goes one better.

Rather than adding the line I suggested, the new version is:
 <source src="<?php echo $flashpath_raw?>" type="video/<?php echo $ffmpeg_preview_extension; ?>" />

You can get the file from the svn repository

Paul

Eric G

unread,
Jul 1, 2015, 11:14:55 AM7/1/15
to resour...@googlegroups.com
Thank you Paul,

I will look further in the new version after I update via SVN.

Best regards, Eric.

--
ResourceSpace: Open Source Digital Asset Management
http://www.resourcespace.org
---
You received this message because you are subscribed to a topic in the Google Groups "ResourceSpace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/resourcespace/bipfPdVT6gs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to resourcespac...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages