Description:
I’m facing an issue with the multifilesink
element in GStreamer where the duration logged upon closing a file doesn’t match the actual duration when verified. Specifically, although I set the maximum file duration to 1 minute in the pipeline, the resulting file stream_101_00002.tts
has an actual duration of 1:14 when analyzed with gst-discoverer-1.0
.
Pipeline -
GST_DEBUG=“multifilesink*:6” gst-launch-1.0 udpsrc address=239.202.122.214 port=6310 do-timestamp=true timeout=60000000000 buffer-size=0 caps=“application/x-rtp,media=(string)video,clock-rate=(int)90000,encoding-name=(string)MP2T,payload=(int)103” ! rtpbin name=recv_rtp ! watchdog timeout=300000 ! tee name=raw_stream raw_stream. ! rtpmp2tdepay2 ! video/mpegts,packetsize=192 ! queue ! multifilesink next-file=5 max-file-duration=600000000000 location=stream_%05d.tts
Details:
- Added debug logs in
multifilesink
’sgst_multi_file_sink_close_file
andgst_multi_file_sink_write_buffer
functions to inspect the duration at the time of closing each file. - The logs show a calculated duration (based on PTS) of 1:00 (60 seconds) for
stream_101_00002.tts
, even though the actual file duration, as reported bygst-discoverer-1.0
, is 1:14.
Relevant Logs:
0:03:00.096861942 ^[[32m83215^[[00m 0x55ff7c5b7240 ^[[36mINFO ^[[00m ^[[00m multifilesink gstmultifilesink.c:742:gst_multi_file_sink_write_buffer:<multifilesink0>^[[00m new_duration: 600001 15419, max. duration 60000000000
0:03:00.097155245 ^[[32m83215^[[00m 0x55ff7c5b7240 ^[[36mINFO ^[[00m ^[[00m multifilesink gstmultifilesink.c:1124:gst_multi_file_sink_close_file:<multifilesink0>^[[00m File 'stream_101_0000 2.tts' duration (calculated with PTS): 0:01:00.000115419
201271 0:03:00.097160480 ^[[32m83215^[[00m 0x55ff7c5b7240 ^[[36mINFO ^[[00m ^[[00m multifilesink gstmultifilesink.c:1134:gst_multi_file_sink_close_file:<multifilesink0>^[[00m Buffer DTS is invalid
201272 0:03:00.097256008 ^[[32m83215^[[00m 0x55ff7c5b7240 ^[[36mINFO ^[[00m ^[[00m multifilesink gstmultifilesink.c:1099:gst_multi_file_sink_open_next_file:<multifilesink0>^[[00m opening file stre am_101_00003.tts
Verification with gst-discoverer-1.0
:
Are there recommended approaches to ensure that the actual file duration aligns closely with the specified maximum duration in the pipeline
Any insights or recommendations on resolving this discrepancy would be highly appreciated. Thank you!