sonysuqin / WasmVideoPlayer

Play file/stream with wasm & webgl & web audio api, using ffmpeg for multi codec support, especially for h265,support http, websocket, http-flv stream.
GNU General Public License v3.0
1.3k stars 375 forks source link

无法播放hevc+aac (LC)的mp4视频 #24

Closed yyqangular1 closed 5 years ago

yyqangular1 commented 5 years ago

为什么无法播放这个h265的mp4文件?浏览器控制台信息如下:

libffmpeg.js:1 wasm streaming compile failed: TypeError: Failed to execute 'compile' on 'WebAssembly': Incorrect response MIME type. Expected 'application/wasm'.
(anonymous) @ libffmpeg.js:1
libffmpeg.js:1 falling back to ArrayBuffer instantiation
(anonymous) @ libffmpeg.js:1
common.js:58 [2019-10-25 11:44:59:888][Decoder][IF] Wasm loaded.
common.js:58 [2019-10-25 11:45:0:806][Player][IF] Play video/VID_20191025_110711.mp4.
common.js:58 [2019-10-25 11:45:0:845][Downloader][IF] Getting file size video/VID_20191025_110711.mp4.
common.js:58 [2019-10-25 11:45:0:853][Player][IF] Got file size rsp:200 size:39933168 byte.
common.js:58 [2019-10-25 11:45:0:853][Player][IF] Initializing decoder.
common.js:58 [2019-10-25 11:45:0:855][Decoder][IF] initDecoder return 0.
common.js:58 [2019-10-25 11:45:0:855][Player][IF] Init decoder response 0.
common.js:58 [2019-10-25 11:45:0:882][Player][IF] Opening decoder.
libffmpeg.js:1 18
libffmpeg.js:1 18
abort @ libffmpeg.js:1
libffmpeg.js:1 Uncaught abort(18). Build with -s ASSERTIONS=1 for more info.
common.js:54 [2019-10-25 11:45:3:41][Player][ER] Reach file end.

视频文件信息如下:

  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
    encoder         : Lavf58.20.100
  Duration: 00:00:42.07, start: 0.000000, bitrate: 11897 kb/s
    Stream #0:0(eng): Video: hevc (Main) (hev1 / 0x31766568), yuv420p(tv, progressive), 3840x2160 [SAR 1:1 DAR 16:9], 11792 kb/s, 29.97 fps, 29.97 tbr, 11988 tbn, 29.97 tbc (default)
    Metadata:
      handler_name    : Mainconcept MP4 Video Media Handler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 112 kb/s (default)
    Metadata:
      handler_name    : Mainconcept MP4 Sound Media Handler
yyqangular1 commented 5 years ago

已经参照其他issue,重新转码了视频,目前可以播放了,就是声音有卡顿杂乱现象

sonysuqin commented 5 years ago

@yyqangular1 音视频同步的问题,目前同步的方式可能不太准确,在另外的issue有提到。