Bug report: Assert failed near end of build of index for TS

Started by TCmullet, August 27, 2018, 05:48:13 PM

Previous topic - Next topic

TCmullet

I've done something I normally have no reason to do.  I have an MP4 file and need to remux it to a TS.  Remuxing it seemed to go fine.  But when I open the resulting file (my new .TS) and it tries to build the index, the build process almost finishes then gives this error:

Assert failed :0 at line 319, file /home/fx/hudson/workspace/mingw64QT5/avidemux/qt4/common/ADM_editor/src/ADM_segment.cpp


(I couldn't copy/paste that as the red X window doesn't allow me that; maybe allowing that could be a future enhancement to consider.)

The application has encountered a fatal problem  The current editing has been saved and will be reloaded at next start


Then when I pressed the "Details" button, it DOES allow me to copy/paste (THANKFULLY).

ADM_setCrashHook  [libADM_core6.dll]
ADM_setCrashHook  [libADM_core6.dll]
ADM_backTrack  [libADM_core6.dll]
ADM_EditorSegment::getRefVideo(int)  [avidemux.exe]
ADM_Composer::updateVideoInfo(aviInfo*)  [avidemux.exe]
ADM_Composer::addFile(char const*)  [avidemux.exe]
A_openVideo(char const*)  [avidemux.exe]
ADM_QT4_fileSel::GUI_FileSelRead(char const*, void (*)(char const*))  [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::searchFileMenu(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]
CallWindowProcW  [USER32.dll]
DispatchMessageW  [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]



As you can probably tell, this was in 64bit Avidemux, and it is 2.7.1.  I just deleted the index and tried to create it using 32bit 2.7.0 and had the same error except line 301 and other differences in the details.

TCmullet

I have an update.   I wondered if the problem might be garbage near the end of the MP4 clip I converted to TS.  So I created another new TS using only about the first 1/4 of my source MP4 file.  As before, the TS seemed to create okay.  But also as before, when opening the new TS, the index build process gets very near the end and blows up with the same error.  So somehow my conversion of MP4 to TS is not going well.   I really need to do this for reasons I can explain if needed.

eumagga0x2a

Can you play the .TS in, say, vlc? If yes, could you please provide the .TS (or the first ~200 MiB of it) as sample? If no, could you please provide the source MP4 file?

TCmullet

We are in luck.  I use ADM to cut out just 1 gop of my mp4 and it (1) comes to just within the very small upload file size, and (2) when I ran it through my process, it produced the same error as the 2 hr video.  So as one (former and hope to be again in the future) programmer to another, I am happy to enable you to reproduce the symptom at your end.

eumagga0x2a

Thank you for the sample. As a workaround you could edit the *.idx2 file and replace the misdetected framerate

Fps=1398132625

with something closer to the reality, e.g.

Fps=59940

Please edit also the misdetected audio sample rate (Track0.fq), it should be 48000. Avidemux should be able to load the TS video then.

For bigger samples, please use WeTransfer, Mega, Dropbox, Google Drive or similar.

eumagga0x2a

Found the bug in editor resulting in this crash, thanks. If the FPS provided by demuxer is improbably high, we call a function which requires at least one video segment to be present before we've added any.

TCmullet

Quote from: eumagga0x2a on August 28, 2018, 10:01:00 AM
Thank you for the sample. As a workaround you could edit the *.idx2 file and replace the misdetected framerate

Fps=1398132625

with something closer to the reality, e.g.

Fps=59940

Please edit also the misdetected audio sample rate (Track0.fq), it should be 48000. Avidemux should be able to load the TS video then.

For bigger samples, please use WeTransfer, Mega, Dropbox, Google Drive or similar.
Thanks for the tips on bigger files.

And for the workaround.  However, I must be doing something wrong as making those two changes results in ADM not able to open file.  Would you please take a look?  (See attached.)

eumagga0x2a

You deleted the newline before "Interlaced":

Quote[Video]
Width=1280
Height=720
Fps=59940Interlaced=0

Anyway, the crash as such should be fixed by [editor] Fix crash loading video with fps > 2000 as (mis)detected by demuxer. The issue with the file and/or with the demuxer persists, of course.

TCmullet

A couple of things:

Can you suggest a freeware editor that works better for editing an index file?  When I use Windows' Notepad, it shows no CR/LFs and it appears as one long line.  When I switch to "word wrap", then I can see all the content.  I more carefully made the two changes, then switched back to "no word wrap" before saving.

This was an improvement.  (I had earlier not been able to see that I had removed an invisible "newline" by selecting and copy/paste.  This time I added the new characters, then carefully deleted only the old ones by del key repeatedly.)  The TS opens in ADM, but pressing play causes another crash, "ExceptionFilter".  So, this workaround needs a bit more help, please.

2ndly, please let me know when you have a new version ready and how I can download it.

eumagga0x2a

Quote from: TCmullet on August 28, 2018, 01:24:35 PM
Can you suggest a freeware editor that works better for editing an index file?  When I use Windows' Notepad, it shows no CR/LFs and it appears as one long line.

e.g. notepad++

QuoteThe TS opens in ADM, but pressing play causes another crash, "ExceptionFilter".  So, this workaround needs a bit more help, please.

Please provide the TS file as sample then, I can't reproduce with "1gop-of-my-mp4.mp4" remuxed to transport stream.

Quoteplease let me know when you have a new version ready and how I can download it.

https://avidemux.org/nightly/win64/

There are no regular, timed builds. If requested and necessary, binaries are generated and uploaded when Mean gets some spare time. Linux and macOS users can build from source anytime, however.

TCmullet

Quote from: eumagga0x2a on August 28, 2018, 01:46:07 PM

Please provide the TS file as sample then, I can't reproduce with "1gop-of-my-mp4.mp4" remuxed to transport stream.


That's very odd.  If we both have the same data and same software (ADM 2.7.1 Win64), then we both should get same results.  I restarted all from scratch and got same crash result upon pressing play of 1gop-of-my-mp4.TS.  So I'll attach the TS and idx2.

Oops, the TS is slightly too big.  (ADM seems to have always slightly increased file sizes from my original.)  But I have stuffed them both into a zip file.  (Nice that Win now has that built in; no more WinZip needed.)

eumagga0x2a

Quote from: TCmullet on August 28, 2018, 02:59:02 PM
If we both have the same data and same software (ADM 2.7.1 Win64), then we both should get same results.

You should always test with the latest available nightly. I can't reproduce the crash with the updated sample using a build from the git master on my current platform, macOS. Do you have hw accelerated decoding enabled in Avidemux? If yes, please disable for testing purposes. Providing admlog.txt would not harm too.

TCmullet

Test?  I'm not "testing"; I'm "using", as the error occurred during "normal use".  I've never obtained a "nigihtly build", but only use publicly released versions.

No, I've never turned on "hardware acceleration".  But I can attach the admin log.

Uh, are you saying my little TS clip with the fudged index plays okay at your end?

eumagga0x2a

The attached Avidemux log doesn't originate from the session ending in the crash. Please reproduce the crash and try again without restarting Avidemux, the log is located in %localappdata%\avidemux\admlog.txt

All my feedback is based on the current git master or on one of the feature branches if they happen to be ahead of the master in some respect. I never use releases, but can test them if it is required to pinpoint a specific regression. All my work goes into the git repository, releases are outdated snapshots ridden with bugs which have been fixed meanwhile.

TCmullet

Oops, I had gone back into ADM to look for the HW accel you asked about.  I didn't realize the log is started from scratch each invocation.  Here is the log directly after the crash.