{"id":29137392,"url":"https://github.com/terroo/ffpp","last_synced_at":"2025-06-30T12:09:26.430Z","repository":{"id":296785479,"uuid":"992963195","full_name":"terroo/ffpp","owner":"terroo","description":"A dynamic library written in C++ with API for most of the main tasks with FFmpeg. Much faster for your GUI interfaces than using processes.","archived":false,"fork":false,"pushed_at":"2025-06-02T01:53:21.000Z","size":222,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-02T11:47:03.735Z","etag":null,"topics":["cpp","ffmpeg-api"],"latest_commit_sha":null,"homepage":"https://github.com/terroo/ffpp","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terroo.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,"zenodo":null}},"created_at":"2025-05-30T01:46:54.000Z","updated_at":"2025-06-02T01:53:25.000Z","dependencies_parsed_at":"2025-06-02T11:47:05.628Z","dependency_job_id":"658f1d91-9d60-428e-b972-2471c0723e6e","html_url":"https://github.com/terroo/ffpp","commit_stats":null,"previous_names":["terroo/ffpp"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/terroo/ffpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Fffpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Fffpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Fffpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Fffpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terroo","download_url":"https://codeload.github.com/terroo/ffpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terroo%2Fffpp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262770429,"owners_count":23361683,"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":["cpp","ffmpeg-api"],"created_at":"2025-06-30T12:08:44.625Z","updated_at":"2025-06-30T12:09:26.407Z","avatar_url":"https://github.com/terroo.png","language":"C++","readme":"# ffpp\nA dynamic library written in C++ with API for most of the main tasks with FFmpeg. Much faster for your GUI interfaces than using processes.\n\n![ffpp](./resources/ffpp-running-windows.jpg) \n\u003e Running on Windows.\n\n---\n\n![ffpp](./resources/ffpp-running-gnu.png)\n\u003e Running on GNU/Linux.\n\n---\n\n## Use on Windows\n\u003e Need [Clang](https://winstall.app/apps/MartinStorsjo.LLVM-MinGW.UCRT): `winget install --id=MartinStorsjo.LLVM-MinGW.UCRT  -e`\n\n1. [Download `libffppwin`](https://bit.ly/libffppwin)\n```powershell\nInvoke-WebRequest -Uri \"https://bit.ly/libffppwin\" -OutFile \"libffppwin.rar\"\n```\n\n3. Unzip(`.rar`)\n\n4. Enter the folder\n```bash\ncd .\\libffppwin\n```\n\n5. Create basic code, example: `main.cpp`\n```cpp\n#include \"ffpp/ffpp.hpp\"\n#include \u003cmemory\u003e\n\nint main(){\n  auto ffpp = std::make_unique\u003cFFPP\u003e();\n  std::cout \u003c\u003c \"Duration: \" \n    \u003c\u003c ffpp-\u003effpp_info(FFPP_INFO::DURATION, \"video.mp4\") \u003c\u003c '\\n';\n}\n```\n\u003e If you want, use this video as an example: [video.mp4](https://terminalroot.com/downloads/video.mp4)\n\n6. Build and run:\n```powershell\n# PowerShell\npwsh build.ps1 main.cpp # Or more files \n\n# Or: Windows PowerShell\npowershell build.ps1 main.cpp # Or more files\n\n# Or directly\n.\\build.ps1 main.cpp # Or more files\n```\n\nIf *Windows Defender* prevents it from running, give permission to run the script:\n```powershell\npwsh -ExecutionPolicy Bypass -File build.ps1 main.cpp # Or more files\n```\n\n**The `build.ps1` script compiles and runs the built binary, the output provides information on the video duration, for example: `Duration: 00:00:05`**\n\n\u003e If you want to download *libffmpeg*, build the *dll* from scratch, see this file: [build-win.md](resources/build-win.md).\n\n---\n\n## On GNU/Linux\nDependencies:\n\n### On Arch\n```bash\nsudo pacman -S gcc ffmpeg make cmake pkg-config git\n```\n\n### On Debian/Ubuntu/Mint:\n```bash\nsudo apt install build-essential ffmpeg make cmake pkg-config git\n```\n\n### Compile and install\n\u003e Run all command below:\n\n```bash\ngit clone https://github.com/terroo/ffpp\ncd ffpp\ncmake . -B build\ncmake --build build\nsudo cmake --install build\n# Important pos install\n# Similar to this: export LD_LIBRARY_PATH=/usr/local/lib\n# But for the entire system:\necho /usr/local/lib | sudo tee /etc/ld.so.conf.d/ffpp.conf\nsudo ldconfig\n```\n\nCreate basic code, example: `main.cpp`\n```cpp\n#include \u003cffpp/ffpp.hpp\u003e\n#include \u003cmemory\u003e\n\nint main(){\n  auto ffpp = std::make_unique\u003cFFPP\u003e();\n  std::cout \u003c\u003c \"Duration: \" \n    \u003c\u003c ffpp-\u003effpp_info(FFPP_INFO::DURATION, \"video.mp4\") \u003c\u003c '\\n';\n}\n```\n\u003e If you want, use this video as an example: [video.mp4](https://terminalroot.com/downloads/video.mp4)\n\n6. Build and run:\n```powershell\ng++ main.cpp -lavformat -lavcodec -lavutil -lswscale -lffpp\n./a.out\n```\n\u003e Example output: `Duration: 00:00:05`.\n\n---\n\n## API Examples\nAssuming you created the object in heap(`auto ffpp = std::make_unique\u003cFFPP\u003e();`).\n\n### 01. Convert MP4 to WMV:\n```cpp\nffpp-\u003effpp_convert(\"video.mp4\", \"new.wmv\");\n```\n\u003e Only converts between video extensions: `.mp4`, `.flv`, `.wmv` and `.mov`\n\n---\n\n### 02. Extract frames:\n```cpp\nffpp-\u003effpp_extract_frames(\"video.mp4\", \"my_frames_dir\");\n```\n\u003e `.ppm` images will be generated in the folder provided: (`my_frames_dir/`).\n\n---\n\n\n### 03. Get information from a video:\n```cpp\nstd::cout \u003c\u003c \"Duration: \" \n  \u003c\u003c ffpp-\u003effpp_info(FFPP_INFO::DURATION, \"video.mp4\") \u003c\u003c '\\n';\nstd::cout \u003c\u003c \"Bitrate: \" \n  \u003c\u003c ffpp-\u003effpp_info(FFPP_INFO::BITRATE, \"video.mp4\") \u003c\u003c '\\n';\nstd::cout \u003c\u003c \"FPS: \" \n  \u003c\u003c ffpp-\u003effpp_info(FFPP_INFO::FPS, \"video.mp4\") \u003c\u003c '\\n';\nstd::cout \u003c\u003c \"Audio frequency: \" \n  \u003c\u003c ffpp-\u003effpp_info(FFPP_INFO::AUDIO_FREQUENCY, \"video.mp4\") \u003c\u003c '\\n';\nstd::cout \u003c\u003c \"Resolution: \" \n  \u003c\u003c ffpp-\u003effpp_info(FFPP_INFO::RESOLUTION, \"video.mp4\") \u003c\u003c '\\n';  \n```\n\n---\n\n### 04. Cut a video from a time to a certain length:\n```cpp\nffpp-\u003effpp_cut(\"video.mp4\", \"00:00:10\", 6, \"output.mp4\");\n```\n\u003e The cut starts after 10 seconds of the video and will last 6 seconds.\n\n---\n\nThere will be more features in the API in the future. If you want to submit a PR, feel free!\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterroo%2Fffpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterroo%2Fffpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterroo%2Fffpp/lists"}