1 line
11 KiB
JavaScript
1 line
11 KiB
JavaScript
!function(){function e(e){if(e=e||[0,97,115,109,1,0,0,0],"object"!=typeof WebAssembly||"function"!=typeof WebAssembly.instantiate)return!1;try{if((e=new WebAssembly.Module(new Uint8Array(e)))instanceof WebAssembly.Module)return new WebAssembly.Instance(e)instanceof WebAssembly.Instance}catch(e){}return!1}function _(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer instanceof SharedArrayBuffer}catch(e){}return!1}function t(){return e([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])}var a,r=".",o="undefined"!=typeof process;function n(a){var r=!(a=a||{}).nowasm&&e(),o=a.yesthreads&&r&&!a.nothreads&&_(),n=r&&!a.nosimd&&t();return r?o||n?(o?"thr":"")+(n?"simd":""):"wasm":"asm"}"undefined"==typeof LibAV&&(LibAV={}),(a=LibAV).base&&(r=a.base),a.isWebAssemblySupported=e,a.isThreadingSupported=_,a.isSIMDSupported=t,a.target=n,a.LibAV=function(e){var _,t=r+"/libav-3.10.5.1.2-webcodecs."+n(e=e||{})+".js";return Promise.all([]).then((function(){if(!a.LibAVFactory)if(o)a.LibAVFactory=require(t);else if("undefined"==typeof Worker||e.noworker){if("undefined"==typeof importScripts)return new Promise((function(e,_){var a=document.createElement("script");a.src=t,a.addEventListener("load",e),a.addEventListener("error",_),a.async=!0,document.body.appendChild(a)})).then((function(){a.LibAVFactory=LibAVFactory}));importScripts(t),a.LibAVFactory=LibAVFactory}})).then((function(){return o||"undefined"==typeof Worker||e.noworker?Promise.all([]).then((function(){return new Promise((function(e){a.LibAVFactory().then((function(_){delete _.then,e(_)}))}))})).then((function(e){(_=e).worker=!1,_.c=function(e){var t=Array.prototype.slice.call(arguments,1);return new Promise((function(a,r){try{a(_[e].apply(_,t))}catch(a){r(a)}}))},_.terminate=function(){}})):((_={}).worker=new Worker(t),new Promise((function(e,t){_.on=1,_.handlers={onready:[function(){e()},null],onwrite:[function(e){_.onwrite&&_.onwrite.apply(_,e)},null]},_.c=function(){var e=Array.prototype.slice.call(arguments);return new Promise((function(t,a){var r=_.on++;e=[r].concat(e),_.handlers[r]=[t,a],_.worker.postMessage(e)}))},_.worker.onmessage=function(e){var t=e.data[0],a=_.handlers[t];a&&(e.data[2]?a[0](e.data[3]):a[1](e.data[3]),"number"==typeof t&&delete _.handlers[t])},_.terminate=function(){_.worker.terminate()}})))})).then((function(){function e(e,t){void 0===typeof t&&(t=0);var a=t;e.forEach((function(e){_[e]=a++}))}return["av_get_bytes_per_sample","av_opt_set_int_list_js","av_frame_alloc","av_frame_free","av_frame_get_buffer","av_frame_make_writable","av_frame_unref","av_packet_alloc","av_packet_free","av_packet_new_side_data","av_packet_unref","av_strdup","av_buffersink_get_frame","av_buffersink_set_frame_size","av_buffersrc_add_frame_flags","avfilter_free","avfilter_get_by_name","avfilter_graph_alloc","avfilter_graph_config","avfilter_graph_create_filter_js","avfilter_graph_free","avfilter_graph_parse","avfilter_inout_alloc","avfilter_inout_free","avfilter_link","avcodec_alloc_context3","avcodec_close","avcodec_find_decoder","avcodec_find_decoder_by_name","avcodec_find_encoder","avcodec_find_encoder_by_name","avcodec_free_context","avcodec_get_name","avcodec_open2","ff_calloc_AVCodecParameters","avcodec_parameters_from_context","avcodec_parameters_to_context","avcodec_receive_frame","avcodec_receive_packet","avcodec_send_frame","avcodec_send_packet","av_find_input_format","avformat_alloc_context","avformat_alloc_output_context2_js","avformat_close_input","avformat_find_stream_info","avformat_free_context","avformat_new_stream","avformat_open_input","avformat_open_input_js","avformat_write_header","avio_open2_js","avio_close","av_find_best_stream","av_grow_packet","av_interleaved_write_frame","av_packet_make_writable","av_pix_fmt_desc_get","av_read_frame","av_shrink_packet","av_write_frame","av_write_trailer","av_dict_set","av_dict_free","sws_getContext","sws_freeContext","sws_scale_frame","AVFrame_sample_aspect_ratio_num","AVFrame_sample_aspect_ratio_den","AVFrame_sample_aspect_ratio_s","AVCodecContext_framerate_num","AVCodecContext_framerate_den","AVCodecContext_framerate_num_s","AVCodecContext_framerate_den_s","AVCodecContext_framerate_s","AVCodecContext_sample_aspect_ratio_num","AVCodecContext_sample_aspect_ratio_den","AVCodecContext_sample_aspect_ratio_num_s","AVCodecContext_sample_aspect_ratio_den_s","AVCodecContext_sample_aspect_ratio_s","AVCodecContext_time_base_s","AVStream_time_base_num","AVStream_time_base_den","AVStream_time_base_s","AVPacketSideData_data","AVPacketSideData_size","AVPacketSideData_type","ff_error","ff_nothing","calloc","free","malloc","mallinfo_uordblks","libavjs_with_swscale","AVFrame_channel_layout","AVFrame_channel_layout_s","AVFrame_channel_layouthi","AVFrame_channel_layouthi_s","AVFrame_channels","AVFrame_channels_s","AVFrame_data_a","AVFrame_data_a_s","AVFrame_format","AVFrame_format_s","AVFrame_height","AVFrame_height_s","AVFrame_key_frame","AVFrame_key_frame_s","AVFrame_linesize_a","AVFrame_linesize_a_s","AVFrame_nb_samples","AVFrame_nb_samples_s","AVFrame_pict_type","AVFrame_pict_type_s","AVFrame_pts","AVFrame_pts_s","AVFrame_ptshi","AVFrame_ptshi_s","AVFrame_sample_rate","AVFrame_sample_rate_s","AVFrame_width","AVFrame_width_s","AVPixFmtDescriptor_log2_chroma_h","AVPixFmtDescriptor_log2_chroma_h_s","AVCodecContext_bit_rate","AVCodecContext_bit_rate_s","AVCodecContext_bit_ratehi","AVCodecContext_bit_ratehi_s","AVCodecContext_channel_layout","AVCodecContext_channel_layout_s","AVCodecContext_channel_layouthi","AVCodecContext_channel_layouthi_s","AVCodecContext_channels","AVCodecContext_channels_s","AVCodecContext_extradata","AVCodecContext_extradata_s","AVCodecContext_extradata_size","AVCodecContext_extradata_size_s","AVCodecContext_frame_size","AVCodecContext_frame_size_s","AVCodecContext_gop_size","AVCodecContext_gop_size_s","AVCodecContext_height","AVCodecContext_height_s","AVCodecContext_keyint_min","AVCodecContext_keyint_min_s","AVCodecContext_level","AVCodecContext_level_s","AVCodecContext_pix_fmt","AVCodecContext_pix_fmt_s","AVCodecContext_profile","AVCodecContext_profile_s","AVCodecContext_rc_max_rate","AVCodecContext_rc_max_rate_s","AVCodecContext_rc_max_ratehi","AVCodecContext_rc_max_ratehi_s","AVCodecContext_rc_min_rate","AVCodecContext_rc_min_rate_s","AVCodecContext_rc_min_ratehi","AVCodecContext_rc_min_ratehi_s","AVCodecContext_sample_fmt","AVCodecContext_sample_fmt_s","AVCodecContext_sample_rate","AVCodecContext_sample_rate_s","AVCodecContext_qmax","AVCodecContext_qmax_s","AVCodecContext_qmin","AVCodecContext_qmin_s","AVCodecContext_width","AVCodecContext_width_s","AVCodecParameters_codec_id","AVCodecParameters_codec_id_s","AVCodecParameters_codec_type","AVCodecParameters_codec_type_s","AVCodecParameters_extradata","AVCodecParameters_extradata_s","AVCodecParameters_extradata_size","AVCodecParameters_extradata_size_s","AVCodecParameters_format","AVCodecParameters_format_s","AVCodecParameters_bit_rate","AVCodecParameters_bit_rate_s","AVCodecParameters_profile","AVCodecParameters_profile_s","AVCodecParameters_level","AVCodecParameters_level_s","AVCodecParameters_width","AVCodecParameters_width_s","AVCodecParameters_height","AVCodecParameters_height_s","AVCodecParameters_color_range","AVCodecParameters_color_range_s","AVCodecParameters_color_primaries","AVCodecParameters_color_primaries_s","AVCodecParameters_color_trc","AVCodecParameters_color_trc_s","AVCodecParameters_color_space","AVCodecParameters_color_space_s","AVCodecParameters_chroma_location","AVCodecParameters_chroma_location_s","AVCodecParameters_channels","AVCodecParameters_channels_s","AVCodecParameters_sample_rate","AVCodecParameters_sample_rate_s","AVPacket_pts","AVPacket_pts_s","AVPacket_ptshi","AVPacket_ptshi_s","AVPacket_dts","AVPacket_dts_s","AVPacket_dtshi","AVPacket_dtshi_s","AVPacket_data","AVPacket_data_s","AVPacket_size","AVPacket_size_s","AVPacket_stream_index","AVPacket_stream_index_s","AVPacket_flags","AVPacket_flags_s","AVPacket_side_data","AVPacket_side_data_s","AVPacket_side_data_elems","AVPacket_side_data_elems_s","AVPacket_duration","AVPacket_duration_s","AVPacket_durationhi","AVPacket_durationhi_s","AVFormatContext_nb_streams","AVFormatContext_nb_streams_s","AVFormatContext_oformat","AVFormatContext_oformat_s","AVFormatContext_pb","AVFormatContext_pb_s","AVFormatContext_streams_a","AVFormatContext_streams_a_s","AVStream_codecpar","AVStream_codecpar_s","AVStream_duration","AVStream_duration_s","AVStream_durationhi","AVStream_durationhi_s","AVFilterInOut_filter_ctx","AVFilterInOut_filter_ctx_s","AVFilterInOut_name","AVFilterInOut_name_s","AVFilterInOut_next","AVFilterInOut_next_s","AVFilterInOut_pad_idx","AVFilterInOut_pad_idx_s","readFile","writeFile","unlink","mkdev","mkreaderdev","mkwriterdev","ff_reader_dev_send","ff_reader_dev_waiting","ff_init_encoder","ff_init_decoder","ff_free_encoder","ff_free_decoder","ff_encode_multi","ff_decode_multi","ff_set_packet","ff_init_muxer","ff_free_muxer","ff_init_demuxer_file","ff_write_multi","ff_read_multi","ff_init_filter_graph","ff_filter_multi","ff_copyout_frame","ff_copyin_frame","ff_copyout_packet","ff_copyin_packet","ff_malloc_int32_list","ff_malloc_int64_list","av_frame_free_js","av_packet_free_js","avformat_close_input_js","avcodec_free_context_js","avfilter_graph_free_js","avfilter_inout_free_js","copyin_u8","copyout_u8","copyin_s16","copyout_s16","copyin_s32","copyout_s32","copyin_f32","copyout_f32"].forEach((function(e){if(_[e]){var t=_[e+"_sync"]=_[e];_[e]=function(){var e=arguments;return new Promise((function(a,r){try{var o=t.apply(_,e);"object"==typeof o&&null!==o&&o.then?o.then(a).catch(r):a(o)}catch(a){r(a)}}))}}else _[e]=function(){return _.c.apply(_,[e].concat(Array.prototype.slice.call(arguments)))}})),_.AV_OPT_SEARCH_CHILDREN=1,e(["AVMEDIA_TYPE_UNKNOWN","AVMEDIA_TYPE_VIDEO","AVMEDIA_TYPE_AUDIO","AVMEDIA_TYPE_DATA","AVMEDIA_TYPE_SUBTITLE","AVMEDIA_TYPE_ATTACHMENT"],-1),e(["AV_SAMPLE_FMT_NONE","AV_SAMPLE_FMT_U8","AV_SAMPLE_FMT_S16","AV_SAMPLE_FMT_S32","AV_SAMPLE_FMT_FLT","AV_SAMPLE_FMT_DBL","AV_SAMPLE_FMT_U8P","AV_SAMPLE_FMT_S16P","AV_SAMPLE_FMT_S32P","AV_SAMPLE_FMT_FLTP","AV_SAMPLE_FMT_DBLP","AV_SAMPLE_FMT_S64","AV_SAMPLE_FMT_S64P","AV_SAMPLE_FMT_NB"],-1),e(["AV_PIX_FMT_NONE","AV_PIX_FMT_YUV420P","AV_PIX_FMT_YUYV422","AV_PIX_FMT_RGB24","AV_PIX_FMT_BGR24","AV_PIX_FMT_YUV422P","AV_PIX_FMT_YUV444P","AV_PIX_FMT_YUV410P","AV_PIX_FMT_YUV411P","AV_PIX_FMT_GRAY8","AV_PIX_FMT_MONOWHITE","AV_PIX_FMT_MONOBLACK","AV_PIX_FMT_PAL8","AV_PIX_FMT_YUVJ420P","AV_PIX_FMT_YUVJ422P","AV_PIX_FMT_YUVJ444P","AV_PIX_FMT_UYVY422","AV_PIX_FMT_UYYVYY411","AV_PIX_FMT_BGR8","AV_PIX_FMT_BGR4","AV_PIX_FMT_BGR4_BYTE","AV_PIX_FMT_RGB8","AV_PIX_FMT_RGB4","AV_PIX_FMT_RGB4_BYTE","AV_PIX_FMT_NV12","AV_PIX_FMT_NV21","AV_PIX_FMT_ARGB","AV_PIX_FMT_RGBA","AV_PIX_FMT_ABGR","AV_PIX_FMT_BGRA","AV_PIX_FMT_GRAY16BE","AV_PIX_FMT_GRAY16LE","AV_PIX_FMT_YUV440P","AV_PIX_FMT_YUVJ440P","AV_PIX_FMT_YUVA420P","AV_PIX_FMT_RGB48BE","AV_PIX_FMT_RGB48LE","AV_PIX_FMT_RGB565BE","AV_PIX_FMT_RGB565LE","AV_PIX_FMT_RGB555BE","AV_PIX_FMT_RGB555LE","AV_PIX_FMT_BGR565BE","AV_PIX_FMT_BGR565LE","AV_PIX_FMT_BGR555BE","AV_PIX_FMT_BGR555LE"],-1),_.AVIO_FLAG_READ=1,_.AVIO_FLAG_WRITE=2,_.AVIO_FLAG_READ_WRITE=3,_.AVIO_FLAG_NONBLOCK=8,_.AVIO_FLAG_DIRECT=32768,_.EAGAIN=6,_.AVERROR_EOF=-541478725,_}))},o&&(module.exports=a)}(); |