{"id":13806618,"url":"https://github.com/spider-gazelle/ffmpeg","last_synced_at":"2026-02-27T01:31:49.286Z","repository":{"id":64712769,"uuid":"577261761","full_name":"spider-gazelle/ffmpeg","owner":"spider-gazelle","description":"ffmpeg crystal bindings","archived":false,"fork":false,"pushed_at":"2024-07-30T08:53:09.000Z","size":71,"stargazers_count":20,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-05-06T21:49:45.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spider-gazelle.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-12T10:50:19.000Z","updated_at":"2024-12-01T22:27:17.000Z","dependencies_parsed_at":"2024-02-16T04:23:54.415Z","dependency_job_id":"a63edc60-05f6-4941-8a0c-06d9fb5adcf4","html_url":"https://github.com/spider-gazelle/ffmpeg","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/spider-gazelle/ffmpeg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spider-gazelle%2Fffmpeg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spider-gazelle%2Fffmpeg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spider-gazelle%2Fffmpeg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spider-gazelle%2Fffmpeg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spider-gazelle","download_url":"https://codeload.github.com/spider-gazelle/ffmpeg/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spider-gazelle%2Fffmpeg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29880724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-08-04T01:01:13.919Z","updated_at":"2026-02-27T01:31:49.268Z","avatar_url":"https://github.com/spider-gazelle.png","language":"Crystal","readme":"# ffmpeg bindings for crystal lang\n\n[![CI](https://github.com/spider-gazelle/ffmpeg/actions/workflows/ci.yml/badge.svg)](https://github.com/spider-gazelle/ffmpeg/actions/workflows/ci.yml)\n\nPrimarily to extract video frames from streams and files for processing by AI.\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     ffmpeg:\n       github: spider-gazelle/ffmpeg\n   ```\n\n2. Run `shards install`\n3. ensure the required libraries are installed\n   * `sudo apt install libswscale-dev`\n   * `sudo apt install libav-tools` or `sudo apt install ffmpeg`\n\n## Usage\n\nparsing a video file, outputs [StumpyCore Canvas](https://github.com/stumpycr/stumpy_core#stumpy_core)\n\n```crystal\n\nrequire \"ffmpeg\"\n\nvideo = Video::File.new(\"./test.mp4\")\nvideo.each_frame do |frame|\n  puts \"key frame? #{frame.key_frame?}\"\n  frame           # =\u003e FFmpeg::Frame\n  frame.to_canvas # =\u003e StumpyCore::Canvas\nend\n\n```\n\nalso supports UDP streams (unicast or multicast)\n\n```crystal\n\nrequire \"ffmpeg\"\n\nvideo = Video::UDP.new(\"udp://239.0.0.2:1234\")\nvideo.each_frame do |frame|\n  frame           # =\u003e FFmpeg::Frame\n  frame.to_canvas # =\u003e StumpyCore::Canvas\nend\n\n```\n\nYou can also scale the frames\n\n```crystal\n\nrequire \"ffmpeg\"\n\nvideo = Video::File.new(\"./test.mp4\")\n\n# the scaler context\nscaler = uninitialized FFmpeg::SWScale\n\n# scaled frame we'll use for storing the scaling output\nscaled_frame = uninitialized FFmpeg::Frame\n\nvideo.on_codec do |codec|\n  # scale by 50%\n  width = codec.width // 2\n  height = codec.height // 2\n  scaler = FFmpeg::SWScale.new(codec, width, height, codec.pixel_format)\n  scaled_frame = FFmpeg::Frame.new width, height, codec.pixel_format\nend\n\nvideo.each_frame do |frame|\n  scaler.scale frame, scaled_frame\n\n  # do something with the scaled frame\n  scaled_frame.to_canvas\nend\n\n```\n\nSee the specs for more detailed usage\n\n## Contributing\n\n1. Fork it (\u003chttps://github.com/spider-gazelle/ffmpeg/fork\u003e)\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Stephen von Takach](https://github.com/stakach) - creator and maintainer\n","funding_links":[],"categories":["Image processing"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspider-gazelle%2Fffmpeg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspider-gazelle%2Fffmpeg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspider-gazelle%2Fffmpeg/lists"}