Skip to content

Commit

Permalink
fix: thumbnailByKeyFrame throw decoder error
Browse files Browse the repository at this point in the history
  • Loading branch information
hughfenghen committed Aug 21, 2024
1 parent 7980ebd commit a9d810a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/quick-rocks-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@webav/av-cliper': patch
---

fix: thumbnailByKeyFrame throw decoder error
2 changes: 1 addition & 1 deletion packages/av-cliper/src/clips/mp4-clip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ function decodeGoP(

// 当 IDR 帧前面携带其它数据(如 SEI)可能导致解码失败
function removeSEIForIDR(u8buf: Uint8Array) {
const dv = new DataView(u8buf.buffer);
const dv = new DataView(u8buf.buffer, u8buf.byteOffset, u8buf.byteLength);
if ((dv.getUint8(4) & 0x1f) === 6) {
return u8buf.subarray(dv.getUint32(0) + 4);
}
Expand Down

0 comments on commit a9d810a

Please sign in to comment.