영상 정보 확인기
영상 파일의 재생시간, 영상 width×height, MIME type, 파일 크기를 browser video metadata에서 읽습니다.
사용 방법
- 영상 하나를 선택해 실행하고 브라우저가 읽은 길이·해상도·MIME·size를 확인합니다.
핵심 기능과 처리 범위
임시 Object URL을 HTMLVideoElement에 연결해 loadedmetadata 후 duration·videoWidth·videoHeight를 가져옵니다.
처리 원리
video preload=metadata로 container metadata를 로드하고 duration seconds와 intrinsic video dimensions를 출력한 뒤 Object URL을 해제합니다.
예시
1920×1080, 30초 영상이면 duration과 1920×1080, MIME, 파일 크기가 줄별로 표시됩니다.
이럴 때 유용합니다
- 게시 전 영상의 기본 길이와 pixel dimensions를 빠르게 확인할 때
사용 전 참고
- codec·fps·bitrate·rotation metadata를 상세 분석하지 않으며 브라우저가 container/codec을 해석하지 못하면 metadata 로드가 실패합니다.
자주 묻는 질문
표시 해상도는 CSS 크기인가요?
아닙니다. HTMLVideoElement의 videoWidth/videoHeight, 즉 media가 보고한 intrinsic pixel dimensions입니다.