Author Topic: Premature end when transcoding HDTV AVC file  (Read 562 times)

RocketJet

  • Newbie
  • *
  • Posts: 10
Premature end when transcoding HDTV AVC file
« on: April 08, 2018, 01:19:08 PM »
Hi,

I have a recurring problem when transcoding HDTV files originating from AverTV.
The input video codec is AVC, and I am transcoding to HEVC.
Audio is in copy mode.
The transcode ends prematurely, presumably due to a reception error.

Sample: http://www.mediafire.com/file/u6zdw1paqx8l0t8/TEST_AverTV_HD.mp4

There is also a problem that no error message is generated.
It instead says that the file has beev saved successfully,
but in fact it has ended well before the end of file.

Note: The problem does not occur if video is in copy mode.

I am running the lastest nightly: 180405.

RJ
« Last Edit: April 08, 2018, 01:23:55 PM by RocketJet »

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2293
Re: Premature end when transcoding HDTV AVC file
« Reply #1 on: April 08, 2018, 02:07:14 PM »
I would like to encourage you to inspect the Avidemux log yourself to identify the exact error message (I would assume that decoding fails for too many frames in a row). There is no need to reencode for that, just play the source video.

RocketJet

  • Newbie
  • *
  • Posts: 10
Re: Premature end when transcoding HDTV AVC file
« Reply #2 on: April 08, 2018, 03:05:20 PM »
I have looked at the admlog.txt file, and there are indeed lots of errors, although some of them  contain the phrase "not necessarily a problem".

I have uploaded the admlog.txt file to: http://www.mediafire.com/file/r5bl3x52ywc41c9/admlog.txt

RJ

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2293
Re: Premature end when transcoding HDTV AVC file
« Reply #3 on: April 08, 2018, 03:06:29 PM »
Thanks, will look at the log.

Currently it makes no difference from the POV of Avidemux whether decoding fails due to EOF or due to video corruption. It would be indeed nice to warn the user if encoding has stopped prematurely due to decoder bailing out.

We could also try to avoid getting stuck when encountering a damaged portion of video by trying to skip to the next keyframe. Side effects of such strategy may be worse than a honest failure though.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2293
Re: Premature end when transcoding HDTV AVC file
« Reply #4 on: April 08, 2018, 03:21:36 PM »
The decoder fails to decode frame 600 in the stream order and we don't encounter a frame within the following 19 frames where we could resume. Indeed, it would be nice to let user know, we are more than 30 seconds short of the segment end.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2293
Re: Premature end when transcoding HDTV AVC file
« Reply #5 on: April 08, 2018, 08:23:08 PM »
We could also try to avoid getting stuck when encountering a damaged portion of video by trying to skip to the next keyframe.

Actually, this approach works nicely with your sample. No side effects spotted so far.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2293
Re: Premature end when transcoding HDTV AVC file
« Reply #6 on: April 09, 2018, 11:11:59 AM »
The time in the sample where decoding fails permanently — did you delete a portion of video there, then saved in copy mode?

RocketJet

  • Newbie
  • *
  • Posts: 10
Re: Premature end when transcoding HDTV AVC file
« Reply #7 on: April 09, 2018, 12:05:41 PM »

Yes, I originally edited the file in copy mode,
but as my hard disk started getting full,
I decided to go back and compress files using HEVC.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2293
Re: Premature end when transcoding HDTV AVC file
« Reply #8 on: April 09, 2018, 12:42:56 PM »
Okay, it is a known but not yet properly understood issue then. I have a workaround which I will push if no solution can be found.

Info messages about decoding failure for every second frame are likely an artifact of frame vs. field handling and so far normal.