<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div style="" class="default-style">
Hi,
</div>
<div style="" class="default-style">
<br>
</div>
<div style="" class="default-style">
We are using openRTSP as part of a custom firmware for the a series of CCTV cameras - <a class="moz-txt-link-freetext" href="https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks">https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks</a>
</div>
<div style="" class="default-style">
<br>
</div>
<div style="" class="default-style">
We are using openRTSP to capture an MP4 file that we can then send as a notification via Telegram. The Telegram app will only accept a video in an MP4 container so we are using the -4 flag. We have been having some playback issues in the Telegram app and after some debugging I have found that even though we are using the -4 flag the video is being encoded into a Quicktime container. I have pasted some shell output below to show a file being captured.
</div>
<div style="" class="default-style">
<br>
</div>
<div style="" class="default-style">
Do you have any insights on why this is happening and how we can ensure that openRTSP captures the video and puts into an MP4 container?
</div>
<div style="" class="default-style">
<br>
</div>
<div style="" class="default-style">
<pre><em>[root@KitchenCam:~]# openRTSP -4 -w 1920 -h 1080 -f 10 -d 10 -b 1500000 rtsp://127.0.0.1:8554/unicast> test.mp4
Created new TCP socket 3 for connection
Connecting to 127.0.0.1, port 8554 on socket 3...
...remote connection opened
Sending request: OPTIONS rtsp://127.0.0.1:8554/unicast RTSP/1.0
CSeq: 2
User-Agent: openRTSP (LIVE555 Streaming Media v2020.05.15)
Received 152 new bytes of response data.
Received a complete OPTIONS response:
RTSP/1.0 200 OK
CSeq: 2
Date: Mon, Mar 15 2021 19:28:09 GMT
Public: OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER
Sending request: DESCRIBE rtsp://127.0.0.1:8554/unicast RTSP/1.0
CSeq: 3
User-Agent: openRTSP (LIVE555 Streaming Media v2020.05.15)
Accept: application/sdp
Received 709 new bytes of response data.
Received a complete DESCRIBE response:
RTSP/1.0 200 OK
CSeq: 3
Date: Mon, Mar 15 2021 19:28:09 GMT
Content-Base: rtsp://127.0.0.1:8554/unicast/
Content-Type: application/sdp
Content-Length: 546
v=0
o=- 1615722675176757 1 IN IP4 10.10.10.239
s=LIVE555 Streaming Media v2020.05.15
i=LIVE555 Streaming Media v2020.05.15
t=0 0
a=tool:LIVE555 Streaming Media v2020.05.15
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:LIVE555 Streaming Media v2020.05.15
a=x-qt-text-inf:LIVE555 Streaming Media v2020.05.15
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:10
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=4d4028;sprop-parameter-sets=Z01AKJ2oHgCJ+WEAAAMAAQAAAwAyhA==,aO48gA==
a=x-dimensions:1920,1080
a=control:track1
Opened URL "rtsp://127.0.0.1:8554/unicast", returning a SDP description:
v=0
o=- 1615722675176757 1 IN IP4 10.10.10.239
s=LIVE555 Streaming Media v2020.05.15
i=LIVE555 Streaming Media v2020.05.15
t=0 0
a=tool:LIVE555 Streaming Media v2020.05.15
a=type:broadcast
a=control:*
a=range:npt=0-
a=x-qt-text-nam:LIVE555 Streaming Media v2020.05.15
a=x-qt-text-inf:LIVE555 Streaming Media v2020.05.15
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:10
a=rtpmap:96 H264/90000
a=fmtp:96 profile-level-id=4d4028;sprop-parameter-sets=Z01AKJ2oHgCJ+WEAAAMAAQAAAwAyhA==,aO48gA==
a=x-dimensions:1920,1080
a=control:track1
Created receiver for "video/H264" subsession (client ports 56778-56779)
Sending request: SETUP rtsp://127.0.0.1:8554/unicast/track1 RTSP/1.0
CSeq: 4
User-Agent: openRTSP (LIVE555 Streaming Media v2020.05.15)
Transport: RTP/AVP;unicast;client_port=56778-56779
Received 208 new bytes of response data.
Received a complete SETUP response:
RTSP/1.0 200 OK
CSeq: 4
Date: Mon, Mar 15 2021 19:28:09 GMT
Transport: RTP/AVP;unicast;destination=127.0.0.1;source=127.0.0.1;client_port=56778-56779;server_port=6970-6971
Session: 1F2DC088;timeout=65
Setup "video/H264" subsession (client ports 56778-56779)
Outputting to the file: "stdout"
Sending request: PLAY rtsp://127.0.0.1:8554/unicast/ RTSP/1.0
CSeq: 5
User-Agent: openRTSP (LIVE555 Streaming Media v2020.05.15)
Session: 1F2DC088
Range: npt=0.000-10.000
Received 184 new bytes of response data.
Received a complete PLAY response:
RTSP/1.0 200 OK
CSeq: 5
Date: Mon, Mar 15 2021 19:28:09 GMT
Range: npt=0.000-
Session: 1F2DC088
RTP-Info: url=rtsp://127.0.0.1:8554/unicast/track1;seq=45874;rtptime=3295408827
Started playing session
Receiving streamed data (for up to 10.000000 seconds)...
Sending request: TEARDOWN rtsp://127.0.0.1:8554/unicast/ RTSP/1.0
CSeq: 6
User-Agent: openRTSP (LIVE555 Streaming Media v2020.05.15)
Session: 1F2DC088
Received 65 new bytes of response data.
Received a complete TEARDOWN response:
RTSP/1.0 200 OK
CSeq: 6
Date: Mon, Mar 15 2021 19:28:19 GMT
[root@KitchenCam:~]# mediainfo test.mp4
General
Complete name : test.mp4
Format : QuickTime <<<<<<<< FILE IS IN QUICKTIME FORMAT EVEN THOUGH WE SET -4 FLAG
Format/Info : Original Apple specifications
File size : 1.18 MiB
Duration : 12 s 700 ms
Overall bit rate : 778 kb/s
Encoded date : UTC 2021-03-15 19:28:09
Tagged date : UTC 2021-03-15 19:28:09
Writing library : Apple QuickTime
FileExtension_Invalid : braw mov qt
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 12 s 700 ms
Bit rate : 777 kb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 10.000 FPS
Original frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.037
Stream size : 1.18 MiB (100%)
Language : English
Encoded date : UTC 2021-03-15 19:28:09
Tagged date : UTC 2021-03-15 19:28:09
Codec configuration box : avcC
</em></pre>
</div>
</body>
</html>