{"id":13509996,"url":"https://github.com/fzakaria/transcoding","last_synced_at":"2025-07-11T01:40:20.897Z","repository":{"id":140112548,"uuid":"50281967","full_name":"fzakaria/transcoding","owner":"fzakaria","description":"A basic transcoding Golang server that utilizes FFMPEG over the command line","archived":false,"fork":false,"pushed_at":"2016-02-02T00:50:57.000Z","size":30,"stargazers_count":70,"open_issues_count":1,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-17T18:35:00.639Z","etag":null,"topics":["ffmpeg","golang","transcode","transcoding-server","video"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fzakaria.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-24T10:06:54.000Z","updated_at":"2024-08-17T03:32:02.000Z","dependencies_parsed_at":"2023-04-24T14:22:52.655Z","dependency_job_id":null,"html_url":"https://github.com/fzakaria/transcoding","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzakaria%2Ftranscoding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzakaria%2Ftranscoding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzakaria%2Ftranscoding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fzakaria%2Ftranscoding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fzakaria","download_url":"https://codeload.github.com/fzakaria/transcoding/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244710275,"owners_count":20497222,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffmpeg","golang","transcode","transcoding-server","video"],"created_at":"2024-08-01T02:01:20.523Z","updated_at":"2025-03-20T23:30:29.736Z","avatar_url":"https://github.com/fzakaria.png","language":"Go","readme":"# Transcoding Server tool\n\n## Sample Commands\n\n```\nbrew install ffmpeg\ngo get github.com/fzakaria/transcoding\ngo install github.com/fzakaria/transcoding\n#Assumes $GOPATH/bin is on your $PATH \ntranscoding --config ./configs/prod-us-east-1.toml\n```\n\n## Server\nA basic server implementation is included that offers the facility to transcode uploaded multipart files and some additional admin urls.\n\n```                               \nGET /transcode                               \nPOST /transcode \n#Some admin routes\nGET /admin \nGET /admin/ping                                 \nGET /admin/pprof/                            \nGET /admin/pprof/heap                        \nGET /admin/pprof/goroutine                   \nGET /admin/pprof/block                       \nGET /admin/pprof/threadcreate                \nGET /admin/pprof/cmdline                     \nGET /admin/pprof/profile                     \nGET /admin/pprof/symbol                      \nGET /admin/stats    \nGET /admin/config\n```\n\n###Transcoding\nA useful route is the `[POST|GET] /transcode` one, which provided a file and conversion type will return the resulting MP4 file. A sample form is provided at the `GET` route, however you can also make use of CLI tools.\n\n```\nbrew install http \nhttp -f POST http://localhost:8080/transcode input@~/Downloads/sample.mp4 type=480p  \u003e output.mp4\n```\n\n###AWS\nThe server has a tighter integration with performing Transcoding from files saved in S3 and writting them back out to S3.\nThe route available is *POST* `/api/transcode`\n\nYou can specify a samlpe request based on the following schema:\n\n```    \n{\n\t\t\"input\": {\n\t\t\t\"bucket\": \"slinger-test\",\n\t\t\t\"key\": \"input.mp4\"\n\t\t},\n\t\t\"output\": {\n\t\t\t\"bucket\": \"slinger-test\",\n\t\t\t\"key\": \"output.mp4\"\n\t\t},\n\t\t\"type\" : \"320p\"\n}\n```\n**THE SERVER MUST HAVE ACCESS TO THE INPUT \u0026 OUTPUT BUCKET - SEE AWS BUCKET POLICIES**\n\n## Docker\nTo make bootstrapping easier for variety of platforms. A Dockerfile is provided which will run the server in a [docker](https://www.docker.com/) container.\n\n```\n#The following commands assumes you are in the package\ndocker build -t transcode-server .\ndocker run -p 8080:8080 transcode-server   \n#You can now access the server at localhost:8080\n#or if you ar on mac osx `docker-machine ip default`\n```\n\n## Choosing an appriorate filter description\n\nA common scenario is re-encoding a video for streaming over the web. In such a scenario you generally want to transcode to a lower resolution and bitrate.\n\n### Resolution\nResolution is the \"sharpness\" of the video in question. \n**Filesize is not determined by resolution**\n\n\u003e filesize (in MB) = (bitrate in Mbit/s * 8) * (video length in seconds)\n*But a larger resolution will require more bitrate for it to keep the same level of \"quality\"*\n\nAccording to this [post](https://www.virag.si/2012/01/web-video-encoding-tutorial-with-ffmpeg-0-9/) here are some general resolution/bitrate guidelines.\n\nResolution    | Bitrate       | Approx. File size of 10 minutes\n------------- | ------------- | -------------------------------\n320p (mobile) | 180 kbit/s    | ~13 MB\n360p          | 300 kbit/s    |\t~22MB\n480p          |\t500 kbit/s    | ~37MB\n576p (PAL)    | 850 kbit/s    | ~63MB\n720p          | 1000 kbit/s   | ~75 MB\n","funding_links":[],"categories":["Go","HarmonyOS","video"],"sub_categories":["Windows Manager"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzakaria%2Ftranscoding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffzakaria%2Ftranscoding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffzakaria%2Ftranscoding/lists"}