Categorygithub.com/hunet-edutech/ffmpeg-web-client
module
0.0.0-20190926005208-67e239f4677c
Repository: https://github.com/hunet-edutech/ffmpeg-web-client.git
Documentation: pkg.go.dev

# 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, IE11last 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

    DomainPort
    /2121
  • default : localhost:5050

  • To connect websocket

    • Request

        Get /echo
      
    • Progress Json Data

      FieldDescriptionOptional
      fileIndexfile indexno
      fileNamefile nameyes
      progressTimecurrent encoding timeyes
      progressStatuscurrent encoding status (continue / end)no
      totalTimefile total timeyes
      timeRemainingencoding time emaining (일, 시/ 분, 분/초, 초)yes
      progressRateencoding progress rate ( 00.00)no
  • To check a File existence of ftp server

    • Request

        Get /fileExist
      

      Query parameters :

      FieldDescriptionOptional
      uploadFileNamefile name to check(encoded file name)no
      courseCdcourse codeno
    • 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 :

        FieldDescriptionOptional
        uploadFileDatafile datano
        uploadFileInfoinformation of 'uploadFileData'no
        uploadEncodingInfoencoding informationno
      • 'uploadFileInfo' Json Data :

        FieldDescriptionOptional
        fileIndexindexno
        courseCdcourse codeno
        courseNocourse number(file name)no
        chapterNochapter numberyes
        courseNamecourse nameyes
        courseDetailNamecourse detail nameyes
        uploadFileNamefilename ('courseNo' + 'uploadFileExt')no
        uploadFileSizefile sizeyes
        uploadFileExtfilename extensionyes
      • 'uploadEncodingInfo' Json Data :

        FieldDescriptionOptional
        videoCodecvideo codecno
        videoBitratevideo bitrateno
        audioCodecaudio codecno
        audioBitrateaudio bitrateno
        resolutionresolutionno
    • Response

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

    • Request

        DELETE /transcoding
      
      • Form Data :

        FieldDescriptionOptional
        fileIndexindexno
    • 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

# Packages

No description provided by the author