On Demand Video: Difference between revisions

m
links, update, format, +cat
m (cat)
m (links, update, format, +cat)
Line 1: Line 1:
This is a brief overview of how the on-demand video system works.
This is a brief overview of how the on-demand video system works.


==Adding Videos to the Website==
==Adding videos to the website==
When attempting to add a video the user is presented with a list of files in the Finished Shows folder to choose from. They select a source file, named following the convention XX_title_TRM_YY where XX is the year number, TRM is one of sum, spr or aut and YY is a week number. The website does some checks, for example making sure the file actually obeys the naming scheme, and then generates a series of entries in the encode_jobs table.
''Main articles: [[Computing:Encode Server|Encode Server]] and [[Computing:EncodeSrv|EncodeSrv]].''
As part of this process, the web server runs ffmpeg -i on the file to get some metadata, and selects appropriate target formats. For historical reasons, Finished Shows is actually mounted in /mnt/UserData as it was easier to do this than change the site code.


The [[Computing:EncodeSrv|Encode Server]] periodically checks for entries in the encode_jobs table, sets their status to waiting and begins copying the files to a local directory, before attempting to run an encode job on them. When the job is complete it copies the resulting output to target directories specified by the website when creating the job. Conveniently, these are all under /data/video which is on the webserver and mounted under this location to the encode server as well.
When attempting to add a video through the Watch section of the website the user is presented with a list of files in the [[Storage#Finished Shows .28S:.29|Finished Shows]] folder to choose from. They select a source file, '''named following the convention <code>XX_title_TRM_YY</code> where XX is the calendar year number, TRM is one of <code>sum</code>, <code>spr</code> or <code>aut</code> and YY is a term week number (10 for all weeks in a holiday up until week 1)'''. The website does some checks, for example making sure the file actually obeys the naming scheme, and then generates a series of entries in the <code>encode_jobs</code> [[database]] table.
As part of this process, the web server runs <code>ffmpeg -i</code> on the file to get some metadata, and selects appropriate target formats. For historical reasons, Finished Shows is actually mounted in <code>/mnt/UserData</code> as it was easier to do this than change the site code.
 
[[Computing:EncodeSrv|EncodeSrv]] (running on the periodically checks for entries in the encode_jobs table, sets their status to waiting and begins copying the files to a local directory, before attempting to run an encode job on them. When the job is complete it copies the resulting output to target directories specified by the website when creating the job. Conveniently, these are all under <code>/data/video</code> which is on the webserver and mounted under this location to the encode server as well.


The website will not allow public-facing access to any video which does not have a file that has finished encoding and been copied.
The website will not allow public-facing access to any video which does not have a file that has finished encoding and been copied.


==Thumbnail Generation==
==Thumbnail generation==
The Thumbnails button on an internal watch page runs an ffmpeg command on the playout video to generate a handful of thumbnails scattered through the file. Naturally if the video server, which stores the playout versions, is offline this won't work, nor if the encode has not succeeded for any reason.
The Thumbnails button on an internal watch page runs an ffmpeg command on the playout video to generate a handful of thumbnails scattered through the file. Naturally if the video server, which stores the playout versions, is offline this won't work, nor if the encode has not succeeded for any reason.


==Watching Videos on the Website==
==Watching videos on the website==
JW Player on the site is presented with a video file in the form ystv.co.uk/videostream/watch/IDNO where IDNO is the video file's ID number. The pseudostreaming software, Loomiere receives these requests via an Apache rewrite, and runs a small PHP script (videohit.php) to mark a hit in the database, before delivering the actual video file based on the ID number given.
[http://www.longtailvideo.com/jw-player/ JW Player] on the site is presented with a video file in the form <code>ystv.co.uk/videostream/watch/''IDNO''</code> where IDNO is the video file's ID number. The pseudostreaming software [[Computing:Web Server#Loomiere|Loomiere]] receives these requests via an [[Computing:Web Server#Apache|Apache]] [http://httpd.apache.org/docs/current/mod/mod_rewrite.html rewrite], and runs a small PHP script (<code>videohit.php</code>) to mark a hit in the [[database]], before delivering the actual video file based on the ID number given.


[[Category:Computing]]
[[Category:Computing]]
[[Category:Post-Production]]
[[Category:In-House]]
[[Category:Website]]
Administrators, DnsAdmins, Domain Admins, Domain Users, confluence-administrators, confluence-users, crowd-administrators, jira-administrators, jira-developers, jira-users, stash-administrators, stash-users
322

edits