[Bug] EXCEPTION_ACCESS_VIOLATION when the video file lacks an audio track.

Started by acritum, May 31, 2017, 03:10:22 PM

Previous topic - Next topic

acritum


v2.7 170525


When we open a normal video with an audio track and append a video with the same video codec, dimensions, etc, but without an audio track, Avidemux opens it fine, but if we move the pointer to the second part of the video or try to save the joined video, the software crashes with the following:

QuoteEXCEPTION_ACCESS_VIOLATION
EditableAudioTrack::~EditableAudioTrack()  [avidemux.exe]
ADM_setCrashHook  [libADM_core6.dll]
ADM_setCrashHook  [libADM_core6.dll]
ADM_setCrashHook  [libADM_core6.dll]
UnhandledExceptionFilter  [kernel32.dll]
MD5Final  [ntdll.dll]
_C_specific_handler  [ntdll.dll]
RtlDecodePointer  [ntdll.dll]
RtlUnwindEx  [ntdll.dll]
KiUserExceptionDispatcher  [ntdll.dll]
EditableAudioTrack::~EditableAudioTrack()  [avidemux.exe]
ADM_edAudioTrackFromVideo::getPacket(unsigned char*, unsigned int*, unsigned int, unsigned int*, unsigned long long*)  [avidemux.exe]
ADM_audioStreamCopy::getPacket(unsigned char*, unsigned int*, unsigned int, unsigned int*, unsigned long long*)  [avidemux.exe]
muxerFFmpeg::saveLoop(char const*)  [libADM_coreMuxer6.dll]
admSaver::save()  [avidemux.exe]
A_Save(char const*)  [avidemux.exe]
A_SaveWrapper(char const*)  [avidemux.exe]
ADM_QT4_fileSel::GUI_FileSelWriteExtension(char const*, char const*, void (*)(char const*))  [avidemux.exe]
HandleAction_Save(Action)  [avidemux.exe]
HandleAction(Action)  [avidemux.exe]
MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)  [avidemux.exe]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
MainWindow::actionSignal(Action)  [avidemux.exe]
MainWindow::searchToolBar(QAction*)  [avidemux.exe]
MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)  [avidemux.exe]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
QToolBar::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)  [Qt5Widgets.dll]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
QToolButton::setArrowType(Qt::ArrowType)  [Qt5Widgets.dll]
QToolButton::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)  [Qt5Widgets.dll]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
QAction::activate(QAction::ActionEvent)  [Qt5Widgets.dll]
QAbstractButton::keyPressEvent(QKeyEvent*)  [Qt5Widgets.dll]
QAbstractButton::mouseReleaseEvent(QMouseEvent*)  [Qt5Widgets.dll]
QToolButton::mouseReleaseEvent(QMouseEvent*)  [Qt5Widgets.dll]
QWidget::event(QEvent*)  [Qt5Widgets.dll]
QToolButton::event(QEvent*)  [Qt5Widgets.dll]
QApplicationPrivate::notify_helper(QObject*, QEvent*)  [Qt5Widgets.dll]
QApplication::notify(QObject*, QEvent*)  [Qt5Widgets.dll]
QCoreApplication::notifyInternal2(QObject*, QEvent*)  [Qt5Core.dll]
QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)  [Qt5Widgets.dll]
QDesktopWidget::qt_metacall(QMetaObject::Call, int, void**)  [Qt5Widgets.dll]
QDesktopWidget::qt_metacall(QMetaObject::Call, int, void**)  [Qt5Widgets.dll]
QApplicationPrivate::notify_helper(QObject*, QEvent*)  [Qt5Widgets.dll]
QApplication::notify(QObject*, QEvent*)  [Qt5Widgets.dll]
QCoreApplication::notifyInternal2(QObject*, QEvent*)  [Qt5Core.dll]
QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)  [Qt5Gui.dll]
QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)  [Qt5Gui.dll]
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Gui.dll]
QEventDispatcherWin32Private::sendTimerEvent(int)  [Qt5Core.dll]
GetSystemMetrics  [USER32.dll]
GetSystemMetrics  [USER32.dll]
QEventDispatcherWin32::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Core.dll]
qt_plugin_instance  [qwindows.dll]
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Core.dll]
QCoreApplication::exec()  [Qt5Core.dll]
UI_RunApp()  [avidemux.exe]
startAvidemux(int, char**)  [avidemux.exe]
SDL_main  [avidemux.exe]
ms2timedisplay(unsigned int)  [avidemux.exe]
unknown function  [avidemux.exe]
unknown function  [avidemux.exe]
BaseThreadInitThunk  [kernel32.dll]
RtlUserThreadStart  [ntdll.dll]


If we open a video without an audio track, go to audio, select track, select track 1 (empty), click OK, we get:

Quote
EXCEPTION_ACCESS_VIOLATION
audioTrackQt4::updateActive()  [avidemux.exe]
ADM_setCrashHook  [libADM_core6.dll]
ADM_setCrashHook  [libADM_core6.dll]
ADM_setCrashHook  [libADM_core6.dll]
UnhandledExceptionFilter  [kernel32.dll]
MD5Final  [ntdll.dll]
_C_specific_handler  [ntdll.dll]
RtlDecodePointer  [ntdll.dll]
RtlUnwindEx  [ntdll.dll]
KiUserExceptionDispatcher  [ntdll.dll]
audioTrackQt4::updateActive()  [avidemux.exe]
audioTrackQt4::run()  [avidemux.exe]
A_audioTrack()  [avidemux.exe]
HandleAction(Action)  [avidemux.exe]
MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)  [avidemux.exe]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
MainWindow::actionSignal(Action)  [avidemux.exe]
MainWindow::searchAudioMenu(QAction*)  [avidemux.exe]
MainWindow::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)  [avidemux.exe]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
QMenu::showTearOffMenu()  [Qt5Widgets.dll]
QMenu::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)  [Qt5Widgets.dll]
QMetaObject::activate(QObject*, int, int, void**)  [Qt5Core.dll]
QAction::activate(QAction::ActionEvent)  [Qt5Widgets.dll]
QMenu::setIcon(QIcon const&)  [Qt5Widgets.dll]
QMenu::leaveEvent(QEvent*)  [Qt5Widgets.dll]
QMenu::mouseReleaseEvent(QMouseEvent*)  [Qt5Widgets.dll]
QWidget::event(QEvent*)  [Qt5Widgets.dll]
QMenu::event(QEvent*)  [Qt5Widgets.dll]
QApplicationPrivate::notify_helper(QObject*, QEvent*)  [Qt5Widgets.dll]
QApplication::notify(QObject*, QEvent*)  [Qt5Widgets.dll]
QCoreApplication::notifyInternal2(QObject*, QEvent*)  [Qt5Core.dll]
QApplicationPrivate::sendMouseEvent(QWidget*, QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)  [Qt5Widgets.dll]
QDesktopWidget::qt_metacall(QMetaObject::Call, int, void**)  [Qt5Widgets.dll]
QDesktopWidget::qt_metacall(QMetaObject::Call, int, void**)  [Qt5Widgets.dll]
QApplicationPrivate::notify_helper(QObject*, QEvent*)  [Qt5Widgets.dll]
QApplication::notify(QObject*, QEvent*)  [Qt5Widgets.dll]
QCoreApplication::notifyInternal2(QObject*, QEvent*)  [Qt5Core.dll]
QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::MouseEvent*)  [Qt5Gui.dll]
QGuiApplicationPrivate::processWindowSystemEvent(QWindowSystemInterfacePrivate::WindowSystemEvent*)  [Qt5Gui.dll]
QWindowSystemInterface::sendWindowSystemEvents(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Gui.dll]
QEventDispatcherWin32Private::sendTimerEvent(int)  [Qt5Core.dll]
GetSystemMetrics  [USER32.dll]
GetSystemMetrics  [USER32.dll]
QEventDispatcherWin32::processEvents(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Core.dll]
qt_plugin_instance  [qwindows.dll]
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>)  [Qt5Core.dll]
QCoreApplication::exec()  [Qt5Core.dll]
UI_RunApp()  [avidemux.exe]
startAvidemux(int, char**)  [avidemux.exe]
SDL_main  [avidemux.exe]
ms2timedisplay(unsigned int)  [avidemux.exe]
unknown function  [avidemux.exe]
unknown function  [avidemux.exe]
BaseThreadInitThunk  [kernel32.dll]
RtlUserThreadStart  [ntdll.dll]


acritum

In fact, what I'm trying to do is to mute a part of video. I have a file that contains Action, Speech, Action. I want to keep both Actions with sound and mute Speech. I found that it's damn hard to do with Avidemux. I exported 3 parts into files: p1, p2, p3. I kept p1 and p3 the same, and p2 seems to be the PITA. I tried to remove the audio track at all, I tried to replace the sound track with some fake sound from a different file, I tried to find something in filters to mute the sound, but the filters are poor and the GAIN section only allows to decrease sound -10db which is not enough. Finally, when I try to join all 3 videos, I get a file that never works, no matter what I did with p2. I tried both Copy streams and AAC reencoding. Video players just don't play it correctly.

So I wonder, is there any working way to mute a part of the video? If there is none, maybe it's worth to add some "mute" checkbox to filters, or at least let the GAIN control accept values less than -10. I believe if we put -999999 here, it will completely mute the audio.

eumagga0x2a

Avidemux is mostly unsuitable for audio editing. Finish cutting the source video with the audio as-is, extract the soundtrack from the saved video to a wave file, edit it without modifying the duration e.g. in Audacity, add the result as an external soundtrack in Avidemux and save the video with video codec set to copy and audio to a codec of your choice.

acritum

Thanks, your method seems to work but it's not so easy. The file that is exported with Audio-Save Audio is AAC and cannot be opened with Sound Forge 10 or Audacity and I do not see any option to save as WAV (without any video container). First I had to convert the video to WAV with VLC player and then I edited it in Sound Forge. Finally that modified WAV was accepted by Avidemux. Quite a bag of troubles for a simple task that may be needed in many situations. I hope this will be more simple to do some day. At least the possibility to mute the whole audio without removing the audio track is extremely needed (I don't even dream of muting parts of an audio track because it is difficult to implement).

eumagga0x2a

Quote from: acritum on June 01, 2017, 01:29:33 PM
The file that is exported with Audio-Save Audio is AAC

Right, that is why I didn't write that you should use "save audio" in Avidemux :-)

Instead of VLC, I'd use mpv for the task:

mpv --no-video --ao=pcm --ao-pcm-file=/path/to/extracted/soundtrack.wav /path/to/video

QuoteAt least the possibility to mute the whole audio without removing the audio track is extremely needed

Unsure what the point of a soundtrack containing only silence should be. The use case of appending videos where some should be silent and some not seems extremely artificial for me.

acritum

Quote from: eumagga0x2a on June 01, 2017, 05:40:09 PM
Unsure what the point of a soundtrack containing only silence should be. The use case of appending videos where some should be silent and some not seems extremely artificial for me.

The point is simple: to increase compatibility. Although video files without an audio stream seem to comply with standards, some video software cannot work correctly with videos that have the audio track completely removed. I think all video "joiners" will have problems with such files because they require a video and an audio tracks of the same nature to join files fast and without recompression.

Silent videos may be needed in some cases (for example, because of privacy). When a video is to be published on youtube, not all conversations should become public and I respect privacy ;-)