How to repair MP4 files after power been interrupt or process been killed?

I saved mp4file by useing such pipeline ‘h265-》h265parse-》mp4mux-》filesink’, and the mp4file was right when get “eos” signal.
But sometiome the process will been kill or the power will been interrupt, the mp4-file could’not play because the index table and total length are not written,how can I repair such MP4 files?
Or is there a better way to save MP4?Does Deepstream have a better record solution?

Hi,
If it is possible to have sudden termination in your use-case, we would suggest use matroskamux to save to a mkv file. It can keep most previous content. Last few frames may be lost though.

1 Like

Hello,DaneLL
Thank you for your reply!
I have a new question want to ask you,I want to save mp4file by the follow pipeline ,the “test.h265” was encoded by nvv4l2h265enc-plugin with “insert-vui” parameter,and it can play right in VLC//ffplayer/KMplyer with it’s actual frame rate.
" gst-launch-1.0 filesrc location=test.h265 ! ‘video/x-h265, alignment=(string)au’ ! h265parse ! mp4mux ! filesink location=test.mp4 -e",

But the pipeline was fail with the follow error.How can I solve it?
image

Hi,
Please try matroskamux or qtmux. If the issue is still present, may try to decode the stream, put pts information with videorate, and re-encode/re-mux to MP4.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.