Handling of the error message 'Too short' (in German 'Video zu kurz')

Started by manno24, December 28, 2020, 03:33:22 PM

Previous topic - Next topic

manno24

Hello,
Avidemux is the tool I am using to cut off the unneeded head and tail of TV video recordings. My recordings are in TS format but the video can be saved in mp4 format using copy mode. So the recorded HD quality of the video is unchanged. That's fine for me.

There is one little problem occuring sometimes during the saving ("encoding...") process of Avidemux:

Error message in German:
    Video zu kurz
    Das gespeicherte Video ist unvollständig. Der Fehler ereignete sich bei
    01:20:52,060 (89). Dies kann eine Folge ungĂĽltiger Zeitstempel im Video
    sein.

Possible Englisch Translation:
    Video too short
    The saved video is incomplete. The error occurred at
    01:20:52,060 (89). This can be a result of invalid timestamps in the video.

In my case this seems to be mainly caused by rare accidental transmission errors in our cable TV network showing up as artifacts and pixel erros in the video being displayed.

The defect rarely affects more than one I-frame of the video, which in the following I cut out using the hint in Avidemux error message to navigate to the affected video location. So there is a small gap in the final video... ok.

My question or possible wish is:

- Can Avidemux be configured to ignore the occurrence of the artifact(s) and save the video as is and give a final error report of all error locations if needed (possibly with an upper limit of the number of detected errors) i.e. without stopping the saving/encoding process? NOTE: Choosing the existing option 'no messages at all' lets processing end up at the affected location of the stream too but without any error message.

- If this is not possible at present would it be possible in a future version of Avidemux?

- If the previous case is not possible would it be possible to stop processing rather quickly when the error interrupt has occured (eg. without further saving) because the video will still be handled in the following by cutting off the defective I-frame(s)?

Best regards, Manfred


eumagga0x2a

Quote from: manno24 on December 28, 2020, 03:33:22 PM- Can Avidemux be configured to ignore the occurrence of the artifact(s) and save the video as is

No, this is not possible as the error is produced by the muxer (here: libavformat) refusing to accept bad (not advancing) values of decode timestamps (DTS). Depending on particular case, duplicate DTS can result also from timestamp rounding in the muxer. Ideally, retrograde or else bogus timestamps should be filtered out in the editor.

Quote from: manno24 on December 28, 2020, 03:33:22 PM- If the previous case is not possible would it be possible to stop processing rather quickly when the error interrupt has occured (eg. without further saving)

Saving is stopped immediately if libavformat doesn't like timestamps we pass to it. The delay you experience originates probably from streaming optimization, specific to MP4 container (it requires the entire file to be rewritten). If you always play the file from local storage rather than over network, you can disable it in the settings of the MP4 muxer or choose MKV instead of MP4.

eumagga0x2a

Just in case, please make sure you use the latest 64-bit nightly, not the 2.7.6 release. This probably won't help with damaged MPEG-TS streams, but will still greatly reduce the number of bugs, especially relevant for copy mode.

manno24

Thanks for the information!
There is no problem for me that the muxer refuses to accept bad (not advancing) values in the video stream -- so I will go on cutting off bad I-frames with the editor.
There is no change regarding this in Avidemux 2.7.7 (201217_f1fca08cfbd-fflibs 4.2.4). Both versions, 2.7.6 release and 2.7.7 latest nightly build, are stopping with the too short error event at the same time in the video under test.
Switching off the streaming optimization under mp4 encoding lets return control from the too short error event immediately. Thanks for this hint!

eumagga0x2a

Quote from: manno24 on December 31, 2020, 10:29:52 AMBoth versions, 2.7.6 release and 2.7.7 latest nightly build, are stopping with the too short error event at the same time in the video under test.

You did re-index the source MPEG-TS file by deleting the corresponding *.idx2 file, didn't you?

Would it be possible for you to provide the part of the file containing the damaged section as a sample, please?

manno24

I didn't re-index the source MPEG-TS file -- but it was the same after I have done it.

Meanwhile, my interpretation of the cause of the error event has changed. A recording usually takes about 2 hours. This produces an MPEG-TS stream of more than 4GB of data. The recording device devides the stream into blocks of files of 4GB size. Avidemux gives the option to put together all that blocks when opening the first block of the stream. I choose that option. I found out that the joining point of two such blocks causes the 'too short' message often. I cannot say that this appears at every joining point. Additionally, I tested each block itsself i.e. without joining it with the next block. In that case I experienced no error when saving the block in MP4 copy mode. For this I tested about ten different blocks. So it seems that there is usually no transmission error in the cable network.

I assume that this is a problem with the recording device i.e. how it creates the transition between 2 blocks of the MPEG-TS stream.

eumagga0x2a

Quote from: manno24 on January 02, 2021, 05:43:53 PMI assume that this is a problem with the recording device i.e. how it creates the transition between 2 blocks of the MPEG-TS stream.

If it either slaps some sort of a header onto each chunk or loses a few bytes, this may cause all kinds of irregularities. There should not be any transition at all, the next file should just continue the previous one.