{"id":13905485,"url":"https://github.com/scrwdrv/ffmpeg-command","last_synced_at":"2025-07-20T14:33:11.036Z","repository":{"id":57234920,"uuid":"229702534","full_name":"scrwdrv/ffmpeg-command","owner":"scrwdrv","description":"A simple ffmpeg and ffprobe child process handler, easy to add commands and execute","archived":false,"fork":false,"pushed_at":"2019-12-25T06:03:57.000Z","size":8,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-24T21:46:02.203Z","etag":null,"topics":["audio","childprocess","cli","dash","ffmpeg","ffprobe","hls","mp4","video"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/scrwdrv.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}},"created_at":"2019-12-23T07:44:17.000Z","updated_at":"2021-03-17T16:43:20.000Z","dependencies_parsed_at":"2022-08-23T15:50:40.226Z","dependency_job_id":null,"html_url":"https://github.com/scrwdrv/ffmpeg-command","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scrwdrv/ffmpeg-command","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Fffmpeg-command","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Fffmpeg-command/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Fffmpeg-command/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Fffmpeg-command/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scrwdrv","download_url":"https://codeload.github.com/scrwdrv/ffmpeg-command/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scrwdrv%2Fffmpeg-command/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266140278,"owners_count":23882643,"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":["audio","childprocess","cli","dash","ffmpeg","ffprobe","hls","mp4","video"],"created_at":"2024-08-06T23:01:16.826Z","updated_at":"2025-07-20T14:33:11.017Z","avatar_url":"https://github.com/scrwdrv.png","language":"TypeScript","funding_links":[],"categories":["HarmonyOS"],"sub_categories":["Windows Manager"],"readme":"# ffmpeg-command\n A simple ffmpeg and ffprobe child process handler, easy to add commands and execute\n\n## Installation\n In order to be able to use this module, make sure you have FFmpeg installed on your system (including all necessary encoding libraries like libmp3lame or libx264).\n * [FFmpeg binary](https://www.ffmpeg.org/download.html)\n\n```sh\nnpm i ffmpeg-command\n```\n\n## Usage\n\n### ffmpeg\n```js\nimport FFmpegCmd from 'ffmpeg-command';\n\nconst ffmpegCmd = new FFmpegCmd({ loglevel: 'info', cwd: './video' });\n\nffmpegCmd.add(`-i example.mp4 -af volumedetect -vn -sn -dn -f null /dev/null`);\n\nconsole.log(ffmpegCmd.cmd());\n//ffmpeg -threads 0 -hide_banner -y -loglevel info -i example.mp4 -af volumedetect -vn -sn -dn -f null /dev/null\n\nffmpegCmd.exec().then((stdout) =\u003e {\n    \n    console.log(stdout);\n    /*\n    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'example.mp4':\n    Metadata:\n        major_brand     : mp42\n        minor_version   : 0\n        compatible_brands: isommp42\n        creation_time   : 2018-06-28T20:53:15.000000Z\n    Duration: 00:01:45.44, start: 0.000000, bitrate: 571 kb/s\n        Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 406x720 [SAR 1:1 DAR 203:360], 441 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc (default)\n        Metadata:\n        creation_time   : 2018-06-28T20:53:15.000000Z\n        handler_name    : ISO Media file produced by Google Inc. Created on: 06/28/2018.\n        Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default)\n        Metadata:\n        creation_time   : 2018-06-28T20:53:15.000000Z\n        handler_name    : ISO Media file produced by Google Inc. Created on: 06/28/2018.\n    Stream mapping:\n    Stream #0:1 -\u003e #0:0 (aac (native) -\u003e pcm_s16le (native))\n    Press [q] to stop, [?] for help\n    Output #0, null, to 'NUL':\n    Metadata:\n        major_brand     : mp42\n        minor_version   : 0\n        compatible_brands: isommp42\n        encoder         : Lavf58.29.100\n        Stream #0:0(eng): Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s (default)\n        Metadata:\n        creation_time   : 2018-06-28T20:53:15.000000Z\n        handler_name    : ISO Media file produced by Google Inc. Created on: 06/28/2018.\n        encoder         : Lavc58.54.100 pcm_s16le\n    size=N/A time=00:01:45.44 bitrate=N/A speed= 462x\n    video:0kB audio:18164kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown\n    [Parsed_volumedetect_0 @ 00000236d9632d80] n_samples: 9299968\n    [Parsed_volumedetect_0 @ 00000236d9632d80] mean_volume: -22.8 dB\n    [Parsed_volumedetect_0 @ 00000236d9632d80] max_volume: -2.7 dB\n    [Parsed_volumedetect_0 @ 00000236d9632d80] histogram_2db: 12\n    [Parsed_volumedetect_0 @ 00000236d9632d80] histogram_3db: 141\n    [Parsed_volumedetect_0 @ 00000236d9632d80] histogram_4db: 367\n    [Parsed_volumedetect_0 @ 00000236d9632d80] histogram_5db: 1027\n    [Parsed_volumedetect_0 @ 00000236d9632d80] histogram_6db: 2215\n    [Parsed_volumedetect_0 @ 00000236d9632d80] histogram_7db: 4398\n    [Parsed_volumedetect_0 @ 00000236d9632d80] histogram_8db: 7799 \n    */\n\n}).catch((err) =\u003e {\n    console.log(err);\n});\n```\n\n### ffprobe\n```js\nimport { ffprobe } from 'ffmpeg-command';\n\nffprobe('./video/example.mp4').then((json) =\u003e {\n\n    console.log(json);\n    /* \n    { streams:\n    [ { index: 0,\n        codec_name: 'h264',\n        codec_long_name: 'H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10',\n        profile: 'Main',\n        codec_type: 'video',\n        codec_time_base: '1001/48000',\n        codec_tag_string: 'avc1',\n        codec_tag: '0x31637661',\n        width: 406,\n        height: 720,\n        coded_width: 416,\n        coded_height: 720,\n        has_b_frames: 1,\n        sample_aspect_ratio: '1:1',\n        display_aspect_ratio: '203:360',\n        pix_fmt: 'yuv420p',\n        level: 30,\n        color_range: 'tv',\n        color_space: 'bt709',\n        color_transfer: 'bt709',\n        color_primaries: 'bt709',\n        chroma_location: 'left',\n        refs: 1,\n        is_avc: 'true',\n        nal_length_size: '4',\n        r_frame_rate: '24000/1001',\n        avg_frame_rate: '24000/1001',\n        time_base: '1/90000',\n        start_pts: 0,\n        start_time: '0.000000',\n        duration_ts: 9489480,\n        duration: '105.438667',\n        bit_rate: '441202',\n        bits_per_raw_sample: '8',\n        nb_frames: '2528',\n        disposition: [Object],\n        tags: [Object] },\n        { index: 1,\n        codec_name: 'aac',\n        codec_long_name: 'AAC (Advanced Audio Coding)',\n        profile: 'LC',\n        codec_type: 'audio',\n        codec_time_base: '1/44100',\n        codec_tag_string: 'mp4a',\n        codec_tag: '0x6134706d',\n        sample_fmt: 'fltp',\n        sample_rate: '44100',\n        channels: 2,\n        channel_layout: 'stereo',\n        bits_per_sample: 0,\n        r_frame_rate: '0/0',\n        avg_frame_rate: '0/0',\n        time_base: '1/44100',\n        start_pts: 0,\n        start_time: '0.000000',\n        duration_ts: 4649984,\n        duration: '105.441814',\n        bit_rate: '125605',\n        nb_frames: '4541',\n        disposition: [Object],\n        tags: [Object] } ],\n    format:\n    { filename: './video/example.mp4',\n        nb_streams: 2,\n        nb_programs: 0,\n        format_name: 'mov,mp4,m4a,3gp,3g2,mj2',\n        format_long_name: 'QuickTime / MOV',\n        start_time: '0.000000',\n        duration: '105.441811',\n        size: '7528318',\n        bit_rate: '571182',\n        probe_score: 100,\n        tags:\n        { major_brand: 'mp42',\n            minor_version: '0',\n            compatible_brands: 'isommp42',\n            creation_time: '2018-06-28T20:53:15.000000Z' } } } \n    */\n\n}).catch((err) =\u003e {\n    console.log(err);\n});\n\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrwdrv%2Fffmpeg-command","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscrwdrv%2Fffmpeg-command","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscrwdrv%2Fffmpeg-command/lists"}