Author Topic: video duration when replacing audio track aac versus mp3  (Read 520 times)

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6052
video duration when replacing audio track aac versus mp3
« on: April 25, 2018, 07:43:42 AM »
With a loaded video (duration 1:41:47), both audio and video in copy mode, replacing the only audio track with an:
- mp3 (duration 1:52:22) upon saving the video, the original duration of the video is kept.
- aac (duration 1:51:21) upon saving the video, the duration of the video changes to the duration of the audio track.


This seems inconsistent to me. Consistent behavior would be: keep always the duration of the video content.

PS. doing some work with looped music ;)
« Last Edit: April 29, 2018, 11:14:41 AM by Jan Gruuthuse »

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2290
Re: video duration when replacing audio track aac versus mp3
« Reply #1 on: April 25, 2018, 03:47:12 PM »
I can't reproduce.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6052
Re: video duration when replacing audio track aac versus mp3
« Reply #2 on: April 26, 2018, 05:46:36 AM »
Looking into this. Can't recreate myself, for now.
Something did change again. M4a stereo, is loaded as ac3.
Trying to reinstate my used workflow. I'll keep you informed.

m4a (audacity created) causing issues: 1 file, 4.4 MB in total ・ Will be deleted on 3 May, 2018

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6052
Re: video duration when replacing audio track aac versus mp3
« Reply #3 on: April 26, 2018, 07:01:59 AM »
avidemux did become very unstable upon loading that aac audio track and crashes out.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2290
Re: video duration when replacing audio track aac versus mp3
« Reply #4 on: April 26, 2018, 10:22:07 AM »
Confirming crash in adtsIndexer::index.

WRT false positives produced by the AC3 detector, I'm aware of the issue, hoping that Mean finds some time to respond once bigger stuff has been sorted out.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2290
Re: video duration when replacing audio track aac versus mp3
« Reply #5 on: April 26, 2018, 11:07:42 PM »
Actually, it crashes in ADM_adts2aac::getAACFrame when we try to memcpy a buffer of negative size. However, fixing the crash doesn't help much, because we end up with non-seekable audio we can't handle.

Everything works fine without packing AAC into a m4a container.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6052
Re: video duration when replacing audio track aac versus mp3
« Reply #6 on: April 28, 2018, 05:28:38 AM »
Info commits:
- b60f408            [coreAudioParser/getAACFrame] Don't crash if calculated packetLen is insufficient
- 3356329            [Qt/audioTracks] Go to the last read directory when adding an external


partially  catch the m4a with aac, you get some warnings and avidemux does not crash out.
Hitting play the second time, avidemux does crash out.

Code: [Select]
[DecodePictureUpToIntra] 05:23:04-481   decode error for frame 1, not necessarily a problem
 [goToTimeVideo] 05:23:04-481  Seek done, in reference, gone to 60000 with segment start at 0
 [destroy] 05:23:04-481  Destroying preview
 [renderDisplayResize] 05:23:04-481  Render to 1280x720 zoom=1.0000, old one =1280 x 720, zoom=1.0000, renderer=0xdf1f40
 [renderDisplayResize] 05:23:04-481            No change, nothing to do
 [goToTime] 05:23:04-481  Resetting audio track [rewind] 05:23:04-481  [AudioBridge] Going to time 00:00:00,060
 [goToTime] 05:23:04-481  Resetting audio track [AUDMAudioFilter_Bridge] 05:23:04-481  [Bridge] Starting with time 00:00:00,060 , shift 0 ms
 [AUDMAudioFilter_Bridge] 05:23:04-481  [Bridge] Ending with time 00:00:00,060, sample 0
 [rewind] 05:23:04-481  [AudioBridge] Going to time 00:00:00,060
 [goToTime] 05:23:04-481  Resetting audio track [rewind] 05:23:04-481  [AudioBridge] Going to time 00:00:00,060

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6052
Re: video duration when replacing audio track aac versus mp3
« Reply #7 on: April 28, 2018, 04:33:05 PM »
looks fine be my, for now ;)
Quote
[create_edAudioExternal] 16:31:47-391  Got zero channels, the audio file must have been misidentified!

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2290
Re: video duration when replacing audio track aac versus mp3
« Reply #8 on: April 28, 2018, 10:14:18 PM »
Avidemux can handle only raw audio streams as external audio. Packing the stream into a container results in unexpected behavior, like ending up with the number of channels being equal zero. In the editor code, we use the # of channels as denominator at multiple locations, so it is necessary at least to reject such audio files before they trigger the division by zero crash later on --> [editor/audio] Refuse to add an external audio track with zero channels