Author Topic: Avidemux 2.7 (64 bit) - Video too short error while cutting/saving MPG-file  (Read 449 times)

Yisc76

  • Newbie
  • *
  • Posts: 22
I'm trying to cut an MPG-file and then save it.
When saving the file, I get the error: Too short
I tried saving it with 'MKV Muxer' and then get that error.
When I try to save it using  the 'AVI Muxer', it says that the file is succesfully saved, but then the file is only 33 KB, which isn't right for a file of 14min27sec.
I've seen this problem a long time ago in Avidemux and then it got solved at some point.





http://sjoerd.rosdorff.dyndns.org/test/avidemux27/admlog.txt

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1473
You ignored the warning regarding cuts not on intra, didn't you? Anyway, please try with the latest nightly. If the problem persists, please report.

By the way, you don't need to delete the start and the end of a video if all you want is to save the part in-between. Just set the marker A to the I-frame where you would like the saved video to start and the marker B where it should end and save the video.

Yisc76

  • Newbie
  • *
  • Posts: 22
Gave the latest nightly (r171027) a try.
The error "Too short" is gone but the MKV Muxer results in a file of 1KB, while the AVI Muxer gives me a file of 33KB.

http://sjoerd.rosdorff.dyndns.org/test/avidemux27/admlog_nightly_r171027.txt

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1473
You again operate with deleting instead of saving directly... The problem itself looks to be related to the MpegPS demuxer and be specific to the source video. Please provide a sample.

Yisc76

  • Newbie
  • *
  • Posts: 22
You again operate with deleting instead of saving directly... The problem itself looks to be related to the MpegPS demuxer and be specific to the source video. Please provide a sample.

I always use delete instead of making a selection.
Basicly because most recordings are from commercial tv stations, which requires me to cut out several commercial breaks.
This recording isn't from a commercial station and isn't in HD either.

Here's the link to the file giving troubles: https://www.dropbox.com/s/qy37f1bmepmtjhd/Leidens%20Ontzet%202017-20171008_raw.mpg?dl=0

*edit* I've just cut the video without deleting (just made the selection like you said) things, and then the video is saved correctly
« Last Edit: October 28, 2017, 12:08:49 PM by Yisc76 »

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1473
Thank you, I've got the sample and will look at it later.

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1473
You should never ignore a "cut/delete is not on intra" warning. The end point of the first delete = the start point of saving the video was a B-frame. Saving succeeds when all cut points are on I-frames. Please stick to it or reencode.

In this particular case saving in copy mode failed completely because the MPEG-PS demuxer supports only two scenarios when requested to deliver a frame with a particular frame number:

a) the number is the last sent frame incremented by one;

or

b) the number matches an intra (a keyframe).

Otherwise getFrame fails.

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1473
I've copied the code from the MpegTS demuxer to the MpegPS one which implements retrieving random frames. The demuxer won't fail now, but the result will be unsatisfactory nevertheless, because you never put cut points on B-frames when in copy mode...

Yisc76

  • Newbie
  • *
  • Posts: 22
Thanks for looking into the issue and the feedback.
I will remove the large file from my Dropbox now.

arnoldpredator

  • Newbie
  • *
  • Posts: 29
I had the same problem, I changed the video output from x264 to xvid4 and never got it again.

Oleg_K

  • Newbie
  • *
  • Posts: 6
Re: Avidemux 2.7 (64 bit) - Video too short error while cutting/saving MPG-file
« Reply #10 on: November 14, 2017, 10:54:50 PM »
And i have this problem. I edit the video recorded from different sources of TV broadcasting. Often with errors in the flow.

For input/output files use only TS demuxer. Cut only on key frames. Often I can not save the result because of this error.If the file is not saved correctly, I to save as a project script, parsing ".py" file (adm.addSegment(0, 16040000, 41280000)) and use a script that cuts with ffmpeg (ffmpeg options -ss and -t). I get a lot of files from which, using ffmpeg (-f concat), I make one file.

Previously, avidemux warned that the file was not completely saved, but now silently keeps the corrupted file.

Compiled the  latest nightly ,will try...

P.S.
I try. Open "source.ts" (~1 minute), save "saved.ts" in TS demuxer. Result - "source.ts" - ~8 seconds.Avidemux says: "Done. File saved.ts has been successfully saved."

source.ts - https://drive.google.com/open?id=1H1PI_qQ3ffAJGtkzGjS2x37elMMbCybr
saved.ts - https://drive.google.com/open?id=1JtxqmmxXRbcN_K8DFARwvHoc3_fhZc3d
avidemux-log.txt - https://drive.google.com/open?id=1BIs9_TIb9qq9SaOB5YcpWdOTzemzSsAi

P.P.S
Other situation, other file:
Open "source2.ts" (~3 minute), save "saved2.ts" in TS demuxer. Result - "source2.ts" - ~1:25. Avidemux says: "Too short. The saved video is incomplete. The error occured at 00:01:24,300 (47%). This may happen as result of invalid time stamps in the video."

source2.ts - https://drive.google.com/open?id=17_20rI8DjaU_dx7Fi_xrN3M1xA71-70H
saved2.ts - https://drive.google.com/open?id=1TWbbutsgGlngPXWBxbmGzJUYB89wTSkl
avidemux-log2.txt - https://drive.google.com/open?id=1mesEGgvH1TfDj657P3NX0aRBRmiA368-

P.P.P.S (last...)

"Too short. The saved video is incomplete. The error occured at 00:00:11,260 (19%). This may happen as result of invalid time stamps in the video."

source3.ts - https://drive.google.com/open?id=1PdpvfxBh6fiHccBRff2b0paWd5kGoJ8A
saved3.ts - https://drive.google.com/open?id=1zbiHd5HjbWDupYacJrlGO8nqgtOZLbYk
avidemux-log3.txt - https://drive.google.com/open?id=1jaOQYswrl8iZSgQK3CTVQSIyXCltIIai

« Last Edit: November 15, 2017, 08:43:17 AM by Oleg_K »

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1473
Re: Avidemux 2.7 (64 bit) - Video too short error while cutting/saving MPG-file
« Reply #11 on: November 16, 2017, 10:41:31 PM »
Your problem is not related to the topic.

The first sample fails to save completely because the PTS of the frame 208 is absurdly high (13 hours 14 minutes 18 seconds) . The save loop exits once the presentation time of a compressed frame exceeds the max duration which is ~59 seconds here.

The second one can be saved till the end with DTS sanitizing (Edit --> Preferences --> Output --> Sanitize decode time stamps (DTS) in copy mode) enabled, which simply means frames with DTS going back get dropped, resulting in severe video corruption and drop-outs.

Avidemux has very limited capabilities to handle severely corrupted input. Ignoring time stamps entirely would allow the streams to be saved but due to the presence of B-frames the result would be playable only in selected video players (maybe in mpv, but for sure not in vlc).

Oleg_K

  • Newbie
  • *
  • Posts: 6
Re: Avidemux 2.7 (64 bit) - Video too short error while cutting/saving MPG-file
« Reply #12 on: November 17, 2017, 11:28:43 AM »
Your problem is not related to the topic.

Thanks for the answer.
Sorry. It seemed that the situation is very similar...

Quote
The first sample fails to save completely because the PTS of the frame 208 is absurdly high (13 hours 14 minutes 18 seconds) . The save loop exits once the presentation time of a compressed frame exceeds the max duration which is ~59 seconds here.

Very bad. In my files this is often present. I have to constantly check the result of the save and use ffmpeg (how he does it?) if the file is incomplete. For example, today from the five-hour file, 70 fragments were cut out and it was not completely saved.

Quote
The second one can be saved till the end with DTS sanitizing (Edit --> Preferences --> Output --> Sanitize decode time stamps (DTS) in copy mode) enabled, which simply means frames with DTS going back get dropped, resulting in severe video corruption and drop-outs.

For this - many thanks. In many cases this works. Can this advice be expressed in a message about an incomplete saved file? That in the future such questions did not arise.

Quote
Avidemux has very limited capabilities to handle severely corrupted input. Ignoring time stamps entirely would allow the streams to be saved but due to the presence of B-frames the result would be playable only in selected video players (maybe in mpv, but for sure not in vlc).

Almost in all cases, the files I saved are only required for further editing and coding with another codec, therefore, the subsequent compatibility is only necessary with avidemux or ffmpeg.

Avidemux is the only editor that is suitable for my tasks. Thanks to the developers for such a wonderful tool.

eumagga0x2a

  • Hero Member
  • *****
  • Posts: 1473
Re: Avidemux 2.7 (64 bit) - Video too short error while cutting/saving MPG-file
« Reply #13 on: November 21, 2017, 08:16:50 AM »
The second one can be saved till the end with DTS sanitizing (Edit --> Preferences --> Output --> Sanitize decode time stamps (DTS) in copy mode) enabled, which simply means frames with DTS going back get dropped, resulting in severe video corruption and drop-outs.

For this - many thanks. In many cases this works. Can this advice be expressed in a message about an incomplete saved file? That in the future such questions did not arise.

No. This option to toggle editor-internal DTS sanitizing has been introduced for testing purposes only and will be removed again ASAP (it means, it should work without the need to modify settings).