<div dir="ltr"><div class="gmail-s-prose gmail-js-post-body">
<p>I have been recording video streams on my Jetson Xavier NX using a simple gstreamer pipeline such as this</p>
<pre><code><br>gst-launch-1.0 -v \
nvarguscamerasrc sensor-id=0 ! \
'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! \
nvv4l2h265enc ! 'video/x-h265, stream-format=(string)byte-stream' ! \
h265parse ! qtmux ! filesink location=video.mp4 -e<br>
</code></pre>
<p>All is working if the recording is interrupted by keyboard interrupt <code>Ctrl + C</code>,
but if the recording is interrupted unexpectedly (e.g. power gets
disconnected) the resulting file has no playable stream, even if the
file size is correct.</p>
<p>I know that mp4 recording needs to be stopped properly otherwise it
won't have the necessary information at the end of the file, but I was
wondering if there was any other gstreamer pipelines or final file
formats that would allow for an H265 encoded video file to be playable
even if the recording is ended unexpectedly.</p>
<p>It would be good even if the recorded file needed to be converted
before being playable (e.g. with ffmpeg), as long as the information can
be recovered without having to go through non-free mp4 recovery tools.</p>
</div></div>