Zorbing

fluent-ffmpeg.d.ts

Mar 10th, 2019
10,985
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Type definitions for fluent-ffmpeg 2.0.1
  2. // Project: https://www.npmjs.com/package/fluent-ffmpeg
  3. // Definitions by: Zorbing <https://github.com/Zorbing>
  4.  
  5. /* =================== USAGE ===================
  6.  
  7.     import * as ffmpeg from "fluent-ffmpeg";
  8.  
  9.  =============================================== */
  10.  
  11. /// <reference path="../../typings/node/node.d.ts" />
  12.  
  13. declare module Ffprobe
  14. {
  15.     interface TagData
  16.     {
  17.         [key: string]: string;
  18.     }
  19.    
  20.     interface DispositionData
  21.     {
  22.         // possible values: 0, 1
  23.         default: number;
  24.         // possible values: 0
  25.         dub: number;
  26.         // possible values: 0
  27.         original: number;
  28.         // possible values: 0
  29.         comment: number;
  30.         // possible values: 0
  31.         lyrics: number;
  32.         // possible values: 0
  33.         karaoke: number;
  34.         // possible values: 0, 1
  35.         forced: number;
  36.         // possible values: 0
  37.         hearing_impaired: number;
  38.         // possible values: 0
  39.         visual_impaired: number;
  40.         // possible values: 0
  41.         clean_effects: number;
  42.         // possible values: 0
  43.         attached_pic: number;
  44.     }
  45.    
  46.     interface StreamData
  47.     {
  48.         // possible values: 0, 1, 2, 3, 4
  49.         index: number;
  50.         // possible values: "mpeg4", "ac3", "h264", "aac", "mp3", "fraps", "pcm_s16le", "srt", "rawvideo", "pcm_s32le", "pcm_alaw", "wmav2", "wmv2", "flac", "vp8", "vorbis", "pgssub"
  51.         codec_name: string;
  52.         // possible values: "MPEG-4 part 2", "ATSC A/52A (AC-3)", "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "AAC (Advanced Audio Coding)", "MP3 (MPEG audio layer 3)", "Fraps", "PCM signed 16-bit little-endian", "SubRip subtitle", "raw video", "PCM signed 32-bit little-endian", "PCM A-law / G.711 A-law", "Windows Media Audio 2", "Windows Media Video 8", "FLAC (Free Lossless Audio Codec)", "On2 VP8", "Vorbis", "HDMV Presentation Graphic Stream subtitles"
  53.         codec_long_name: string;
  54.         // possible values: "Simple Profile", "unknown", "Constrained Baseline", "LC", "Advanced Simple Profile", "Main", "High", "Baseline", "High 10"
  55.         profile: string;
  56.         // possible values: "video", "audio", "subtitle"
  57.         codec_type: string;
  58.         // possible values: "1/25", "1/48000", "1/60", "1/44100", "1/30", "1/192000", "1/50", "1001/48000", "1/1000", "1/50000", "50/2997", "500/29917", "1/48", "1001/60000", "1001/120000", "1/24", "1001/30000", "1/60000", "1/30000", "1/15", "1/59922", "1/32000", "1/90000", "1/180000", "1/16000"
  59.         codec_time_base: string;
  60.         // possible values: "XVID", "[0] [0][0]", "avc1", "mp4a", "U[0][0][0]", "FPS1", "[1][0][0][0]", "[0][0][0][0]", "IYUV", "UYVY", "[6][0][0][0]", "DIVX", "DX50", "AVC1", "a[1][0][0]", "WMV2", "sowt", "HDMV", "AC-3", "[144][0][0][0]"
  61.         codec_tag_string: string;
  62.         // possible values: "0x44495658", "0x2000", "0x31637661", "0x6134706d", "0x0055", "0x31535046", "0x0001", "0x0000", "0x56555949", "0x59565955", "0x0006", "0x58564944", "0x30355844", "0x31435641", "0x0161", "0x32564d57", "0x74776f73", "0x564d4448", "0x332d4341", "0x0090"
  63.         codec_tag: string;
  64.         // possible values: "N/A", "0x1011", "0x1100", "0x1200"
  65.         id: string;
  66.         // possible values: "25/1", "0/0", "30/1", "30000/1001", "359/12", "24/1", "60000/1001", "24000/1001", "15/1", "29961/1000", "29917/1000", "2997/100", "21/1"
  67.         r_frame_rate: string;
  68.         // possible values: "25/1", "0/0", "3620000/120667", "30/1", "30000/1001", "3505000/116841", "474500/15833", "24/1", "60000/1001", "197386875/3293071", "102195000/1704953", "73386000/1224323", "264000/8801", "24000/1001", "15/1", "29961/1000", "358760/11971", "29917/1000", "2997/100", "4025000/192617"
  69.         avg_frame_rate: string;
  70.         // possible values: "1/25", "1/32000", "1/48000", "1/1000", "1/44100", "1/24000", "1/30", "1/192000", "1/25000", "1/15360", "1/30000", "1/90000", "1/60000", "1/48", "1/24", "1001/30000", "1/40000", "1/15", "1/29961", "1/50000", "1/29917", "1/29970", "1/16000"
  71.         time_base: string;
  72.         // possible values: 0, 1000, "-1600", 24, 6006, 3003, 1001, 2000, 2002, 93600
  73.         start_pts: number | string;
  74.         // possible values: 0, 0.04, "-0.033333", 0.024, 0.066733, 0.033367, 0.041667, 0.083417, 0.033333, 1.04
  75.         start_time: number | string;
  76.         // possible values: 6354, "N/A", 5134, 5335, 7471, 362001, 15948854, 7523, 7383, 20303, 10786, 24341, 14219, 7628, 165, 7551, 15965, 6659, 16517, 13889, 9673, 8820, 5438, 7138, 8364, 10112, 6442, 7036, 7048, 6385, 15712, 6046, 6850, 7160, 920000, 1770496, 620544, 1925696, 146880, 8688640, 4926000, 4867072, 3334331, 6375424, 4337333, 5540864, 3769766, 116841, 5150703, 158330, 6981603, 7812096, 4252000, 2342340, 1241088, 2522520, 1344512, 33513480, 17869824, 52689136, 28094464, 6666660, 3552256, 7477470, 3983360, 8918910, 4756480, 27837810, 14842880, 4675671, 2490368, 3409906, 1812480, 6121615, 3262464, 630630, 334848, 11863852, 8720384, 105612, 4655153, 37200, 34177024, 15473458, 11372544, 19311292, 14193664, 8261632, 5620615, 16122106, 14812160, 10172162, 9345024, 101, 110, 36, 98, 91, 100, 130, 25847808, 17586569, 8800256, 5987000, 6898688, 3911000, 12105728, 6890000, 22792770, 12151808, 160, 162000, 325632, 5281792, 3302299, 3420, 3298, 3414, 1713, 201, 14090076, 12944384, 3961856, 2695693, 4937728, 3355000, 3347456, 2277275, 956000, 844799, 1591200, 782288, 501000, 883712, 17463296, 11879868, 2113, 9213204, 8464384, 4981977, 9963936, 621621, 328704, 1810809, 961536, 299275, 13196263, 447000, 657408, 5885952, 3993000, 444000, 711680, 1499896, 702000, 702720, 768000, 1474560, 3135600, 3136320, 3467106, 617690
  77.         duration_ts: number | string;
  78.         // possible values: 254.16, "N/A", 205.36, 213.4, 298.84, 362.001, 361.652018, 300.92, 295.32, 812.12, 431.44, 973.64, 568.76, 305.12, 5.5, 302.04, 638.6, 266.36, 660.68, 555.56, 386.92, 352.8, 217.52, 285.52, 334.56, 404.48, 257.68, 281.44, 281.92, 255.4, 628.48, 241.84, 274, 286.4, 36.8, 36.885333, 40.4, 40.118667, 146.88, 197.021315, 197.04, 110.364444, 111.144367, 144.567438, 144.577767, 125.643175, 125.658867, 116.841, 116.795986, 158.33, 158.312993, 177.145034, 177.166667, 26.026, 25.856, 28.028, 28.010667, 372.372, 372.288, 585.434844, 585.301333, 74.074, 74.005333, 83.083, 82.986667, 99.099, 99.093333, 309.309, 309.226667, 51.9519, 51.882667, 37.887844, 37.76, 68.017944, 67.968, 7.007, 6.976, 197.730867, 197.741134, 105.612, 105.559025, 775, 774.989206, 257.890967, 257.880816, 321.854867, 321.851791, 187.338594, 187.353833, 335.877208, 335.876644, 211.920042, 211.905306, 4.04, 4.4, 1.44, 4.083333, 3.036367, 3.336667, 4.337667, 586.118095, 586.218967, 199.55229, 199.566667, 156.432834, 156.44, 274.506304, 275.6, 253.253, 253.162667, 6.666667, 6.75, 6.784, 110.037333, 110.076633, 114.114, 110.043267, 113.9138, 114.2, 8.04, 293.54325, 293.523447, 89.838005, 89.856433, 111.966621, 111.978906, 75.906032, 75.909167, 19.12, 19.15644, 17.68, 17.738957, 20.04, 20.038821, 395.993107, 395.9956, 2.113, 191.94175, 191.936145, 207.582375, 207.582, 6.9069, 6.848, 20.1201, 20.032, 299.275, 299.234989, 14.9, 14.907211, 133.468299, 133.469265, 14.814815, 14.826667, 1499.896, 7.8, 7.808, 30.72, 34.84, 34.848, 38.5234, 38.605625
  79.         duration: number | string;
  80.         // possible values: 1852202, 256000, 2569227, 829146, 384000, 1044664, 270535, 95899, 1731717, 1586138, 1104475, 2483692, 192000, 1546473, 1761655, 1773095, 279355095, 6144000, 2025392, 922588, 1728848, 1008664, 1578126, 1644263, 1140841, 2180493, 1623289, 1531830, 2262475, 2511546, 3844410, 2632761, 3493214, 1222194, 1463390, 2480590, 1346989, 6366106, 317375, 1936035, 127592, "N/A", 224000, 125477, 500433, 123159, 1944978, 119249, 624795, 125485, 530664, 217188, 93428, 1286720, 151239, 115782, 120616, 12030229, 128029, 11991343, 128116, 11981900, 128000, 12044352, 128003, 12064919, 127999, 12001121, 128009, 12025206, 128031, 11993789, 128015, 12080969, 12223455, 12092907, 5335816, 128014, 2534167, 192018, 5464002, 149159, 5299188, 150629, 2307724, 151457, 5743521, 151720, 112185, 133613, 1607011, 151622, 1863445, 151384, 279244800, 627787156, 698112000, 710948571, 1787713979, 3072000, 1005381818, 1536000, 1004377441, 6523709, 705600, 121236, 350089, 101656, 504881, 104617, 81677, 125572, 3537420, 11998423, 3085237, 3671070, 189375, 192086, 12235437, 13332803, 11675521, 1105138325, 8855662, 11004924, 5206145, 320000, 3232384, 1411200, 277862400, 1841436, 151791, 109750, 155564, 123229, 350629, 108220, 539481, 7055040, 317588, 3479319, 125704, 1322685, 189588, 123269, 76564, 40000, 185000, 1868851, 151411, 18800288, 11576333, 11988697, 936366, 125889, 9074853, 94459, 131590, 3025401, 12057179, 127596, 16744190, 95966
  81.         bit_rate: number | string;
  82.         // possible values: "N/A", 111496, 348750, 127852, 153656, 195232, 145112, 153272, 113776, 176696, 135656, 201416, 213992, 195656, 182408, 197208, 243296, 183680, 183664, 137288, 170560, 129656, 143632, 271500, 192000, 188456, 126504, 138960, 125792, 390354, 125704, 189837, 205808, 187080, 181896, 178016, 199500, 128000, 96000
  83.         max_bit_rate: number | string;
  84.         // possible values: "N/A", 8, 32, 16, 10
  85.         bits_per_raw_sample: number | string;
  86.         // possible values: 6354, 8135680, 5134, 6573056, 5335, 10246656, 7471, 9564160, 10860, 15575, 7523, 9631744, 7383, 14177280, 20303, 25990144, 10786, 10353382, 24341, 31159296, 14219, 18202624, 7628, 9765888, 165, 1056000, 7551, 9666560, 15965, 20438016, 6659, 8524800, 16517, 21141760, 13889, 17779712, 9673, 12383232, 8820, 16937472, 5438, 6963200, 7138, 13708800, 8364, 10708992, 10112, 12946432, 6442, 6182986, 7036, 13512192, 7048, 9024512, 6385, 8175616, 15712, 20114432, 6046, 7739392, 6850, 6574822, 7160, 9167872, 920, 1729, 1212, 1881, "N/A", 8485, 4926, 4753, 3331, 6226, 4333, 5411, 3766, 3505, 5030, 4745, 6818, 7629, 4252, 780, 1680, 1313, 11160, 17451, 35091, 27436, 2220, 3469, 2490, 3890, 2970, 4645, 9270, 14495, 3114, 2432, 2271, 1770, 4077, 3186, 210, 327, 5926, 8516, 3168, 4546, 18600, 33376, 7729, 11106, 9646, 13861, 8068, 5615, 8053, 14465, 5081, 9126, 101, 110, 36, 98, 196000, 91, 145746, 100, 160160, 130, 191291, 25242, 17569, 8594, 5987, 6737, 3911, 11822, 6890, 7590, 11867, 160, 215040, 162, 318, 5158, 3299, 3420, 5032427, 3298, 4852908, 3414, 4563069, 1713, 5033280, 201, 7038, 12641, 3869, 2693, 4822, 3355, 3269, 2275, 478, 825, 442, 764, 501, 863, 17054, 11868, 4602, 8266, 4977, 9963936, 414, 321, 1206, 939, 8969, 12887, 447, 642, 5748, 3993, 444, 695, 768, 1440, 805, 603
  87.         nb_frames: number | string;
  88.         // possible values: "N/A"
  89.         nb_read_frames: string;
  90.         // possible values: "N/A"
  91.         nb_read_packets: string;
  92.         disposition: DispositionData;
  93.         tags: TagData;
  94.     }
  95.    
  96.     interface VideoStreamData extends StreamData
  97.     {
  98.         // possible values: 720, 540, 1920, 512, 640, 480, 1280, 150, 320, 2000, 1728, 1440
  99.         width: number;
  100.         // possible values: 576, 360, 1200, 384, 1080, 480, 268, 720, 320, 350, 90, 270, 240, 1120, 356, 1088
  101.         height: number;
  102.         // possible values: 720, 544, 1920, 512, 640, 480, 1280, 150, 320, 2000, 1728, 1440
  103.         coded_width: number;
  104.         // possible values: 576, 368, 1200, 384, 1088, 480, 272, 720, 320, 352, 1080, 90, 240, 1120, 356
  105.         coded_height: number;
  106.         // possible values: 0, 1, 2
  107.         has_b_frames: number;
  108.         // possible values: "1:1", "0:1", "481:480", "10240:10239", "4:3"
  109.         sample_aspect_ratio: string;
  110.         // possible values: "5:4", "3:2", "0:1", "4:3", "16:9", "120:67", "48:35", "481:270", "25:14", "8:5", "16384:10239", "160:89", "30:17"
  111.         display_aspect_ratio: string;
  112.         // possible values: "yuv420p", "yuvj420p", "bgra", "uyvy422", "yuv420p10le"
  113.         pix_fmt: string;
  114.         // possible values: 3, 30, 5, "-99", 41, 31, 40, 21, 13, 1, 51, 50, 11, 42
  115.         level: number | string;
  116.         // possible values: "N/A", "pc", "tv"
  117.         color_range: string;
  118.         // possible values: "unknown", "bt709", "bt470bg"
  119.         color_space: string;
  120.         // possible values: "unknown", "bt470m", "iec61966-2-4"
  121.         color_transfer: string;
  122.         // possible values: "unknown", "bt709"
  123.         color_primaries: string;
  124.         // possible values: "left", "unspecified"
  125.         chroma_location: string;
  126.         // possible values: "N/A"
  127.         timecode: string;
  128.         // possible values: 1, 3, 4, 2, 12
  129.         refs: number;
  130.         // possible values: 0
  131.         quarter_sample?: number;
  132.         // possible values: 0
  133.         divx_packed?: number;
  134.         // possible values: "true", "false"
  135.         is_avc?: string;
  136.         // possible values: 4, 2, 0
  137.         nal_length_size?: number;
  138.     }
  139.    
  140.     interface AudioStreamData extends StreamData
  141.     {
  142.         // possible values: "fltp", "s16p", "s16", "s32"
  143.         sample_fmt: string;
  144.         // possible values: 48000, 44100, 192000, 32000, 16000
  145.         sample_rate: number;
  146.         // possible values: 2, 1
  147.         channels: number;
  148.         // possible values: "stereo", "unknown", "mono"
  149.         channel_layout: string;
  150.         // possible values: 0, 16, 32, 8
  151.         bits_per_sample: number;
  152.         // possible values: "-1"
  153.         dmix_mode?: string;
  154.         // possible values: "-1.000000"
  155.         ltrt_cmixlev?: string;
  156.         // possible values: "-1.000000"
  157.         ltrt_surmixlev?: string;
  158.         // possible values: "-1.000000"
  159.         loro_cmixlev?: string;
  160.         // possible values: "-1.000000"
  161.         loro_surmixlev?: string;
  162.     }
  163.    
  164.     interface SubtitleStreamData extends StreamData
  165.     {
  166.         // possible values: "N/A", 1920
  167.         width: number | string;
  168.         // possible values: "N/A", 1080
  169.         height: number | string;
  170.     }
  171.    
  172.     interface FormatData
  173.     {
  174.         filename: string;
  175.         // possible values: 2, 5, 1, 3
  176.         nb_streams: number;
  177.         // possible values: 0, 1
  178.         nb_programs: number;
  179.         // possible values: "avi", "mov,mp4,m4a,3gp,3g2,mj2", "matroska,webm", "asf", "mpegts"
  180.         format_name: string;
  181.         // possible values: "AVI (Audio Video Interleaved)", "QuickTime / MOV", "Matroska / WebM", "ASF (Advanced / Active Streaming Format)", "MPEG-TS (MPEG-2 Transport Stream)"
  182.         format_long_name: string;
  183.         // possible values: 0, "-0.033333", 1.04
  184.         start_time: number | string;
  185.         // possible values: 254.16, 205.36, 213.4, 298.84, 362, 300.92, 295.32, 812.12, 431.44, 973.64, 568.76, 305.12, 5.5, 302.04, 638.6, 266.36, 660.68, 555.56, 386.92, 352.8, 217.52, 285.52, 334.56, 404.48, 257.68, 281.44, 281.92, 255.4, 628.48, 241.84, 274, 286.4, 36.885333, 40.4, 146.88, 197.04, 111.143333, 144.576667, 125.658333, 116.84, 158.33, 177.166667, 26.026, 28.028, 372.372, 585.434844, 74.074, 83.083, 99.099, 309.309, 51.9519, 37.887844, 68.017944, 7.007, 197.74, 105.611667, 775, 257.89, 321.853333, 187.353333, 335.876667, 211.92, 4.04, 4.4, 1.44, 4.083333, 3.036367, 3.336667, 4.337667, 586.218333, 199.566667, 156.44, 275.6, 253.253, 6.666667, 6.784, 110.076633, 114.114, 110.043267, 113.9138, 114.2, 8.04, 293.541667, 89.855, 111.978333, 75.908333, 19.156444, 17.739, 20.04, 395.995, 2.113, 191.941667, 207.582375, 6.9069, 20.1201, 299.275, 14.907211, 133.468333, 14.826667, 276.068, 1439.563, 33.012, 1499.896, 7.808, 30.72, 34.848, 38.592
  186.         duration: number;
  187.         // possible values: 67293478, 72803810, 32656624, 48933286, 17039901, 75113908, 73070414, 138911218, 144693098, 220305764, 144025568, 77737826, 195127976, 86478210, 94710296, 66408538, 105017344, 127943304, 92338812, 67660232, 66539174, 71978396, 75168266, 127776130, 87314314, 149079280, 102130128, 120002332, 116748756, 52285174, 91784682, 57726490, 30805998, 10462421, 37602221, 15477613, 28758614, 13495228, 10352421, 4628755, 28585936, 5289637, 39579811, 42525792, 564008000, 891877194, 112965829, 126041862, 150636741, 468950129, 79414866, 58592591, 104035400, 4817909, 67446449, 74185119, 528186602, 79359280, 237280548, 5818919, 73938316, 53438088, 139627008, 342149120, 349065120, 124423584, 904759288, 349060608, 378160640, 415547904, 4052992, 34720184, 15197287, 3691843, 126257496, 384109574, 2784754, 3266868, 171055560, 186154740, 163351288, 15771587072, 132316672, 161936290, 78870132, 66304968, 277869568, 73226986, 3010874, 6670818, 6172404, 17643411, 7983693, 3808350, 10022059, 88060, 48530992, 527993947, 10136912, 30537776, 39979584, 17272651, 3816383, 5972195, 53106341, 458933255, 2354207, 421659500, 20840448, 46801441, 96337920, 81903536
  188.         size: number;
  189.         // possible values: 2118145, 2836143, 1224240, 1309952, 376572, 1996913, 1979423, 1368381, 2682979, 1810161, 2025818, 2038223, 283822510, 2290510, 1186474, 1994549, 1271627, 1842368, 1909207, 1534245, 2447192, 2016766, 1797423, 2527217, 2710782, 4237614, 2898130, 3758882, 1486109, 1729579, 2679844, 1612471, 6681462, 2071766, 2048051, 628404, 2070019, 746744, 659083, 316929, 1444372, 238854, 12166237, 12138088, 12117087, 12187551, 12200321, 12136476, 12160505, 12128974, 12228983, 12371797, 12236229, 5500681, 2728692, 5619463, 5452248, 2461802, 5897855, 248468, 1761082, 2017292, 276489124, 622089309, 691218059, 691242133, 1772589770, 691209124, 996350283, 996318551, 7474971, 473819, 609211, 188792, 3664949, 12133623, 3341704, 3852438, 12431743, 13529101, 11871823, 1105672367, 9619247, 11772554, 5538934, 4644831, 276487132, 1995682, 268065, 476579, 650511, 7368136, 3600515, 1520299, 202468, 333402, 2022739, 20348315, 11741200, 12142196, 1068704, 9269420, 228751, 3222407, 1538935, 2550403, 570509, 2249006, 21352918, 12187875, 22116143, 16978344
  190.         bit_rate: number;
  191.         // possible values: 100
  192.         probe_score: number;
  193.         tags: TagData;
  194.     }
  195.    
  196.     interface Metadata
  197.     {
  198.         streams: StreamData[];
  199.         format: FormatData;
  200.     }
  201.    
  202.     interface Callback<T>
  203.     {
  204.         (err: any, ffprobeData: Ffprobe.Metadata): T;
  205.     }
  206. }
  207.  
  208. declare module Ffmpeg
  209. {
  210.     interface CommandOptions
  211.     {
  212.         /**
  213.          * input file name or readable stream (ignored if an input file is passed to the constructor)
  214.          */
  215.         source?: string | NodeJS.ReadableStream;
  216.         /**
  217.          * ffmpeg timeout in seconds (defaults to no timeout)
  218.          */
  219.         timeout?: number;
  220.         /**
  221.          * directory to load module presets from (defaults to `lib/presets` directory in fluent-ffmpeg tree)
  222.          */
  223.         presets?: string;
  224.         /**
  225.          * @see presets
  226.          */
  227.         preset?: string;
  228.         /**
  229.          * ffmpeg niceness value, between -20 and 20; ignored on Windows platforms (default to 0)
  230.          */
  231.         niceness?: number;
  232.         /**
  233.          * @see niceness
  234.          */
  235.         priority?: number;
  236.         /**
  237.          * logger object with `debug()`, `info()`, `warn()` and `error()` methods (defaults to no logging)
  238.          */
  239.         logger?: {
  240.             debug: Function;
  241.             info: Function;
  242.             warn: Function;
  243.             error: Function;
  244.         };
  245.     }
  246.    
  247.     interface FilterData
  248.     {
  249.         [key: string]: {
  250.             description: string;   
  251.             input: string; 
  252.             multipleInputs: boolean;   
  253.             output: string;
  254.             multipleOutputs: boolean;
  255.         };
  256.     }
  257.     interface FilterCallback<T>
  258.     {
  259.         (err: any, filters: FilterData): T;
  260.     }
  261.    
  262.     interface CodecData
  263.     {
  264.         [key: string]: {
  265.             description: string;
  266.             canDecode: boolean;
  267.             canEncode: boolean;
  268.         };
  269.     }
  270.     interface CodecCallback<T>
  271.     {
  272.         (err: any, codecs: CodecData): T;
  273.     }
  274.    
  275.     interface EncoderData
  276.     {
  277.         [key: string]: {
  278.             description: string;
  279.             type: boolean;
  280.             frameMT: boolean;
  281.             sliceMT: boolean;
  282.             experimental: boolean;
  283.             drawHorizBand: boolean;
  284.             directRendering: boolean;
  285.         };
  286.     }
  287.     interface EncoderCallback<T>
  288.     {
  289.         (err: any, encoders: EncoderData): T;
  290.     }
  291.    
  292.     interface FormatData
  293.     {
  294.         [key: string]: {
  295.             description: string;
  296.             canDemux: boolean;
  297.             canMux: boolean;
  298.         };
  299.     }
  300.     interface FormatCallback<T>
  301.     {
  302.         (err: any, formats: FormatData): T;
  303.     }
  304.    
  305.     /**
  306.      * If multiple timemarks are passed and no variable format token ('%s' or '%i') is specified in the filename pattern, _%i will be added automatically.
  307.      */
  308.     interface ScreenshotsConfig
  309.     {
  310.         /**
  311.          * Output folder for generated image files.
  312.          * Defaults to the current folder.
  313.          */
  314.         folder?: string;
  315.         /**
  316.          * Output filename pattern.
  317.          * Defaults to "tn.png".
  318.          *
  319.          * The `filename` option specifies a filename pattern for generated files.
  320.          * It may contain the following format tokens:
  321.          *  - '%s': offset in seconds
  322.          *  - '%w': screenshot width
  323.          *  - '%h': screenshot height
  324.          *  - '%r': screenshot resolution (same as '%wx%h')
  325.          *  - '%f': input filename
  326.          *  - '%b': input basename (filename w/o extension)
  327.          *  - '%i': index of screenshot in timemark array (can be zero-padded by using it like %000i)
  328.          */
  329.         filename?: string;
  330.         /**
  331.          * Specifies how many thumbnails to generate.
  332.          * When using this option, thumbnails are generated at regular intervals in the video (for example, when requesting 3 thumbnails, at 25%, 50% and 75% of the video length).
  333.          * `count` is ignored when `timemarks` or `timestamps` is specified.
  334.          */
  335.         count?: number;
  336.         /**
  337.          * Specifies an array of timestamps in the video where thumbnails should be taken.
  338.          * Each timestamp may be a number (in seconds), a percentage string (eg. "50%") or a timestamp string with format "hh:mm:ss.xxx" (where hours, minutes and milliseconds are both optional).
  339.          */
  340.         timestamps?: number[] | string[];
  341.         /**
  342.          * @see timestamps
  343.          */
  344.         timemarks?: number[] | string[];
  345.         /**
  346.          * Specifies a target size for thumbnails (with the same format as the `.size()` method).
  347.          * *Note:* you should not use the `.size()` method when generating thumbnails.
  348.          */
  349.         size?: string;
  350.     }
  351.    
  352.     interface FilterObject
  353.     {
  354.         filter: string;
  355.         options?: string | string[] | { [key: string]: string };
  356.     }
  357.    
  358.     interface FilterSpecification
  359.     {
  360.         filter: string;
  361.         inputs?: string | string[];
  362.         outputs?: string | string[];
  363.         options?: string | string | any;
  364.     }
  365.    
  366.     interface CodecDataEventData
  367.     {
  368.         format: string;
  369.         audio: string;
  370.         video: string;
  371.         duration: string;
  372.         audio_details: string[];
  373.         video_details: string[];
  374.     }
  375.    
  376.     interface ProgressEventData
  377.     {
  378.         frames: number;
  379.         currentFps: number;
  380.         currentKbps: number;
  381.         targetSize: number;
  382.         timemark: string;
  383.         percent: number;
  384.     }
  385.    
  386.     interface Command extends NodeJS.EventEmitter
  387.     {
  388.         /**
  389.         * Clone an ffmpeg command
  390.         *
  391.         * This method is useful when you want to process the same input multiple times.
  392.         * It returns a new FfmpegCommand instance with the exact same options.
  393.         *
  394.         * All options set _after_ the clone() call will only be applied to the instance
  395.         * it has been called on.
  396.         *
  397.         * @example
  398.         *   var command = ffmpeg('/path/to/source.avi')
  399.         *     .audioCodec('libfaac')
  400.         *     .videoCodec('libx264')
  401.         *     .format('mp4');
  402.         *
  403.         *   command.clone()
  404.         *     .size('320x200')
  405.         *     .save('/path/to/output-small.mp4');
  406.         *
  407.         *   command.clone()
  408.         *     .size('640x400')
  409.         *     .save('/path/to/output-medium.mp4');
  410.         *
  411.         *   command.save('/path/to/output-original-size.mp4');
  412.         *
  413.         * @method FfmpegCommand#clone
  414.         * @return FfmpegCommand
  415.         */
  416.         clone(): Command;
  417.        
  418.        
  419.        
  420.         /**
  421.         * ==================
  422.         * file: ./ffprobe.js
  423.         * ==================
  424.         */
  425.        
  426.         /**
  427.         * A callback passed to the {@link FfmpegCommand#ffprobe} method.
  428.         *
  429.         * @callback FfmpegCommand~ffprobeCallback
  430.         *
  431.         * @param {Error|null} err error object or null if no error happened
  432.         * @param {Object} ffprobeData ffprobe output data; this object
  433.         *   has the same format as what the following command returns:
  434.         *
  435.         *     `ffprobe -print_format json -show_streams -show_format INPUTFILE`
  436.         * @param {Array} ffprobeData.streams stream information
  437.         * @param {Object} ffprobeData.format format information
  438.         */
  439.        
  440.         /**
  441.         * Run ffprobe on last specified input
  442.         *
  443.         * @method FfmpegCommand#ffprobe
  444.         * @category Metadata
  445.         *
  446.         * @param {FfmpegCommand~ffprobeCallback} callback callback function
  447.         *
  448.         */
  449.         ffprobe<T>(callback: Ffprobe.Callback<T>): T;
  450.        
  451.         /**
  452.         * Run ffprobe on last specified input
  453.         *
  454.         * @method FfmpegCommand#ffprobe
  455.         * @category Metadata
  456.         *
  457.         * @param {Number} [index] 0-based index of input to probe (defaults to last input)
  458.         * @param {FfmpegCommand~ffprobeCallback} callback callback function
  459.         *
  460.         */
  461.         ffprobe<T>(index: number, callback: Ffprobe.Callback<T>): T;
  462.        
  463.        
  464.        
  465.         /**
  466.         * ===================
  467.         * file: ./receipes.js
  468.         * ===================
  469.         */
  470.        
  471.         /**
  472.         * Execute ffmpeg command and save output to a file
  473.         *
  474.         * @method FfmpegCommand#save
  475.         * @category Processing
  476.         * @aliases saveToFile
  477.         *
  478.         * @param {String} output file path
  479.         * @return FfmpegCommand
  480.         */
  481.         save(output: string): Command;
  482.        
  483.         /**
  484.         * @see FfmpegCommand.saveToFile
  485.         */
  486.         saveToFile(output: string): Command;
  487.        
  488.         /**
  489.         * Execute ffmpeg command and save output to a stream
  490.         *
  491.         * If 'stream' is not specified, a PassThrough stream is created and returned.
  492.         * 'options' will be used when piping ffmpeg output to the output stream
  493.         * (@see http://nodejs.org/api/stream.html#stream_readable_pipe_destination_options)
  494.         *
  495.         * @method FfmpegCommand#pipe
  496.         * @category Processing
  497.         * @aliases stream,writeToStream
  498.         *
  499.         * @param {stream.Writable} [stream] output stream
  500.         * @param {Object} [options={}] pipe options
  501.         * @return Output stream
  502.         */
  503.         pipe(stream?: NodeJS.WritableStream, options?);
  504.        
  505.         /**
  506.         * @see FfmpegCommand.pipe
  507.         */
  508.         writeToStream(stream?, options?);
  509.        
  510.         /**
  511.         * @see FfmpegCommand.pipe
  512.         */
  513.         stream(stream?, options?);
  514.        
  515.         /**
  516.         * Generate images from a video
  517.         *
  518.         * Note: this method makes the command emit a 'filenames' event with an array of
  519.         * the generated image filenames.
  520.         *
  521.         * @method FfmpegCommand#screenshots
  522.         * @category Processing
  523.         * @aliases takeScreenshots,thumbnail,thumbnails,screenshot
  524.         *
  525.         * @param {Number|Object} [config=1] screenshot count or configuration object with
  526.         *   the following keys:
  527.         * @param {Number} [config.count] number of screenshots to take; using this option
  528.         *   takes screenshots at regular intervals (eg. count=4 would take screens at 20%, 40%,
  529.         *   60% and 80% of the video length).
  530.         * @param {String} [config.folder='.'] output folder
  531.         * @param {String} [config.filename='tn.png'] output filename pattern, may contain the following
  532.         *   tokens:
  533.         *   - '%s': offset in seconds
  534.         *   - '%w': screenshot width
  535.         *   - '%h': screenshot height
  536.         *   - '%r': screenshot resolution (same as '%wx%h')
  537.         *   - '%f': input filename
  538.         *   - '%b': input basename (filename w/o extension)
  539.         *   - '%i': index of screenshot in timemark array (can be zero-padded by using it like `%000i`)
  540.         * @param {Number[]|String[]} [config.timemarks] array of timemarks to take screenshots
  541.         *   at; each timemark may be a number of seconds, a '[[hh:]mm:]ss[.xxx]' string or a
  542.         *   'XX%' string.  Overrides 'count' if present.
  543.         * @param {Number[]|String[]} [config.timestamps] alias for 'timemarks'
  544.         * @param {Boolean} [config.fastSeek] use fast seek (less accurate)
  545.         * @param {String} [config.size] screenshot size, with the same syntax as {@link FfmpegCommand#size}
  546.         * @param {String} [folder] output folder (legacy alias for 'config.folder')
  547.         * @return FfmpegCommand
  548.         */
  549.         screenshots(config?: number | ScreenshotsConfig, folder?: string): Command;
  550.        
  551.         /**
  552.         * @see FfmpegCommand.screenshots
  553.         */
  554.         takeScreenshots(config?: number | ScreenshotsConfig, folder?: string): Command;
  555.        
  556.         /**
  557.         * @see FfmpegCommand.screenshots
  558.         */
  559.         thumbnail(config?: number | ScreenshotsConfig, folder?: string): Command;
  560.        
  561.         /**
  562.         * @see FfmpegCommand.screenshots
  563.         */
  564.         thumbnails(config?: number | ScreenshotsConfig, folder?: string): Command;
  565.        
  566.         /**
  567.         * @see FfmpegCommand.screenshots
  568.         */
  569.         screenshot(config?: number | ScreenshotsConfig, folder?: string): Command;
  570.        
  571.         /**
  572.         * Merge (concatenate) inputs to a single file
  573.         *
  574.         * @method FfmpegCommand#concat
  575.         * @category Processing
  576.         * @aliases concatenate,mergeToFile
  577.         *
  578.         * @param {String|Writable} target output file or writable stream
  579.         * @param {Object} [options] pipe options (only used when outputting to a writable stream)
  580.         * @return FfmpegCommand
  581.         */
  582.         concat(target: string | NodeJS.WritableStream, options?): Command;
  583.        
  584.         /**
  585.         * @see FfmpegCommand.concat
  586.         */
  587.         mergeToFile(target: string | NodeJS.WritableStream, options?): Command;
  588.        
  589.         /**
  590.         * @see FfmpegCommand.concat
  591.         */
  592.         concatenate(target: string | NodeJS.WritableStream, options?): Command;
  593.        
  594.        
  595.        
  596.         /**
  597.         * ====================
  598.         * file: ./processor.js
  599.         * ====================
  600.         */
  601.        
  602.         /**
  603.         * Run ffmpeg command
  604.         *
  605.         * @method FfmpegCommand#run
  606.         * @category Processing
  607.         * @aliases exec,execute
  608.         */
  609.         run(): void;
  610.        
  611.         /**
  612.         * @see FfmpegCommand.run
  613.         */
  614.         exec(): void;
  615.        
  616.         /**
  617.         * @see FfmpegCommand.run
  618.         */
  619.         execute(): void;
  620.        
  621.         /**
  622.         * Renice current and/or future ffmpeg processes
  623.         *
  624.         * Ignored on Windows platforms.
  625.         *
  626.         * @method FfmpegCommand#renice
  627.         * @category Processing
  628.         *
  629.         * @param {Number} [niceness=0] niceness value between -20 (highest priority) and 20 (lowest priority)
  630.         * @return FfmpegCommand
  631.         */
  632.         renice(niceness?: number): Command;
  633.        
  634.         /**
  635.         * Kill current ffmpeg process, if any
  636.         *
  637.         * @method FfmpegCommand#kill
  638.         * @category Processing
  639.         *
  640.         * @param {String} [signal=SIGKILL] signal name
  641.         * @return FfmpegCommand
  642.         */
  643.         kill(signal?: string): Command;
  644.        
  645.        
  646.        
  647.         /**
  648.         * =======================
  649.         * file: ./capabilities.js
  650.         * =======================
  651.         */
  652.        
  653.         /**
  654.         * Manually define the ffmpeg binary full path.
  655.         *
  656.         * @method FfmpegCommand#setFfmpegPath
  657.         *
  658.         * @param {String} ffmpegPath The full path to the ffmpeg binary.
  659.         * @return FfmpegCommand
  660.         */
  661.         setFfmpegPath(ffmpegPath: string): Command;
  662.        
  663.         /**
  664.         * Manually define the ffprobe binary full path.
  665.         *
  666.         * @method FfmpegCommand#setFfprobePath
  667.         *
  668.         * @param {String} ffprobePath The full path to the ffprobe binary.
  669.         * @return FfmpegCommand
  670.         */
  671.         setFfprobePath(ffprobePath: string): Command;
  672.        
  673.         /**
  674.         * Manually define the flvtool2/flvmeta binary full path.
  675.         *
  676.         * @method FfmpegCommand#setFlvtoolPath
  677.         *
  678.         * @param {String} flvtool The full path to the flvtool2 or flvmeta binary.
  679.         * @return FfmpegCommand
  680.         */
  681.         setFlvtoolPath(flvtool: string): Command;
  682.        
  683.         /**
  684.         * A callback passed to {@link FfmpegCommand#availableFilters}.
  685.         *
  686.         * @callback FfmpegCommand~filterCallback
  687.         * @param {Error|null} err error object or null if no error happened
  688.         * @param {Object} filters filter object with filter names as keys and the following
  689.         *   properties for each filter:
  690.         * @param {String} filters.description filter description
  691.         * @param {String} filters.input input type, one of 'audio', 'video' and 'none'
  692.         * @param {Boolean} filters.multipleInputs whether the filter supports multiple inputs
  693.         * @param {String} filters.output output type, one of 'audio', 'video' and 'none'
  694.         * @param {Boolean} filters.multipleOutputs whether the filter supports multiple outputs
  695.         */
  696.        
  697.         /**
  698.         * Query ffmpeg for available filters
  699.         *
  700.         * @method FfmpegCommand#availableFilters
  701.         * @category Capabilities
  702.         * @aliases getAvailableFilters
  703.         *
  704.         * @param {FfmpegCommand~filterCallback} callback callback function
  705.         */
  706.         availableFilters<T>(callback: FilterCallback<T>): T;
  707.        
  708.         /**
  709.         * @see FfmpegCommand.availableFilters
  710.         */
  711.         getAvailableFilters<T>(callback: FilterCallback<T>): T;
  712.        
  713.         /**
  714.         * A callback passed to {@link FfmpegCommand#availableCodecs}.
  715.         *
  716.         * @callback FfmpegCommand~codecCallback
  717.         * @param {Error|null} err error object or null if no error happened
  718.         * @param {Object} codecs codec object with codec names as keys and the following
  719.         *   properties for each codec (more properties may be available depending on the
  720.         *   ffmpeg version used):
  721.         * @param {String} codecs.description codec description
  722.         * @param {Boolean} codecs.canDecode whether the codec is able to decode streams
  723.         * @param {Boolean} codecs.canEncode whether the codec is able to encode streams
  724.         */
  725.    
  726.         /**
  727.         * Query ffmpeg for available codecs
  728.         *
  729.         * @method FfmpegCommand#availableCodecs
  730.         * @category Capabilities
  731.         * @aliases getAvailableCodecs
  732.         *
  733.         * @param {FfmpegCommand~codecCallback} callback callback function
  734.         */
  735.         availableCodecs<T>(callback: CodecCallback<T>): T;
  736.        
  737.         /**
  738.         * @see FfmpegCommand.availableCodecs
  739.         */
  740.         getAvailableCodecs<T>(callback: CodecCallback<T>): T;
  741.        
  742.         /**
  743.         * A callback passed to {@link FfmpegCommand#availableEncoders}.
  744.         *
  745.         * @callback FfmpegCommand~encodersCallback
  746.         * @param {Error|null} err error object or null if no error happened
  747.         * @param {Object} encoders encoders object with encoder names as keys and the following
  748.         *   properties for each encoder:
  749.         * @param {String} encoders.description codec description
  750.         * @param {Boolean} encoders.type "audio", "video" or "subtitle"
  751.         * @param {Boolean} encoders.frameMT whether the encoder is able to do frame-level multithreading
  752.         * @param {Boolean} encoders.sliceMT whether the encoder is able to do slice-level multithreading
  753.         * @param {Boolean} encoders.experimental whether the encoder is experimental
  754.         * @param {Boolean} encoders.drawHorizBand whether the encoder supports draw_horiz_band
  755.         * @param {Boolean} encoders.directRendering whether the encoder supports direct encoding method 1
  756.         */
  757.    
  758.         /**
  759.         * Query ffmpeg for available encoders
  760.         *
  761.         * @method FfmpegCommand#availableEncoders
  762.         * @category Capabilities
  763.         * @aliases getAvailableEncoders
  764.         *
  765.         * @param {FfmpegCommand~encodersCallback} callback callback function
  766.         */
  767.         availableEncoders<T>(callback: EncoderCallback<T>): T;
  768.        
  769.         /**
  770.         * @see FfmpegCommand.availableEncoders
  771.         */
  772.         getAvailableEncoders<T>(callback: EncoderCallback<T>): T;
  773.        
  774.         /**
  775.         * A callback passed to {@link FfmpegCommand#availableFormats}.
  776.         *
  777.         * @callback FfmpegCommand~formatCallback
  778.         * @param {Error|null} err error object or null if no error happened
  779.         * @param {Object} formats format object with format names as keys and the following
  780.         *   properties for each format:
  781.         * @param {String} formats.description format description
  782.         * @param {Boolean} formats.canDemux whether the format is able to demux streams from an input file
  783.         * @param {Boolean} formats.canMux whether the format is able to mux streams into an output file
  784.         */
  785.    
  786.         /**
  787.         * Query ffmpeg for available formats
  788.         *
  789.         * @method FfmpegCommand#availableFormats
  790.         * @category Capabilities
  791.         * @aliases getAvailableFormats
  792.         *
  793.         * @param {FfmpegCommand~formatCallback} callback callback function
  794.         */
  795.         availableFormats<T>(callback: FormatCallback<T>): T;
  796.        
  797.         /**
  798.         * @see FfmpegCommand.availableFormats
  799.         */
  800.         getAvailableFormats<T>(callback: FormatCallback<T>): T;
  801.        
  802.        
  803.        
  804.         /**
  805.         * ========================
  806.         * file: ./options/input.js
  807.         * ========================
  808.         */
  809.        
  810.         /**
  811.         * Add an input to command
  812.         *
  813.         * Also switches "current input", that is the input that will be affected
  814.         * by subsequent input-related methods.
  815.         *
  816.         * Note: only one stream input is supported for now.
  817.         *
  818.         * @method FfmpegCommand#input
  819.         * @category Input
  820.         * @aliases mergeAdd,addInput
  821.         *
  822.         * @param {String|Readable} source input file path or readable stream
  823.         * @return FfmpegCommand
  824.         */
  825.         input(source: string | NodeJS.ReadableStream): Command;
  826.        
  827.         /**
  828.         * @see FfmpegCommand.input
  829.         */
  830.         mergeAdd(source: string | NodeJS.ReadableStream): Command;
  831.        
  832.         /**
  833.         * @see FfmpegCommand.input
  834.         */
  835.         addInput(source: string | NodeJS.ReadableStream): Command;
  836.        
  837.         /**
  838.         * Specify input format for the last specified input
  839.         *
  840.         * @method FfmpegCommand#inputFormat
  841.         * @category Input
  842.         * @aliases withInputFormat,fromFormat
  843.         *
  844.         * @param {String} format input format
  845.         * @return FfmpegCommand
  846.         */
  847.         inputFormat(format: string): Command;
  848.        
  849.         /**
  850.         * @see FfmpegCommand.inputFormat
  851.         */
  852.         withInputFormat(format: string): Command;
  853.        
  854.         /**
  855.         * @see FfmpegCommand.inputFormat
  856.         */
  857.         fromFormat(format: string): Command;
  858.        
  859.         /**
  860.         * Specify input FPS for the last specified input
  861.         * (only valid for raw video formats)
  862.         *
  863.         * @method FfmpegCommand#inputFps
  864.         * @category Input
  865.         * @aliases withInputFps,withInputFPS,withFpsInput,withFPSInput,inputFPS,inputFps,fpsInput
  866.         *
  867.         * @param {Number} fps input FPS
  868.         * @return FfmpegCommand
  869.         */
  870.         FPSInput(fps: number): Command;
  871.        
  872.         /**
  873.         * @see FfmpegCommand.FPSInput
  874.         */
  875.         withInputFps(fps: number): Command;
  876.        
  877.         /**
  878.         * @see FfmpegCommand.FPSInput
  879.         */
  880.         withInputFPS(fps: number): Command;
  881.        
  882.         /**
  883.         * @see FfmpegCommand.FPSInput
  884.         */
  885.         withFpsInput(fps: number): Command;
  886.        
  887.         /**
  888.         * @see FfmpegCommand.FPSInput
  889.         */
  890.         withFPSInput(fps: number): Command;
  891.        
  892.         /**
  893.         * @see FfmpegCommand.FPSInput
  894.         */
  895.         inputFPS(fps: number): Command;
  896.        
  897.         /**
  898.         * @see FfmpegCommand.FPSInput
  899.         */
  900.         inputFps(fps: number): Command;
  901.        
  902.         /**
  903.         * @see FfmpegCommand.FPSInput
  904.         */
  905.         fpsInput(fps: number): Command;
  906.        
  907.         /**
  908.         * Use native framerate for the last specified input
  909.         *
  910.         * @method FfmpegCommand#native
  911.         * @category Input
  912.         * @aliases nativeFramerate,withNativeFramerate
  913.         *
  914.         * @return FfmmegCommand
  915.         */
  916.         native(): Command;
  917.        
  918.         /**
  919.         * @see FfmpegCommand.native
  920.         */
  921.         nativeFramerate(): Command;
  922.        
  923.         /**
  924.         * @see FfmpegCommand.native
  925.         */
  926.         withNativeFramerate(): Command;
  927.        
  928.         /**
  929.         * Specify input seek time for the last specified input
  930.         *
  931.         * @method FfmpegCommand#seekInput
  932.         * @category Input
  933.         * @aliases setStartTime,seekTo
  934.         *
  935.         * @param {String|Number} seek seek time in seconds or as a '[hh:[mm:]]ss[.xxx]' string
  936.         * @return FfmpegCommand
  937.         */
  938.         seekInput(seek: string | number): Command;
  939.        
  940.         /**
  941.         * @see FfmpegCommand.seekInput
  942.         */
  943.         setStartTime(seek: string | number): Command;
  944.        
  945.         /**
  946.         * Loop over the last specified input
  947.         *
  948.         * @method FfmpegCommand#loop
  949.         * @category Input
  950.         *
  951.         * @param {String|Number} [duration] loop duration in seconds or as a '[[hh:]mm:]ss[.xxx]' string
  952.         * @return FfmpegCommand
  953.         */
  954.         loop(duration?: string | number): Command;
  955.        
  956.        
  957.        
  958.         /**
  959.         * ========================
  960.         * file: ./options/audio.js
  961.         * ========================
  962.         */
  963.        
  964.         /**
  965.         * Disable audio in the output
  966.         *
  967.         * @method FfmpegCommand#noAudio
  968.         * @category Audio
  969.         * @aliases withNoAudio
  970.         * @return FfmpegCommand
  971.         */
  972.         noAudio(): Command;
  973.        
  974.         /**
  975.         * @see FfmpegCommand.noAudio
  976.         */
  977.         withNoAudio(): Command;
  978.        
  979.         /**
  980.         * Specify audio codec
  981.         *
  982.         * @method FfmpegCommand#audioCodec
  983.         * @category Audio
  984.         * @aliases withAudioCodec
  985.         *
  986.         * @param {String} codec audio codec name
  987.         * @return FfmpegCommand
  988.         */
  989.         audioCodec(codec: string): Command;
  990.        
  991.         /**
  992.         * @see FfmpegCommand.audioCodec
  993.         */
  994.         withAudioCodec(codec: string): Command;
  995.        
  996.         /**
  997.         * Specify audio bitrate
  998.         *
  999.         * @method FfmpegCommand#audioBitrate
  1000.         * @category Audio
  1001.         * @aliases withAudioBitrate
  1002.         *
  1003.         * @param {String|Number} bitrate audio bitrate in kbps (with an optional 'k' suffix)
  1004.         * @return FfmpegCommand
  1005.         */
  1006.         audioBitrate(bitrate: string | number): Command;
  1007.        
  1008.         /**
  1009.         * @see FfmpegCommand.audioBitrate
  1010.         */
  1011.         withAudioBitrate(bitrate: string | number): Command;
  1012.        
  1013.         /**
  1014.         * Specify audio channel count
  1015.         *
  1016.         * @method FfmpegCommand#audioChannels
  1017.         * @category Audio
  1018.         * @aliases withAudioChannels
  1019.         *
  1020.         * @param {Number} channels channel count
  1021.         * @return FfmpegCommand
  1022.         */
  1023.         audioChannels(channels: number): Command;
  1024.        
  1025.         /**
  1026.         * @see FfmpegCommand.audioChannels
  1027.         */
  1028.         withAudioChannels(channels: number): Command;
  1029.        
  1030.         /**
  1031.         * Specify audio frequency
  1032.         *
  1033.         * @method FfmpegCommand#audioFrequency
  1034.         * @category Audio
  1035.         * @aliases withAudioFrequency
  1036.         *
  1037.         * @param {Number} freq audio frequency in Hz
  1038.         * @return FfmpegCommand
  1039.         */
  1040.         audioFrequency(freq: number): Command;
  1041.        
  1042.         /**
  1043.         * @see FfmpegCommand.audioFrequency
  1044.         */
  1045.         withAudioFrequency(freq: number): Command;
  1046.        
  1047.         /**
  1048.         * Specify audio quality
  1049.         *
  1050.         * @method FfmpegCommand#audioQuality
  1051.         * @category Audio
  1052.         * @aliases withAudioQuality
  1053.         *
  1054.         * @param {Number} quality audio quality factor
  1055.         * @return FfmpegCommand
  1056.         */
  1057.         audioQuality(quality: number): Command;
  1058.        
  1059.         /**
  1060.         * @see FfmpegCommand.audioQuality
  1061.         */
  1062.         withAudioQuality(quality: number): Command;
  1063.        
  1064.         /**
  1065.         * Specify custom audio filter(s)
  1066.         *
  1067.         * Can be called both with one or many filters, or a filter array.
  1068.         *
  1069.         * @example
  1070.         * command.audioFilters('filter1');
  1071.         *
  1072.         * @example
  1073.         * command.audioFilters('filter1', 'filter2=param1=value1:param2=value2');
  1074.         *
  1075.         * @method FfmpegCommand#audioFilters
  1076.         * @aliases withAudioFilter,withAudioFilters,audioFilter
  1077.         * @category Audio
  1078.         *
  1079.         * @param {...String} filters audio filter strings
  1080.         * @return FfmpegCommand
  1081.         */
  1082.         audioFilters(...filters: string[]): Command;
  1083.        
  1084.         /**
  1085.         * Specify custom audio filter(s)
  1086.         *
  1087.         * Can be called both with one or many filters, or a filter array.
  1088.         *
  1089.         * @example
  1090.         * command.audioFilters(
  1091.         *   {
  1092.         *     filter: 'filter1',
  1093.         *     options: ['value1', 'value2']
  1094.         *   },
  1095.         *   {
  1096.         *     filter: 'filter2',
  1097.         *     options: { param1: 'value1', param2: 'value2' }
  1098.         *   }
  1099.         * );
  1100.         *
  1101.         * @method FfmpegCommand#audioFilters
  1102.         * @aliases withAudioFilter,withAudioFilters,audioFilter
  1103.         * @category Audio
  1104.         *
  1105.         * @param {...Object} filters audio filter specifications with the following properties:
  1106.         * @param {String} filters.filter filter name
  1107.         * @param {String|String[]|Object} [filters.options] filter option string, array, or object
  1108.         * @return FfmpegCommand
  1109.         */
  1110.         audioFilters(...filters: FilterObject[]): Command;
  1111.        
  1112.         /**
  1113.         * Specify custom audio filter(s)
  1114.         *
  1115.         * Can be called both with one or many filters, or a filter array.
  1116.         *
  1117.         * @example
  1118.         * command.audioFilters(['filter1', 'filter2']);
  1119.         *
  1120.         * @example
  1121.         * command.audioFilters([
  1122.         *   {
  1123.         *     filter: 'filter1'
  1124.         *   },
  1125.         *   {
  1126.         *     filter: 'filter2',
  1127.         *     options: 'param=value:param=value'
  1128.         *   }
  1129.         * ]);
  1130.         *
  1131.         * @method FfmpegCommand#audioFilters
  1132.         * @aliases withAudioFilter,withAudioFilters,audioFilter
  1133.         * @category Audio
  1134.         *
  1135.         * @param {String[]|Object[]} filters audio filter string array or specification array, each with the following properties:
  1136.         * @param {String} filters.filter filter name
  1137.         * @param {String|String[]|Object} [filters.options] filter option string, array, or object
  1138.         * @return FfmpegCommand
  1139.         */
  1140.         audioFilters(filters: string[] | FilterObject[]): Command;
  1141.        
  1142.         /**
  1143.         * @see FfmpegCommand.audioFilters
  1144.         */
  1145.         withAudioFilter(...filters: string[]): Command;
  1146.        
  1147.         /**
  1148.         * @see FfmpegCommand.audioFilters
  1149.         */
  1150.         withAudioFilter(filters: string[]): Command;
  1151.        
  1152.         /**
  1153.         * @see FfmpegCommand.audioFilters
  1154.         */
  1155.         withAudioFilter(...filters: FilterObject[]): Command;
  1156.        
  1157.         /**
  1158.         * @see FfmpegCommand.audioFilters
  1159.         */
  1160.         withAudioFilter(filters: FilterObject[]): Command;
  1161.        
  1162.         /**
  1163.         * @see FfmpegCommand.audioFilters
  1164.         */
  1165.         withAudioFilters(...filters: string[]): Command;
  1166.        
  1167.         /**
  1168.         * @see FfmpegCommand.audioFilters
  1169.         */
  1170.         withAudioFilters(filters: string[]): Command;
  1171.        
  1172.         /**
  1173.         * @see FfmpegCommand.audioFilters
  1174.         */
  1175.         withAudioFilters(...filters: FilterObject[]): Command;
  1176.        
  1177.         /**
  1178.         * @see FfmpegCommand.audioFilters
  1179.         */
  1180.         withAudioFilters(filters: FilterObject[]): Command;
  1181.        
  1182.         /**
  1183.         * @see FfmpegCommand.audioFilters
  1184.         */
  1185.         audioFilter(...filters: string[]): Command;
  1186.        
  1187.         /**
  1188.         * @see FfmpegCommand.audioFilters
  1189.         */
  1190.         audioFilter(filters: string[]): Command;
  1191.        
  1192.         /**
  1193.         * @see FfmpegCommand.audioFilters
  1194.         */
  1195.         audioFilter(...filters: FilterObject[]): Command;
  1196.        
  1197.         /**
  1198.         * @see FfmpegCommand.audioFilters
  1199.         */
  1200.         audioFilter(filters: FilterObject[]): Command;
  1201.        
  1202.        
  1203.        
  1204.         /**
  1205.         * ========================
  1206.         * file: ./options/video.js
  1207.         * ========================
  1208.         */
  1209.        
  1210.         /**
  1211.         * Disable video in the output
  1212.         *
  1213.         * @method FfmpegCommand#noVideo
  1214.         * @category Video
  1215.         * @aliases withNoVideo
  1216.         *
  1217.         * @return FfmpegCommand
  1218.         */
  1219.         noVideo(): Command;
  1220.        
  1221.         /**
  1222.         * @see FfmpegCommand.noVideo
  1223.         */
  1224.         withNoVideo(): Command;
  1225.        
  1226.         /**
  1227.         * Specify video codec
  1228.         *
  1229.         * @method FfmpegCommand#videoCodec
  1230.         * @category Video
  1231.         * @aliases withVideoCodec
  1232.         *
  1233.         * @param {String} codec video codec name
  1234.         * @return FfmpegCommand
  1235.         */
  1236.         videoCodec(codec: string): Command;
  1237.        
  1238.         /**
  1239.         * @see FfmpegCommand.videoCodec
  1240.         */
  1241.         withVideoCodec(codec: string): Command;
  1242.        
  1243.         /**
  1244.         * Specify video bitrate
  1245.         *
  1246.         * @method FfmpegCommand#videoBitrate
  1247.         * @category Video
  1248.         * @aliases withVideoBitrate
  1249.         *
  1250.         * @param {String|Number} bitrate video bitrate in kbps (with an optional 'k' suffix)
  1251.         * @param {Boolean} [constant=false] enforce constant bitrate
  1252.         * @return FfmpegCommand
  1253.         */
  1254.         videoBitrate(bitrate: string | number, constant? : boolean): Command;
  1255.        
  1256.         /**
  1257.         * @see FfmpegCommand.videoBitrate
  1258.         */
  1259.         withVideoBitrate(bitrate: string | number, constant? : boolean): Command;
  1260.        
  1261.         /**
  1262.         * Specify custom video filter(s)
  1263.         *
  1264.         * Can be called both with one or many filters, or a filter array.
  1265.         *
  1266.         * @example
  1267.         * command.videoFilters('filter1');
  1268.         *
  1269.         * @example
  1270.         * command.videoFilters('filter1', 'filter2=param1=value1:param2=value2');
  1271.         *
  1272.         * @method FfmpegCommand#videoFilters
  1273.         * @category Video
  1274.         * @aliases withVideoFilter,withVideoFilters,videoFilter
  1275.         *
  1276.         * @param {...String} filters video filter strings
  1277.         * @return FfmpegCommand
  1278.         */
  1279.         videoFilters(...filters: string[]): Command;
  1280.        
  1281.         /**
  1282.         * Specify custom video filter(s)
  1283.         *
  1284.         * Can be called both with one or many filters, or a filter array.
  1285.         *
  1286.         * @example
  1287.         * command.videoFilters(
  1288.         *   {
  1289.         *     filter: 'filter1',
  1290.         *     options: ['value1', 'value2']
  1291.         *   },
  1292.         *   {
  1293.         *     filter: 'filter2',
  1294.         *     options: { param1: 'value1', param2: 'value2' }
  1295.         *   }
  1296.         * );
  1297.         *
  1298.         * @method FfmpegCommand#videoFilters
  1299.         * @category Video
  1300.         * @aliases withVideoFilter,withVideoFilters,videoFilter
  1301.         *
  1302.         * @param {...Object} filters video filter specifications with the following properties:
  1303.         * @param {String} filters.filter filter name
  1304.         * @param {String|String[]|Object} [filters.options] filter option string, array, or object
  1305.         * @return FfmpegCommand
  1306.         */
  1307.         videoFilters(...filters: FilterObject[]): Command;
  1308.        
  1309.         /**
  1310.         * Specify custom video filter(s)
  1311.         *
  1312.         * Can be called both with one or many filters, or a filter array.
  1313.         *
  1314.         * @example
  1315.         * command.videoFilters(['filter1', 'filter2']);
  1316.         *
  1317.         * @example
  1318.         * command.videoFilters([
  1319.         *   {
  1320.         *     filter: 'filter1'
  1321.         *   },
  1322.         *   {
  1323.         *     filter: 'filter2',
  1324.         *     options: 'param=value:param=value'
  1325.         *   }
  1326.         * ]);
  1327.         *
  1328.         * @method FfmpegCommand#videoFilters
  1329.         * @category Video
  1330.         * @aliases withVideoFilter,withVideoFilters,videoFilter
  1331.         *
  1332.         * @param {String[]|Object[]} filters video filter string array or specification array, each with the following properties:
  1333.         * @param {String} filters.filter filter name
  1334.         * @param {String|String[]|Object} [filters.options] filter option string, array, or object
  1335.         * @return FfmpegCommand
  1336.         */
  1337.         videoFilters(filters: string[] | FilterObject[]): Command;
  1338.        
  1339.         /**
  1340.         * @see FfmpegCommand.videoFilters
  1341.         */
  1342.         withVideoFilter(...filters: string[]): Command;
  1343.        
  1344.         /**
  1345.         * @see FfmpegCommand.videoFilters
  1346.         */
  1347.         withVideoFilter(filters: string[]): Command;
  1348.        
  1349.         /**
  1350.         * @see FfmpegCommand.videoFilters
  1351.         */
  1352.         withVideoFilter(...filters: FilterObject[]): Command;
  1353.        
  1354.         /**
  1355.         * @see FfmpegCommand.videoFilters
  1356.         */
  1357.         withVideoFilter(filters: FilterObject[]): Command;
  1358.        
  1359.         /**
  1360.         * @see FfmpegCommand.videoFilters
  1361.         */
  1362.         withVideoFilters(...filters: string[]): Command;
  1363.        
  1364.         /**
  1365.         * @see FfmpegCommand.videoFilters
  1366.         */
  1367.         withVideoFilters(filters: string[]): Command;
  1368.        
  1369.         /**
  1370.         * @see FfmpegCommand.videoFilters
  1371.         */
  1372.         withVideoFilters(...filters: FilterObject[]): Command;
  1373.        
  1374.         /**
  1375.         * @see FfmpegCommand.videoFilters
  1376.         */
  1377.         withVideoFilters(filters: FilterObject[]): Command;
  1378.        
  1379.         /**
  1380.         * @see FfmpegCommand.videoFilters
  1381.         */
  1382.         videoFilter(...filters: string[]): Command;
  1383.        
  1384.         /**
  1385.         * @see FfmpegCommand.videoFilters
  1386.         */
  1387.         videoFilter(filters: string[]): Command;
  1388.        
  1389.         /**
  1390.         * @see FfmpegCommand.videoFilters
  1391.         */
  1392.         videoFilter(...filters: FilterObject[]): Command;
  1393.        
  1394.         /**
  1395.         * @see FfmpegCommand.videoFilters
  1396.         */
  1397.         videoFilter(filters: FilterObject[]): Command;
  1398.        
  1399.         /**
  1400.         * Specify output FPS
  1401.         *
  1402.         * @method FfmpegCommand#fps
  1403.         * @category Video
  1404.         * @aliases withOutputFps,withOutputFPS,withFpsOutput,withFPSOutput,withFps,withFPS,outputFPS,outputFps,fpsOutput,FPSOutput,FPS
  1405.         *
  1406.         * @param {Number} fps output FPS
  1407.         * @return FfmpegCommand
  1408.         */
  1409.         fps(fps: number): Command;
  1410.        
  1411.         /**
  1412.         * @see FfmpegCommand.fps
  1413.         */
  1414.         withOutputFps(fps: number): Command;
  1415.        
  1416.         /**
  1417.         * @see FfmpegCommand.fps
  1418.         */
  1419.         withOutputFPS(fps: number): Command;
  1420.        
  1421.         /**
  1422.         * @see FfmpegCommand.fps
  1423.         */
  1424.         withFpsOutput(fps: number): Command;
  1425.        
  1426.         /**
  1427.         * @see FfmpegCommand.fps
  1428.         */
  1429.         withFPSOutput(fps: number): Command;
  1430.        
  1431.         /**
  1432.         * @see FfmpegCommand.fps
  1433.         */
  1434.         withFps(fps: number): Command;
  1435.        
  1436.         /**
  1437.         * @see FfmpegCommand.fps
  1438.         */
  1439.         withFPS(fps: number): Command;
  1440.        
  1441.         /**
  1442.         * @see FfmpegCommand.fps
  1443.         */
  1444.         outputFPS(fps: number): Command;
  1445.        
  1446.         /**
  1447.         * @see FfmpegCommand.fps
  1448.         */
  1449.         outputFps(fps: number): Command;
  1450.        
  1451.         /**
  1452.         * @see FfmpegCommand.fps
  1453.         */
  1454.         fpsOutput(fps: number): Command;
  1455.        
  1456.         /**
  1457.         * @see FfmpegCommand.fps
  1458.         */
  1459.         FPSOutput(fps: number): Command;
  1460.        
  1461.         /**
  1462.         * @see FfmpegCommand.fps
  1463.         */
  1464.         FPS(fps: number): Command;
  1465.        
  1466.         /**
  1467.         * Only transcode a certain number of frames
  1468.         *
  1469.         * @method FfmpegCommand#frames
  1470.         * @category Video
  1471.         * @aliases takeFrames,withFrames
  1472.         *
  1473.         * @param {Number} frames frame count
  1474.         * @return FfmpegCommand
  1475.         */
  1476.         frames(frames: number): Command;
  1477.        
  1478.         /**
  1479.         * @see FfmpegCommand.frames
  1480.         */
  1481.         takeFrames(frames: number): Command;
  1482.        
  1483.         /**
  1484.         * @see FfmpegCommand.frames
  1485.         */
  1486.         withFrames(frames: number): Command;
  1487.        
  1488.        
  1489.        
  1490.         /**
  1491.         * ============================
  1492.         * file: ./options/videosize.js
  1493.         * ============================
  1494.         */
  1495.        
  1496.         /**
  1497.         * Keep display aspect ratio
  1498.         *
  1499.         * This method is useful when converting an input with non-square pixels to an output format
  1500.         * that does not support non-square pixels.  It rescales the input so that the display aspect
  1501.         * ratio is the same.
  1502.         *
  1503.         * @method FfmpegCommand#keepDAR
  1504.         * @category Video size
  1505.         * @aliases keepPixelAspect,keepDisplayAspect,keepDisplayAspectRatio
  1506.         *
  1507.         * @return FfmpegCommand
  1508.         */
  1509.         keepDAR(): Command;
  1510.        
  1511.         /**
  1512.         * Only for compatibility, this is not about keeping _pixel_ aspect ratio
  1513.         *
  1514.         * @see FfmpegCommand.keepDAR
  1515.         */
  1516.         keepPixelAspect(): Command;
  1517.        
  1518.         /**
  1519.         * @see FfmpegCommand.keepDAR
  1520.         */
  1521.         keepDisplayAspect(): Command;
  1522.        
  1523.         /**
  1524.         * @see FfmpegCommand.keepDAR
  1525.         */
  1526.         keepDisplayAspectRatio(): Command;
  1527.        
  1528.         /**
  1529.         * Set output size
  1530.         *
  1531.         * The 'size' parameter can have one of 4 forms:
  1532.         * - 'X%': rescale to xx % of the original size
  1533.         * - 'WxH': specify width and height
  1534.         * - 'Wx?': specify width and compute height from input aspect ratio
  1535.         * - '?xH': specify height and compute width from input aspect ratio
  1536.         *
  1537.         * Note: both dimensions will be truncated to multiples of 2.
  1538.         *
  1539.         * @method FfmpegCommand#size
  1540.         * @category Video size
  1541.         * @aliases withSize,setSize
  1542.         *
  1543.         * @param {String} size size string, eg. '33%', '320x240', '320x?', '?x240'
  1544.         * @return FfmpegCommand
  1545.         */
  1546.         size(size: string): Command;
  1547.        
  1548.         /**
  1549.         * @see FfmpegCommand.size
  1550.         */
  1551.         withSize(size: string): Command;
  1552.        
  1553.         /**
  1554.         * @see FfmpegCommand.size
  1555.         */
  1556.         setSize(size: string): Command;
  1557.        
  1558.         /**
  1559.         * Set output aspect ratio
  1560.         *
  1561.         * @method FfmpegCommand#aspect
  1562.         * @category Video size
  1563.         * @aliases withAspect,withAspectRatio,setAspect,setAspectRatio,aspectRatio
  1564.         *
  1565.         * @param {String|Number} aspect aspect ratio (number or 'X:Y' string)
  1566.         * @return FfmpegCommand
  1567.         */
  1568.         aspect(aspect: string | number): Command;
  1569.        
  1570.         /**
  1571.         * @see FfmpegCommand.aspect
  1572.         */
  1573.         withAspect(aspect: string | number): Command;
  1574.        
  1575.         /**
  1576.         * @see FfmpegCommand.aspect
  1577.         */
  1578.         withAspectRatio(aspect: string | number): Command;
  1579.        
  1580.         /**
  1581.         * @see FfmpegCommand.aspect
  1582.         */
  1583.         setAspect(aspect: string | number): Command;
  1584.        
  1585.         /**
  1586.         * @see FfmpegCommand.aspect
  1587.         */
  1588.         setAspectRatio(aspect: string | number): Command;
  1589.        
  1590.         /**
  1591.         * @see FfmpegCommand.aspect
  1592.         */
  1593.         aspectRatio(aspect: string | number): Command;
  1594.        
  1595.         /**
  1596.         * Enable auto-padding the output
  1597.         *
  1598.         * @method FfmpegCommand#autopad
  1599.         * @category Video size
  1600.         * @aliases applyAutopadding,applyAutoPadding,applyAutopad,applyAutoPad,withAutopadding,withAutoPadding,withAutopad,withAutoPad,autoPad
  1601.         *
  1602.         * @param {Boolean} [pad=true] enable/disable auto-padding
  1603.         * @param {String} [color='black'] pad color
  1604.         * @return FfmpegCommand
  1605.         */
  1606.         autopad(pad?: boolean, color?: string): Command;
  1607.        
  1608.         /**
  1609.         * @see FfmpegCommand.autopad
  1610.         */
  1611.         applyAutopadding(pad?: boolean, color?: string): Command;
  1612.        
  1613.         /**
  1614.         * @see FfmpegCommand.autopad
  1615.         */
  1616.         applyAutoPadding(pad?: boolean, color?: string): Command;
  1617.        
  1618.         /**
  1619.         * @see FfmpegCommand.autopad
  1620.         */
  1621.         applyAutopad(pad?: boolean, color?: string): Command;
  1622.        
  1623.         /**
  1624.         * @see FfmpegCommand.autopad
  1625.         */
  1626.         applyAutoPad(pad?: boolean, color?: string): Command;
  1627.        
  1628.         /**
  1629.         * @see FfmpegCommand.autopad
  1630.         */
  1631.         withAutopadding(pad?: boolean, color?: string): Command;
  1632.        
  1633.         /**
  1634.         * @see FfmpegCommand.autopad
  1635.         */
  1636.         withAutoPadding(pad?: boolean, color?: string): Command;
  1637.        
  1638.         /**
  1639.         * @see FfmpegCommand.autopad
  1640.         */
  1641.         withAutopad(pad?: boolean, color?: string): Command;
  1642.        
  1643.         /**
  1644.         * @see FfmpegCommand.autopad
  1645.         */
  1646.         withAutoPad(pad?: boolean, color?: string): Command;
  1647.        
  1648.         /**
  1649.         * @see FfmpegCommand.autopad
  1650.         */
  1651.         autoPad(pad?: boolean, color?: string): Command;
  1652.        
  1653.        
  1654.        
  1655.         /**
  1656.         * =========================
  1657.         * file: ./options/output.js
  1658.         * =========================
  1659.         */
  1660.        
  1661.         /**
  1662.         * Add output
  1663.         *
  1664.         * @method FfmpegCommand#output
  1665.         * @category Output
  1666.         * @aliases addOutput
  1667.         *
  1668.         * @param {String|Writable} target target file path or writable stream
  1669.         * @param {Object} [pipeopts={}] pipe options (only applies to streams)
  1670.         * @return FfmpegCommand
  1671.         */
  1672.         output(target: string | NodeJS.WritableStream): Command;
  1673.        
  1674.         /**
  1675.         * @see FfmpegCommand.output
  1676.         */
  1677.         addOutput(target: string | NodeJS.WritableStream): Command;
  1678.        
  1679.         /**
  1680.         * Specify output seek time
  1681.         *
  1682.         * @method FfmpegCommand#seek
  1683.         * @category Input
  1684.         * @aliases seekOutput
  1685.         *
  1686.         * @param {String|Number} seek seek time in seconds or as a '[hh:[mm:]]ss[.xxx]' string
  1687.         * @return FfmpegCommand
  1688.         */
  1689.         seek(seek: string | number): Command;
  1690.        
  1691.         /**
  1692.         * @see FfmpegCommand.seek
  1693.         */
  1694.         seekOutput(seek: string | number): Command;
  1695.        
  1696.         /**
  1697.         * Set output duration
  1698.         *
  1699.         * @method FfmpegCommand#duration
  1700.         * @category Output
  1701.         * @aliases withDuration,setDuration
  1702.         *
  1703.         * @param {String|Number} duration duration in seconds or as a '[[hh:]mm:]ss[.xxx]' string
  1704.         * @return FfmpegCommand
  1705.         */
  1706.         duration(duration: string | number): Command;
  1707.        
  1708.         /**
  1709.         * @see FfmpegCommand.duration
  1710.         */
  1711.         withDuration(duration: string | number): Command;
  1712.        
  1713.         /**
  1714.         * @see FfmpegCommand.duration
  1715.         */
  1716.         setDuration(duration: string | number): Command;
  1717.        
  1718.         /**
  1719.         * Set output format
  1720.         *
  1721.         * @method FfmpegCommand#format
  1722.         * @category Output
  1723.         * @aliases toFormat,withOutputFormat,outputFormat
  1724.         *
  1725.         * @param {String} format output format name
  1726.         * @return FfmpegCommand
  1727.         */
  1728.         format(format: string): Command;
  1729.        
  1730.         /**
  1731.         * @see FfmpegCommand.format
  1732.         */
  1733.         toFormat(format: string): Command;
  1734.        
  1735.         /**
  1736.         * @see FfmpegCommand.format
  1737.         */
  1738.         withOutputFormat(format: string): Command;
  1739.        
  1740.         /**
  1741.         * @see FfmpegCommand.format
  1742.         */
  1743.         outputFormat(format: string): Command;
  1744.        
  1745.         /**
  1746.         * Add stream mapping to output
  1747.         *
  1748.         * @method FfmpegCommand#map
  1749.         * @category Output
  1750.         *
  1751.         * @param {String} spec stream specification string, with optional square brackets
  1752.         * @return FfmpegCommand
  1753.         */
  1754.         map(spec: string): Command;
  1755.        
  1756.         /**
  1757.         * Run flvtool2/flvmeta on output
  1758.         *
  1759.         * @method FfmpegCommand#flvmeta
  1760.         * @category Output
  1761.         * @aliases updateFlvMetadata
  1762.         *
  1763.         * @return FfmpegCommand
  1764.         */
  1765.         flvmeta(): Command;
  1766.        
  1767.         /**
  1768.         * @see FfmpegCommand.flvmeta
  1769.         */
  1770.         updateFlvMetadata(): Command;
  1771.        
  1772.        
  1773.        
  1774.         /**
  1775.         * =========================
  1776.         * file: ./options/custom.js
  1777.         * =========================
  1778.         */
  1779.        
  1780.         /**
  1781.         * Add custom input option(s)
  1782.         *
  1783.         * When passing a single string or an array, each string containing two
  1784.         * words is split (eg. inputOptions('-option value') is supported) for
  1785.         * compatibility reasons.  This is not the case when passing more than
  1786.         * one argument.
  1787.         *
  1788.         * @example
  1789.         * command.inputOptions('option1');
  1790.         *
  1791.         * @example
  1792.         * command.inputOptions('option1', 'option2');
  1793.         *
  1794.         * @method FfmpegCommand#inputOptions
  1795.         * @category Custom options
  1796.         * @aliases addInputOption,addInputOptions,withInputOption,withInputOptions,inputOption
  1797.         *
  1798.         * @param {...String} options option string(s)
  1799.         * @return FfmpegCommand
  1800.         */
  1801.         inputOptions(...options: string[]): Command;
  1802.        
  1803.         /**
  1804.         * Add custom input option(s)
  1805.         *
  1806.         * When passing a single string or an array, each string containing two
  1807.         * words is split (eg. inputOptions('-option value') is supported) for
  1808.         * compatibility reasons.  This is not the case when passing more than
  1809.         * one argument.
  1810.         *
  1811.         * @example
  1812.         * command.inputOptions(['option1', 'option2']);
  1813.         *
  1814.         * @method FfmpegCommand#inputOptions
  1815.         * @category Custom options
  1816.         * @aliases addInputOption,addInputOptions,withInputOption,withInputOptions,inputOption
  1817.         *
  1818.         * @param {String[]} options option string array
  1819.         * @return FfmpegCommand
  1820.         */
  1821.         inputOptions(options: string[]): Command;
  1822.        
  1823.         /**
  1824.         * @see FfmpegCommand.inputOptions
  1825.         */
  1826.         addInputOption(...options: string[]): Command;
  1827.        
  1828.         /**
  1829.         * @see FfmpegCommand.inputOptions
  1830.         */
  1831.         addInputOption(options: string[]): Command;
  1832.        
  1833.         /**
  1834.         * @see FfmpegCommand.inputOptions
  1835.         */
  1836.         addInputOptions(...options: string[]): Command;
  1837.        
  1838.         /**
  1839.         * @see FfmpegCommand.inputOptions
  1840.         */
  1841.         addInputOptions(options: string[]): Command;
  1842.        
  1843.         /**
  1844.         * @see FfmpegCommand.inputOptions
  1845.         */
  1846.         withInputOption(...options: string[]): Command;
  1847.        
  1848.         /**
  1849.         * @see FfmpegCommand.inputOptions
  1850.         */
  1851.         withInputOption(options: string[]): Command;
  1852.        
  1853.         /**
  1854.         * @see FfmpegCommand.inputOptions
  1855.         */
  1856.         withInputOptions(...options: string[]): Command;
  1857.        
  1858.         /**
  1859.         * @see FfmpegCommand.inputOptions
  1860.         */
  1861.         withInputOptions(options: string[]): Command;
  1862.        
  1863.         /**
  1864.         * @see FfmpegCommand.inputOptions
  1865.         */
  1866.         inputOption(...options: string[]): Command;
  1867.        
  1868.         /**
  1869.         * @see FfmpegCommand.inputOptions
  1870.         */
  1871.         inputOption(options: string[]): Command;
  1872.        
  1873.         /**
  1874.         * Add custom output option(s)
  1875.         *
  1876.         * @example
  1877.         * command.outputOptions('option1');
  1878.         *
  1879.         * @example
  1880.         * command.outputOptions('option1', 'option2');
  1881.         *
  1882.         * @method FfmpegCommand#outputOptions
  1883.         * @category Custom options
  1884.         * @aliases addOutputOption,addOutputOptions,addOption,addOptions,withOutputOption,withOutputOptions,withOption,withOptions,outputOption
  1885.         *
  1886.         * @param {...String} options option string(s)
  1887.         * @return FfmpegCommand
  1888.         */
  1889.         outputOptions(...options: string[]): Command;
  1890.        
  1891.         /**
  1892.         * Add custom output option(s)
  1893.         *
  1894.         * @example
  1895.         * command.outputOptions(['option1', 'option2']);
  1896.         *
  1897.         * @method FfmpegCommand#outputOptions
  1898.         * @category Custom options
  1899.         * @aliases addOutputOption,addOutputOptions,addOption,addOptions,withOutputOption,withOutputOptions,withOption,withOptions,outputOption
  1900.         *
  1901.         * @param {String[]} options option string array
  1902.         * @return FfmpegCommand
  1903.         */
  1904.         outputOptions(options: string[]): Command;
  1905.        
  1906.         /**
  1907.         * @see FfmpegCommand.outputOptions
  1908.         */
  1909.         addOutputOption(...options: string[]): Command;
  1910.        
  1911.         /**
  1912.         * @see FfmpegCommand.outputOptions
  1913.         */
  1914.         addOutputOption(options: string[]): Command;
  1915.        
  1916.         /**
  1917.         * @see FfmpegCommand.outputOptions
  1918.         */
  1919.         addOutputOptions(...options: string[]): Command;
  1920.        
  1921.         /**
  1922.         * @see FfmpegCommand.outputOptions
  1923.         */
  1924.         addOutputOptions(options: string[]): Command;
  1925.        
  1926.         /**
  1927.         * @see FfmpegCommand.outputOptions
  1928.         */
  1929.         addOption(...options: string[]): Command;
  1930.        
  1931.         /**
  1932.         * @see FfmpegCommand.outputOptions
  1933.         */
  1934.         addOption(options: string[]): Command;
  1935.        
  1936.         /**
  1937.         * @see FfmpegCommand.outputOptions
  1938.         */
  1939.         addOptions(...options: string[]): Command;
  1940.        
  1941.         /**
  1942.         * @see FfmpegCommand.outputOptions
  1943.         */
  1944.         addOptions(options: string[]): Command;
  1945.        
  1946.         /**
  1947.         * @see FfmpegCommand.outputOptions
  1948.         */
  1949.         withOutputOption(...options: string[]): Command;
  1950.        
  1951.         /**
  1952.         * @see FfmpegCommand.outputOptions
  1953.         */
  1954.         withOutputOption(options: string[]): Command;
  1955.        
  1956.         /**
  1957.         * @see FfmpegCommand.outputOptions
  1958.         */
  1959.         withOutputOptions(...options: string[]): Command;
  1960.        
  1961.         /**
  1962.         * @see FfmpegCommand.outputOptions
  1963.         */
  1964.         withOutputOptions(options: string[]): Command;
  1965.        
  1966.         /**
  1967.         * @see FfmpegCommand.outputOptions
  1968.         */
  1969.         withOption(...options: string[]): Command;
  1970.        
  1971.         /**
  1972.         * @see FfmpegCommand.outputOptions
  1973.         */
  1974.         withOption(options: string[]): Command;
  1975.        
  1976.         /**
  1977.         * @see FfmpegCommand.outputOptions
  1978.         */
  1979.         withOptions(...options: string[]): Command;
  1980.        
  1981.         /**
  1982.         * @see FfmpegCommand.outputOptions
  1983.         */
  1984.         withOptions(options: string[]): Command;
  1985.        
  1986.         /**
  1987.         * @see FfmpegCommand.outputOptions
  1988.         */
  1989.         outputOption(...options: string[]): Command;
  1990.        
  1991.         /**
  1992.         * @see FfmpegCommand.outputOptions
  1993.         */
  1994.         outputOption(options: string[]): Command;
  1995.        
  1996.         /**
  1997.         * Specify a complex filtergraph
  1998.         *
  1999.         * Calling this method will override any previously set filtergraph, but you can set
  2000.         * as many filters as needed in one call.
  2001.         *
  2002.         * @example <caption>Overlay an image over a video (using a filtergraph string)</caption>
  2003.         *   ffmpeg()
  2004.         *     .input('video.avi')
  2005.         *     .input('image.png')
  2006.         *     .complexFilter('[0:v][1:v]overlay[out]', ['out']);
  2007.         *
  2008.         * @example <caption>Overlay an image over a video (using a filter array)</caption>
  2009.         *   ffmpeg()
  2010.         *     .input('video.avi')
  2011.         *     .input('image.png')
  2012.         *     .complexFilter([{
  2013.         *       filter: 'overlay',
  2014.         *       inputs: ['0:v', '1:v'],
  2015.         *       outputs: ['out']
  2016.         *     }], ['out']);
  2017.         *
  2018.         * @example <caption>Split video into RGB channels and output a 3x1 video with channels side to side</caption>
  2019.         *  ffmpeg()
  2020.         *    .input('video.avi')
  2021.         *    .complexFilter([
  2022.         *      // Duplicate video stream 3 times into streams a, b, and c
  2023.         *      { filter: 'split', options: '3', outputs: ['a', 'b', 'c'] },
  2024.         *
  2025.         *      // Create stream 'red' by cancelling green and blue channels from stream 'a'
  2026.         *      { filter: 'lutrgb', options: { g: 0, b: 0 }, inputs: 'a', outputs: 'red' },
  2027.         *
  2028.         *      // Create stream 'green' by cancelling red and blue channels from stream 'b'
  2029.         *      { filter: 'lutrgb', options: { r: 0, b: 0 }, inputs: 'b', outputs: 'green' },
  2030.         *
  2031.         *      // Create stream 'blue' by cancelling red and green channels from stream 'c'
  2032.         *      { filter: 'lutrgb', options: { r: 0, g: 0 }, inputs: 'c', outputs: 'blue' },
  2033.         *
  2034.         *      // Pad stream 'red' to 3x width, keeping the video on the left, and name output 'padded'
  2035.         *      { filter: 'pad', options: { w: 'iw*3', h: 'ih' }, inputs: 'red', outputs: 'padded' },
  2036.         *
  2037.         *      // Overlay 'green' onto 'padded', moving it to the center, and name output 'redgreen'
  2038.         *      { filter: 'overlay', options: { x: 'w', y: 0 }, inputs: ['padded', 'green'], outputs: 'redgreen'},
  2039.         *
  2040.         *      // Overlay 'blue' onto 'redgreen', moving it to the right
  2041.         *      { filter: 'overlay', options: { x: '2*w', y: 0 }, inputs: ['redgreen', 'blue']},
  2042.         *    ]);
  2043.         *
  2044.         * @method FfmpegCommand#complexFilter
  2045.         * @category Custom options
  2046.         * @aliases filterGraph
  2047.         *
  2048.         * @param {String|Array} spec filtergraph string or array of filter specification
  2049.         *   objects, each having the following properties:
  2050.         * @param {String} spec.filter filter name
  2051.         * @param {String|Array} [spec.inputs] (array of) input stream specifier(s) for the filter,
  2052.         *   defaults to ffmpeg automatically choosing the first unused matching streams
  2053.         * @param {String|Array} [spec.outputs] (array of) output stream specifier(s) for the filter,
  2054.         *   defaults to ffmpeg automatically assigning the output to the output file
  2055.         * @param {Object|String|Array} [spec.options] filter options, can be omitted to not set any options
  2056.         * @param {Array} [map] (array of) stream specifier(s) from the graph to include in
  2057.         *   ffmpeg output, defaults to ffmpeg automatically choosing the first matching streams.
  2058.         * @return FfmpegCommand
  2059.         */
  2060.         complexFilter(spec: string | FilterSpecification[], map: string[]): Command;
  2061.        
  2062.         /**
  2063.         * @see FfmpegCommand.complexFilter
  2064.         */
  2065.         filterGraph(spec: string | FilterSpecification[], map: string[]): Command;
  2066.        
  2067.         /**
  2068.         * Use preset
  2069.         *
  2070.         * @method FfmpegCommand#preset
  2071.         * @category Miscellaneous
  2072.         * @aliases usingPreset
  2073.         *
  2074.         * @param {String|Function} preset preset name or preset function
  2075.         * @return FfmpegCommand
  2076.         */
  2077.         preset(preset: string | Function): Command;
  2078.        
  2079.         /**
  2080.         * @see FfmpegCommand.preset
  2081.         */
  2082.         usingPreset(preset: string | Function): Command;
  2083.        
  2084.         on(event: 'codecData', listener: (data: CodecDataEventData) => any): Command;
  2085.         on(event: 'progress', listener: (info: ProgressEventData) => any): Command;
  2086.         on(event: 'end', listener: () => any): Command;
  2087.         on(event: 'error', listener: (error: any) => any): Command;
  2088.         on(event: string, listener: Function): Command;
  2089.     }
  2090.    
  2091.     interface CommandStatic
  2092.     {
  2093.         (options?: CommandOptions): Command;
  2094.         (file: string | NodeJS.ReadableStream, options?: CommandOptions): Command;
  2095.         new (options?: CommandOptions): Command;
  2096.         new (file: string | NodeJS.ReadableStream, options?: CommandOptions): Command;
  2097.        
  2098.         /**
  2099.         * @see (new FfmpegCommand(file)).ffprobe(callback)
  2100.         */
  2101.         ffprobe(file, callback: (error: any, metadata: Ffprobe.Metadata) => void);
  2102.        
  2103.         /**
  2104.         * @see (new FfmpegCommand()).setFfmpegPath(path)
  2105.         */
  2106.         setFfmpegPath(path: string): void;
  2107.        
  2108.         /**
  2109.         * @see (new FfmpegCommand()).setFfprobePath(path)
  2110.         */
  2111.         setFfprobePath(path: string): void;
  2112.        
  2113.         /**
  2114.         * @see (new FfmpegCommand()).setFlvtoolPath(path)
  2115.         */
  2116.         setFlvtoolPath(path: string): void;
  2117.        
  2118.         /**
  2119.         * @see (new FfmpegCommand()).availableFilters(callback)
  2120.         */
  2121.         availableFilters(callback: Function): void;
  2122.         /**
  2123.         * @see (new FfmpegCommand()).availableFilters(callback)
  2124.         */
  2125.         getAvailableFilters(callback: Function): void;
  2126.        
  2127.         /**
  2128.         * @see (new FfmpegCommand()).availableCodecs(callback)
  2129.         */
  2130.         availableCodecs(callback: Function): void;
  2131.         /**
  2132.         * @see (new FfmpegCommand()).availableCodecs(callback)
  2133.         */
  2134.         getAvailableCodecs(callback: Function): void;
  2135.        
  2136.         /**
  2137.         * @see (new FfmpegCommand()).availableFormats(callback)
  2138.         */
  2139.         availableFormats(callback: Function): void;
  2140.         /**
  2141.         * @see (new FfmpegCommand()).availableFormats(callback)
  2142.         */
  2143.         getAvailableFormats(callback: Function): void;
  2144.     }
  2145. }
  2146.  
  2147. declare module "fluent-ffmpeg"
  2148. {
  2149.     export = ffmpeg;
  2150. }
  2151.  
  2152. declare var ffmpeg: Ffmpeg.CommandStatic;
Advertisement