본문 바로가기

gstreamer

[명령어 정리] live stream 상태 체크 방법 (w. ffprobe 간단!)

  방법1  단순 확인용, block 인 경우 응답없음  

ffprobe "rtsp://아이디:비밀번호@카메라url "  
ffprobe -i 396025.MP4 -show_packets 
 
show_packets 붙여주면 매번 모든패킷 깐 결과 보여줌. 

pts, pts_time, dts, dts_time 보면 대충 상태 체크 가능 

 

pts란 ?

https://gamz.tistory.com/16

 


  방법2    ffprobe로 timestamp 뽑아내기

ffprobe -show_packets ttt.mp4 -show_entries packet=pts_time

가끔 timestamp를 이상하게주는 카메라들이 있음. 체크용. 

ffmpeg 홈페이지에서 다양한 설정가능 

https://ffmpeg.org/ffprobe.html

 

ffprobe Documentation

Table of Contents ffprobe [options] input_url ffprobe gathers information from multimedia streams and prints it in human- and machine-readable fashion. For example it can be used to check the format of the container used by a multimedia stream and the form

ffmpeg.org

 

  방법3    ffprobe로 timestamp 뽑아내고 이미지저장

 

https://superuser.com/questions/841872/how-do-i-extract-the-timestamps-associated-with-frames-ffmpeg-extracts-from-a-vi)

ffprobe -f lavfi -i "movie=input.mp4,fps=fps=25[out0]" -show_frames -show_entries frame=pkt_pts_time -of csv=p=0

예상 출력결과 

0
0.04
0.08
0.12
0.16
...
 
ls -1 이미지-*.jpeg > 이미지.txt
ffprobe -f lavfi -i "movie=input.mp4,fps=fps=25[out0]" -show_frames -show_entries 프레임=pkt_pts_time -of csv=p=0 > frames.txt
images.txt frames.txt > Combine.txt 붙여넣기

예상결과

image-0001.jpeg 0
image-0002.jpeg 0.04
image-0003.jpeg 0.08
image-0004.jpeg 0.12
 ffmpeg -i "rtsp://아이디:비밀번호@카메라url " -f image2 -vf fps=fps=1 img%03d.jpg

 

  방법4   gstreamer로도 가능 

gstreamer깔려있으면, 

command :

gst-discoverer-1.0 "rtsp://admin:admin@192.168.0.151:554/cam/realmonitor

기대 답변 : 

Analyzing rtsp://아이디:비밀번호@카메라url 
Done discovering rtsp://아이디:비밀번호@카메라url

 

Analyzing URI timed out

Properties:
  Duration: 99:99:99.999999999
  Seekable: no
  Live: yes
  container: application/rtsp
    unknown: application/x-rtp
      video: H.264 (High Profile)
        Stream ID: b2215628abde373d30bc6e5eff04dea9e40a085ca7d03fb036b09cd3b7b0f3fc/video:0:0:RTP:AVP:96
        Width: 1280
        Height: 720
        Depth: 24
        Frame rate: 30/1
        Pixel aspect ratio: 1/1
        Interlaced: false
        Bitrate: 2885088
        Max bitrate: 49920

 

'gstreamer' 카테고리의 다른 글

[gstreamer] PTS_TIME 중복시  (0) 2022.12.21
동영상 포맷이해  (0) 2022.11.29
gstreamer : muxer  (0) 2022.11.10
gstreamer : muxer  (0) 2022.11.03
미디어 관련내용 정리  (0) 2022.11.03