\r\n\r\n\r\nvar videoToThumb = new VideoToThumb.default('video URL');\r\nvideoToThumb\r\n .load()\r\n .type('base64')\r\n //.size([320, 240])\r\n //.positions([1])\r\n //.xy([0,0])\r\n .error(function(err) {\r\n console.warn(err);\r\n })\r\n .done(function(imgs) {\r\n console.log(imgs); // echo img base64 string.\r\n });\r\n\r\n[/code]","url":"https://sir.kr/boards/pg_tip/17797","author":{"@type":"Person","name":"swallow","url":"https://sir.kr/profile/0b6c7c78-76a1-4e71-aae0-c9f6d7aa8587"},"interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":5},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":8}],"datePublished":"2023-09-16T17:03:27+09:00","dateModified":"2024-10-11T22:05:41+09:00","comment":[{"@type":"Comment","text":"감사합니다.","author":{"@type":"Person","name":"써맨"},"datePublished":"2023-10-04T13:39:47+09:00"},{"@type":"Comment","text":"감사합니다.","author":{"@type":"Person","name":"웅프"},"datePublished":"2023-11-11T16:58:45+09:00"},{"@type":"Comment","text":"감사합니다! \r\n\r\n초보자라..궁금한게 많은데 오로지 작고 간단한 썸네일 생성만을 한다면\r\n\r\nffmpge를 설치하는것보다 VideoToThumb.min.js 라이브러리를 이용하는것이\r\n\r\n엄청 효율적일까요?\r\n\r\n \r\n","author":{"@type":"Person","name":"헛둘헛둘"},"datePublished":"2023-11-25T19:19:28+09:00"},{"@type":"Comment","text":"@헛둘헛둘 아 네 당연합니다. 그러나 위와 같은 방법은 요청이 접수될때마다 동적으로 썸네일을 생성하므로 약간의 시간지연이 있습니다. ffmpeg는 미리 썸네일을 모두 생성해놓을수 있으므로 시간지연문제가 없을수도 있습니다.\r\n","author":{"@type":"Person","name":"swallow"},"datePublished":"2023-11-27T08:41:15+09:00"},{"@type":"Comment","text":"@swallow 앗 그런차이가 있었군요! 상세한 설명감사드립니다!\r\n","author":{"@type":"Person","name":"헛둘헛둘"},"datePublished":"2023-11-27T17:44:18+09:00"},{"@type":"Comment","text":"이걸 어떻게 사용하나요?\r\n","author":{"@type":"Person","name":"015B"},"datePublished":"2024-03-05T15:22:58+09:00"},{"@type":"Comment","text":"감사합니다\r\n","author":{"@type":"Person","name":"피그마"},"datePublished":"2024-03-14T18:46:09+09:00"},{"@type":"Comment","text":"저도 궁금합니다. 이 코드를 어느 파일에다가 넣어야 할까요?\r\n\r\n위젯이 들어간 메인페이지\r\n\r\n위젯폴더의 widget.rows.php\r\n\r\n \r\n\r\n에\r\n\r\n \r\n\r\n
댓글 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>
넣으니깐 안되어서요.