동영상파일 썸네일 만들기
[code]
<script src="https://unpkg.com/video-thumb-generator/umd/VideoToThumb.min.js"></script>
var videoToThumb = new VideoToThumb.default('video URL');
videoToThumb
.load()
.type('base64')
//.size([320, 240])
//.positions([1])
//.xy([0,0])
.error(function(err) {
console.warn(err);
})
.done(function(imgs) {
console.log(imgs); // echo img base64 string.
});
[/code]
댓글 8개
감사합니다!
초보자라..궁금한게 많은데 오로지 작고 간단한 썸네일 생성만을 한다면
ffmpge를 설치하는것보다 VideoToThumb.min.js 라이브러리를 이용하는것이
엄청 효율적일까요?
@헛둘헛둘 아 네 당연합니다. 그러나 위와 같은 방법은 요청이 접수될때마다 동적으로 썸네일을 생성하므로 약간의 시간지연이 있습니다. ffmpeg는 미리 썸네일을 모두 생성해놓을수 있으므로 시간지연문제가 없을수도 있습니다.
@swallow 앗 그런차이가 있었군요! 상세한 설명감사드립니다!
이걸 어떻게 사용하나요?
감사합니다
저도 궁금합니다. 이 코드를 어느 파일에다가 넣어야 할까요?
위젯이 들어간 메인페이지
위젯폴더의 widget.rows.php
에
<script src="https://unpkg.com/video-thumb-generator/umd/VideoToThumb.min.js">
var videoToThumb = new VideoToThumb.default('video URL');
videoToThumb
.load()
.type('base64')
//.size([320, 240])
//.positions([1])
//.xy([0,0])
.error(function(err) {
console.warn(err);
})
.done(function(imgs) {
console.log(imgs); // echo img base64 string.
});
</script>
넣으니깐 안되어서요.
게시판 목록
개발자팁
질문은 QA에서 해주시기 바랍니다.
| 번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|---|
| 4946 | node.js | 6년 전 | 2609 | ||
| 4945 | node.js | 6년 전 | 2380 | ||
| 4944 | node.js | 6년 전 | 2520 | ||
| 4943 | node.js | 6년 전 | 2271 | ||
| 4942 | node.js | 6년 전 | 2247 | ||
| 4941 | node.js | 6년 전 | 2719 | ||
| 4940 | node.js | 6년 전 | 1867 | ||
| 4939 | node.js | 6년 전 | 1995 | ||
| 4938 | node.js | 6년 전 | 2459 | ||
| 4937 | node.js | 6년 전 | 2250 | ||
| 4936 | node.js | 6년 전 | 2320 | ||
| 4935 | node.js | 6년 전 | 2136 | ||
| 4934 | node.js | 6년 전 | 2441 | ||
| 4933 | node.js | 6년 전 | 2246 | ||
| 4932 | node.js | 6년 전 | 2686 | ||
| 4931 | node.js | 6년 전 | 2070 | ||
| 4930 | node.js | 6년 전 | 1998 | ||
| 4929 | node.js | 6년 전 | 8631 | ||
| 4928 | node.js | 6년 전 | 3749 | ||
| 4927 | node.js | 6년 전 | 2392 | ||
| 4926 | node.js | 6년 전 | 2504 | ||
| 4925 | node.js | 6년 전 | 2082 | ||
| 4924 | node.js | 6년 전 | 3374 | ||
| 4923 | node.js | 6년 전 | 2221 | ||
| 4922 | node.js | 6년 전 | 1989 | ||
| 4921 | node.js | 6년 전 | 2046 | ||
| 4920 | node.js | 6년 전 | 1764 | ||
| 4919 | node.js | 6년 전 | 2031 | ||
| 4918 | node.js | 6년 전 | 2177 | ||
| 4917 | node.js | 6년 전 | 2395 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기