hughfenghen.github.io icon indicating copy to clipboard operation
hughfenghen.github.io copied to clipboard

blog

Results 100 hughfenghen.github.io issues
Sort by recently updated
recently updated
newest added

https://hughfenghen.github.io/posts/2024/07/27/webcodecs-performance-benchmark/

Vssue

https://hughfenghen.github.io/posts/2024/07/27/webcodecs-performance-benchmark/

Vssue

**背景** Webcodecs支持了Web编码,加上开源的muxer(如mp4box.js)就能使用原生js封装视频文件了; 而在直播场景经常需要在视频流中插入自定义SEI,开放对视频流的操作能力是Webcodecs的动机之一(WebRTC~~做不到~~); 以下是为了 _验证_ 自定义SEI确实可行,仅是学习笔记,若想在生产使用,需完成标注未完成的任务; **NALU 组成结构** ![image](https://user-images.githubusercontent.com/3307051/203218234-9dd2c848-5601-4931-b47a-8c3df0a6eecf.png) SEI 是一种特殊的 NALU **SEI 组成结构** ![image](https://user-images.githubusercontent.com/3307051/203218361-e42aa878-f2a0-4d87-bc48-0241781b1bbe.png) **代码实现** ```js function buildStrSEINALU (str) { const txtEncoder = new TextEncoder() let uuidStr = ''...

前端
音视频

WebAV 是我的个人开源项目,不知多少日夜,变更 10w+ 行代码,获得 650 star。 今天被正式收入 Github **bilibili** 组织,欢迎 star 与贡献。 ![image](https://github.com/hughfenghen/hughfenghen.github.io/assets/3307051/a43bb83d-6edc-4c68-8638-6714e4ff2189) ![image](https://github.com/hughfenghen/hughfenghen.github.io/assets/3307051/5d4b18d2-1cba-4526-9c48-2de3db50c04d) **WebAV** 是基于 **WebCodecs** 封装,提供简易 API 在浏览器中处理音视频数据;可应用于**视频合成、剪辑、录制、播放**等场景。 WebAV 项目链接:https://github.com/bilibili/WebAV 还有丰富的可在线体验 demo:https://bilibili.github.io/WebAV/demo --- 此外,笔者还撰写了一系列文章收录在 **Web 音视频知识图谱**项目,方便初学者(特别是前端开发)入门音视频。 https://github.com/hughfenghen/WebAV-KnowledgeGraph ---...

心情

https://hughfenghen.github.io/posts/2024/05/11/webcodecs-codec-string-explain/

Vssue

https://hughfenghen.github.io/posts/2024/05/08/ff-proxy/

Vssue

因一些奇怪的原因,需要格盘才能重装系统,所以需要备份大量文件。 但 cp 命令 copy 文件到另一台电脑或硬盘非常的缓慢。 前端专属命令。。。 `tar --exclude='*/node_modules/*' -zcvf .tgz ` 打包过程速度很快,copy 单个文件的速度也非常快。 另外,过滤 .pnpm, .cache, temp 等目录,还能更快。 tar 命令: https://www.runoob.com/linux/linux-comm-tar.html

经验

https://hughfenghen.github.io/posts/2024/03/06/opfs-tools-tweet/

Vssue

https://hughfenghen.github.io/posts/2024/03/06/opfs-tools-tweet/

Vssue

![image](https://user-images.githubusercontent.com/3307051/134033989-5b00a26e-1a84-47c0-8d90-46273b3491d1.png) 其实是一个很简单、常见的功能,但 js 实现起来却要写很多行代码。 这里封一个函数,支持移动端、PC 端拖动,作为备份参考。 ```ts function moveEl (el: HTMLElement) { let elStartX = 0 let elStartY = 0 let touchStartX = 0 let touchStartY = 0 const onStart...

前端
code snippet