2022년 7월 17일 일요일

VLC 미디어 변환 예제 - RTSP, HLS, 웹캠

- RTSP를 MJPEG로 변환 방법

vlc -vvv -Idummy rtsp://localhost:558/media.smp --sout '#transcode{vcodec=MJPG,venc=ffmpeg{strict=1},fps=10,width=640,height=360}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8082/}'



- RTSP를 m3u8로 변환 방법

vlc -vvv -Idummy rtsp://localhost:558/media.smp --sout '#transcode{width=640,height=360,fps=10,vcodec=h264,vb=256,venc=x264{aud,profile=baseline,level=30,keyint=30,ref=1},acodec=mp3,ab=96}:std{access=livehttp{seglen=10,delsegs=true,numsegs=5,index=/var/www/html/hls/stream.m3u8,index-url=http://localhost/hls/stream-########.ts},mux=ts{use-key-frames},dst=/var/www/html/hls/stream-########.ts}'


테스트 방법.

VLC 플레이어가 있고 웹캠이 있는 PC라면 윈도우 환경 기준 dshow:// 주소를 rtsp 주소란에 넣고 테스트 가능.


테스트 예)

PC 웹캠을 브라우저에서 확인 하는 방법

vlc -vvv -Idummy dshow:// --sout #transcode{vcodec=MJPG,venc=ffmpeg{strict=1},fps=10,width=640,height=360}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8082/}'


테스트 URL : http://localhost:8082/


댓글 없음:

댓글 쓰기