You are here

Procedures for Encoding, Uploading and Publishing MP4 Video Files for HKU Video Streaming Service

The HKU Video Streaming Service allows you to store MP4 video files and publish them in your web pages. The HKU Video Server supports two kinds of video sharing methods, the first is publicly accessible with no access control, and the second is restricting access to HKU Portal users only. The latter is accomplished by applying Single Sign-On (SSO) control. It is assumed that you have a valid Video Streaming account on the HKU Video Streaming Server before posting video files. You can apply for a Video Streaming account by submitting e- form CF43.

The following procedures outline the steps for converting video files and uploading videos for sharing. If access control to videos through SSO is required, please follow the steps outlined in “2.2 Uploading your mp4 video files to the VSS Video Server” below.

1. Tools

1.1 MP4 video files convertor
1.2 Secure-FTP (SFTP) program

2. Procedures for Encoding and Uploading MP4 Video Files to HKU Video Streaming Server

2.1 Encoding your video files from .flv to mp4
2.2 Uploading your mp4 video files to the HKU Video Streaming Server


1. Tools:

1.1 Flv to .MP4 Video Convertor

Video files of formats other than MP4 have to be converted to MP4 before uploading. There are many tools available on the Internet for the conversion and our user guide is written based on the following converters:

(a) Any Video Converter Free (Gui)

This software can be downloaded at http://www.any-video-converter.com/products-freeware/

(b) Free FFMPEG Video Converter (cmd)

This software can be downloaded at https://www.ffmpeg.org/download.html

1.2 Secure-FTP (SFTP) program

Again, there are many Secure-FTP programs available from the internet and this user guide is written based on Core FTP LE 2.2 which can be downloaded from http://www.coreftp.com/download.html. The steps of uploading videos to vss server can be found in "2.2 Uploading your mp4 video files to the HKU Video Streaming Server".

For older version of Core FTP LE 2.1.
see http://www.its.hku.hk/documentation/guide/infosys/web/ssh/coreftp for the user guide.

2. Procedures for Encoding and Uploading MP4 Video Files to HKU Video Streaming Server

2.1 Encoding your video files from .flv to .mp4

If you use “Any Video Converter Free”:

  1. After download, launch Any Video Converter Free
    open
     
  2. Select Input Video
    add video 
    Click the “Add Video(s)” button to select an input video file(s) from your computer.
    By default, the output file name is the same as video title is.
     
  3. Select Output Format
    output format 
    Click the drop down button and choose the output format as “HTML5 MP4 Movie (*.mp4)”
     
  4. Check the Basic Settings, Video Options and Audio Options
    basic setting 
    Basic Settings: confirm the video size is set as original, change output folder location if needed
    Video Options: confirm the video bitrate is set as original bitrate
    Audio Options: confirm the audio codec is acc
     
  5. Convert video
    convert video 
    Click “Convert Now” and wait for the video to be converted.

 

If you use “FFMPEG”:

  1. Go to https://www.ffmpeg.org/download.html,
    At “Get the packages, click on the blue window icon and click “Windows Build”
    get the packages windows packages
     
  2. Click “Download Build”
    download build
     
  3. Create the folder “ffmpeg” in c:\ and unzip the downloaded contents to c:\ffmpeg
    create folder
     
  4. Open a Notepad, copy and paste the following code and save as “batch_convert.bat”:
     
    mkdir c:\ffmpeg\bin\newfiles
    for %%a in ("*.flv") do ffmpeg -i "%%a" -c:v libx264 -preset slow -crf 20 -b:a 128k
    "C:\ffmpeg\bin\newfiles\%%~na.mp4"
    Pause

     
  5. Click “File”, “Save as”; Save into C:\ffmpeg\bin\
    save as 
    File name: “batch_convert.bat”
    Save as type: “All files”
    save as type 
    Then click “Save”
     
  6. Copy all your .flv videos into c:\ffmpeg\bin folder
    copy all fly video
     
  7. Double-click the batch_convert.bat file, and it will start converting all the videos from .flv to .mp4 and store them into an auto created folder “newfiles”
    open

 

2.2 Uploading your MP4 video files to the HKU Video Server

After your MP4 video files are ready, the next step is uploading them to the video server with SFTP program.

  1. Install the CoreFTP program on your PC.
     
  2. Run the program: Start > CoreFTP (x64) > CoreFTP LE
     
  3. Click on “Site Manager” button to open connection:
    open
    site manager
     
  4. Input the followings:
    Site Name: VSS
    Host / IP /URL: vss.hku.hk
    Username: <yourDept account>
    Password: <yourDept password>
    Connection: SSH/SFTP
    Click “Connect”
     
  5. Upload your MP4 video files to the servers. There are 3 locations where you can store your videos:
    1. “/home/<yourDept>/sso/” for protected videos requiring HKU Portal login
    2. “/home/<yourDept>/sso/acl/” for protected videos requiring both HKU Portal login and acl white list
    3. “/home/<yourDept>/vod/” for public videos (no login required)
      (<yourDept> stands for the directory name assigned to your department on the HKU Video Server.)
      SFTP
       
  6. Details of each video locations:
    1. SSO\ folder = videos are private, HKU portal login require to view videos
      SSO
      Simply upload MP4 videos to this folder. All videos are protected and all users must authenticate using their HKU Portal UID and PIN in order to access these videos.
    2. SSO\acl\ folder = videos are private, HKU portal login and HKU staff/student number listed in acl.txt are require to view videos
      acl_1acl_2
      To further protect videos to be accessible by named HKU staff or students, upload videos to the SSO/acl/ folder.
      1. “acl” folder is not created by default, to enable acl control, add a sub-folder named as “acl” (or any desired sub-folder name, however, in this user guide, we will use “acl” as the sub-folder name).
      2. Create a file named “acl.txt” which contains all the staff and student numbers which are allowed to access the videos in the “acl” sub-folder. This file name cannot be changed and must be “acl.txt”.
      3. Upload the “acl.txt” file and your videos files to the “acl” sub-folder.
      4. If you have multiple groups of viewers, you can create multiple sub-folders in the SSO folder (e.g. SSO\acl1\, SSO\acl2\, etc.) and create an “acl.txt” file for each sub-folder. One “acl.txt’ file is required for each sub-folder and access to videos is restricted by the “acl.txt” file located in the same sub-folder as the videos.
        (Note: if “acl.txt” file is missing, videos in the sub-folder will be accessible by anyone with HKU Portal login)
    3. VOD\ folder = videos are public, no login require
      VOD
       
  7. URL links to access videos on the VSS server

    Please refer to the following tables on the URL links to point to your uploaded videos.

    Type of videos Path on server URL Links
    SSO protected /home/<yourDept>/sso/ http://vss.hku.hk/sso/<yourDept>/<video>.mp4
    SSO + ACL /home/<yourDept>/sso/<acl>/ http://vss.hku.hk/sso/<yourDept>/<acl>/<video>.mp4
    Public video (VOD) /home//vod/<yourDept> http://vss.hku.hk/vod/<yourDept>/<video>.mp4

    Examples:

    Path on server URL Links
    /home/ucteam/sso/Test2.mp4 http://vss.hku.hk/sso/ucteam/Test2.mp4
    /home/ucteam/sso/acl/Test2.mp4 http://vss.hku.hk/sso/ucteam/acl/Test2.mp4
    /home/ucteam/sso/acl2/Test2.mp4 http://vss.hku.hk/sso/ucteam/acl2/Test2.mp4
    /home/ucteam/vod/Test1.mp4 http://vss.hku.hk/vod/ucteam/Test1.mp4

    Note: HTTPS will be used during HKU Portal login for SSO protected and SSO+ACL videos while HTTP will be used for the transmission of all videos.