{"id":13907358,"url":"https://github.com/kala13x/libxmedia","last_synced_at":"2026-01-30T17:36:49.803Z","repository":{"id":218680718,"uuid":"747083637","full_name":"kala13x/libxmedia","owner":"kala13x","description":"Implementation of audio/video transmuxing library based on FFMPEG API","archived":false,"fork":false,"pushed_at":"2025-10-27T20:53:37.000Z","size":114,"stargazers_count":7,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-20T20:46:56.187Z","etag":null,"topics":["chapters","decoder","decoding","demuxer","demuxing","encoder","encoding","ffmpeg","llibrary","metadata","multimedia","muxer","muxing","streamer","streaming","transcoder","transcoding"],"latest_commit_sha":null,"homepage":"","language":"C","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/kala13x.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":"2024-01-23T08:27:55.000Z","updated_at":"2025-03-19T23:23:46.000Z","dependencies_parsed_at":"2024-01-23T10:06:25.865Z","dependency_job_id":"ebeb0750-0441-4cca-ab2f-7b398c2db8ca","html_url":"https://github.com/kala13x/libxmedia","commit_stats":null,"previous_names":["kala13x/libxmedia"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kala13x/libxmedia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kala13x%2Flibxmedia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kala13x%2Flibxmedia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kala13x%2Flibxmedia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kala13x%2Flibxmedia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kala13x","download_url":"https://codeload.github.com/kala13x/libxmedia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kala13x%2Flibxmedia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28916260,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T16:37:38.804Z","status":"ssl_error","status_checked_at":"2026-01-30T16:37:37.878Z","response_time":66,"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":["chapters","decoder","decoding","demuxer","demuxing","encoder","encoding","ffmpeg","llibrary","metadata","multimedia","muxer","muxing","streamer","streaming","transcoder","transcoding"],"created_at":"2024-08-06T23:01:54.336Z","updated_at":"2026-01-30T17:36:49.782Z","avatar_url":"https://github.com/kala13x.png","language":"C","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"[![MIT License](https://img.shields.io/badge/License-MIT-brightgreen.svg?)](https://github.com/kala13x/libxmedia/blob/main/LICENSE)\n[![C/C++ CI](https://github.com/kala13x/libxmedia/actions/workflows/make.yml/badge.svg)](https://github.com/kala13x/libxmedia/actions/workflows/make.yml)\n[![CMake](https://github.com/kala13x/libxmedia/actions/workflows/cmake.yml/badge.svg)](https://github.com/kala13x/libxmedia/actions)\n[![SMake](https://github.com/kala13x/libxmedia/actions/workflows/smake.yml/badge.svg)](https://github.com/kala13x/libxmedia/actions/workflows/smake.yml)\n\n# libxmedia\nA cross-platform library for audio/video transmuxing, built on FFmpeg. Designed for simplicity and performance, it provides an intuitive high-level API and includes a fully functional example.\n\n### Installation\nThere are several ways to build and install the project but at first, the [libxutils](https://github.com/kala13x/libxutils) library, `FFMPEG` and `freetype` development packages must be installed on the system.\n\n#### Using included script\nAfter installing `libxutils`, `ffpmeg` and `freetype` libraries, the simplest way to build and install a project is to use the included script:\n\n```bash\ngit clone https://github.com/kala13x/libxmedia.git \u0026\u0026 ./libxmedia/build.sh --install\n```\n\nList options that build script supports:\n\n- `--tool=\u003ctool\u003e` Specify `Makefile` generation tool or use included `Makefile`.\n- `--install` Install library and the tools after the build.\n- `--cleanup` Cleanup object files after build/installation.\n- `--example` Include example in the build.\n\nYou can either choose `cmake`, `smake` or `make` as the tool argument, but `cmake` is recommended on platforms other than the Linux.\nIf the tool will not be specified the script will use `make` (included Makefile) as default.\n\n#### Using CMake\nIf you have a `CMake` tool installed in your operating system, here is how project can be built and installed using `cmake`:\n\n```bash\ngit clone https://github.com/kala13x/libxmedia.git\ncd libxmedia\ncmake . \u0026\u0026 make\nsudo make install\n```\n\n#### Using SMake\n[SMake](https://github.com/kala13x/smake) is a simple Makefile generator tool for the Linux/Unix operating systems:\n\n```bash\ngit clone https://github.com/kala13x/libxmedia.git\ncd libxmedia\nsmake \u0026\u0026 make\nsudo make install\n```\n\n#### Using Makefile\nThe project can also be built with a pre-generated `Makefile` for the Linux.\n\n```bash\ngit clone https://github.com/kala13x/libxmedia.git\ncd libxmedia\nmake\nsudo make install\n```\n\n### XMedia\n`xmedia` is an example command-line tool for transcoding and remuxing media files. It allows you to convert and stream media from one format to another with various customization options.\n\n##### Usage\n```bash\nxmedia [options]\n```\n\n##### Command-line options:\nOption     | Syntax    | Type           | Description\n-----------|-----------|----------------|---------------------------\n`-i`       | path      | string         | Input file or stream path\n`-o`       | path      | string         | Output file or stream path\n`-e`       | format    | string         | Input format name (example: v4l2)\n`-f`       | format    | string         | Output format name (example: mp4)\n`-x`       | format    | string         | Video scale format (example: aspect)\n`-p`       | format    | string         | Video pixel format (example: yuv420p)\n`-s`       | format    | string         | Audio sample format (example: s16p)\n`-k`       | num:den   | number:number  | Video frame rate (example: 90000:3000)\n`-q`       | number    | number         | Audio sample rate (example: 48000)\n`-c`       | count     | number         | Audio channel count (example: 2)\n`-v`       | codec     | string         | Output video codec (example: h264)\n`-a`       | codec     | string         | Output audio codec (example: mp3)\n`-w`       | width     | number         | Output video width (example: 1280)\n`-h`       | height    | number         | Output video height (example: 720)\n`-b`       | bytes     | number         | IO buffer size (default: 65536)\n`-t`       | type      | string         | Timestamp calculation type\n`-m`       | path      | string         | Metadata file path\n`-n`       | shift     | number         | Fix non-motion PTS/DTS\n`-z`       |           |                | Custom output handling\n`-l`       |           |                | Loop transcoding/remuxing\n`-r`       |           |                | Remux only\n`-d`       |           |                | Debug logs\n`-u`       |           |                | Usage information\n\n#### Video Scale Formats\n- `stretch` Stretch video frames to the given resolution\n- `aspect` Scale video frames and protect aspect ratio\n\n##### Example\n```bash\nxmedia -i /dev/video0 -o dump.mp4 -v h264 -p yuv420p -x aspect -w 1280 -h 720\n```\n\n#### Timestamp Calculation Types\n- `calculate` Calculate TS based on the elapsed time and clock rate\n- `compute` Compute TS based on the sample rate and time base\n- `rescale` Rescale original TS using av_packet_rescale_ts()\n- `round` Rescale original TS and round to the nearest value\n- `source` Use original PTS from the source stream\n\n##### Example\n```bash\nxmedia -i input.avi -o output.mp4 -t source\n```\n\n#### Metadata File Syntax\nMetadata files allow you to specify additional information for your media. The syntax is as follows:\n\n- If the line consists of three sections, it will be parsed as a chapter.\n- If it consists of two sections, it will be parsed as metadata.\n- `hh:mm:ss` time format is used for chapter start/end time.\n\n#### Metadata File Example:\n```\n00:00:00|00:00:40|Opening chapter\n00:00:40|00:10:32|Another chapter\n00:10:32|00:15:00|Final chapter\nComment|Created with xmedia\nTitle|Example meta\nAlbum|Examples\n```\n\n##### Example\n```bash\nxmedia -i file.mp4 -ro remuxed.mp4 -m meta.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkala13x%2Flibxmedia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkala13x%2Flibxmedia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkala13x%2Flibxmedia/lists"}