ffmpeg-web-client

module
v0.0.0-...-67e239f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 26, 2019 License: MIT

README

FFmpeg-Web-Client

made-with-Go

This program registered in the Windows service is executed as a server, which transcodes (encodes) an video using the resources of a web client and transmits the video to a ftp server.

Recently

  • Added the function to display the remaining time.

Demo

화면

Browsers support

IE / Edge
IE / Edge
Chrome
Chrome
IE10, IE11 last version

Install

go get github.com/Hunet-edutech/ffmpeg-web-client

Run

  1. To run the program, you need to download below libraries.

    for service
    for test
  2. Change location of ffmpeg.exe / ffprobe.exe to directory of main.go

  3. Run your ftp server for testing

     exampleftpd -root /tmp
    
  4. Check your ftp server's connection

     ftp > open localhost 2121
    
  5. Check your websocket connection after openning 'sample.html'

API Reference

  • ftp server

    Domain Port
    / 2121
  • default : localhost:5050

  • To connect websocket

    • Request

        Get /echo
      
    • Progress Json Data

      Field Description Optional
      fileIndex file index no
      fileName file name yes
      progressTime current encoding time yes
      progressStatus current encoding status (continue / end) no
      totalTime file total time yes
      timeRemaining encoding time emaining (일, 시/ 분, 분/초, 초) yes
      progressRate encoding progress rate ( 00.00) no
  • To check a File existence of ftp server

    • Request

        Get /fileExist
      

      Query parameters :

      Field Description Optional
      uploadFileName file name to check(encoded file name) no
      courseCd course code no
    • Response

        Content-Type : text/plain;
        exmaple : true(not exist) / false(exist) / error
      
  • To requst encoding and uploading a file

    • Request

        Post /transcoding
        Content-Type : multipart/form-data; 
      
      • Form Data :

        Field Description Optional
        uploadFileData file data no
        uploadFileInfo information of 'uploadFileData' no
        uploadEncodingInfo encoding information no
      • 'uploadFileInfo' Json Data :

        Field Description Optional
        fileIndex index no
        courseCd course code no
        courseNo course number(file name) no
        chapterNo chapter number yes
        courseName course name yes
        courseDetailName course detail name yes
        uploadFileName filename ('courseNo' + 'uploadFileExt') no
        uploadFileSize file size yes
        uploadFileExt filename extension yes
      • 'uploadEncodingInfo' Json Data :

        Field Description Optional
        videoCodec video codec no
        videoBitrate video bitrate no
        audioCodec audio codec no
        audioBitrate audio bitrate no
        resolution resolution no
    • Response

        Content-Type : text/plain;
      
  • To stop trancoding

    • Request

        DELETE /transcoding
      
      • Form Data :

        Field Description Optional
        fileIndex index no
    • Response

         Content-Type : text/plain;
         exmaple : true / false
      
  • To check if service program is running

    • Request

        Get /serviceCheck
      
    • Response

        Content-Type : text/plain;
        exmaple : 1(running) / error
      

Notice

  • If you want to check logs, you must use Init() method in Run() method.

  • Due to the security issue(fakepath) on the web, the process will copy a stored data received from the web client, then encode it and send it to the ftp server. Therefore, this process must need to delete a stored data and encoded data on local.

  • You can stop to encoding a file, but you can't stop during uploading.

  • You can set the output directly to the ftp server during the ffmpeg encoding process, but it is not recommended.

  • the ftp server's file structure is

      /GoTest/cource_code/cource_number.mp4
    

References

Directories

Path Synopsis
ffmpegFTP
main
Example service program that beeps.
Example service program that beeps.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL