Avidemux Forum

Avidemux => Stable branch (2.5) discussion => Topic started by: tuharsky on February 12, 2012, 05:40:12 PM

Title: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on February 12, 2012, 05:40:12 PM
I have encoded some videos using Avidemux 2.5.4 (Debian multimedia version): MPEG4 ASP (XviD), MP3, MKV. Now I open the file in Avidemux (same version again), set AB markers and try to save a part of video, i.e. from frame 0 to 2000. Audio and video are set to COPY and container to MKV. The save ends up with error. It seems that during saving it reaches some "no-go" point that it cannot cope with.

Can I post a sample file somewhere (100MB)?
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: nibbles on February 12, 2012, 09:39:21 PM
You might try 2.5.6 if there's a tarball for your OS.
You can upload to Rapidshare, but maybe 25MB is probably easier.
Gist a copy of your log, the whole thing from when you start avidemux through the error.
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on February 14, 2012, 04:01:00 PM
I couldn't compile the 2.5.6 version. The process ends up with error on 97%. Is there any howto in order to get a log?
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: Jan Gruuthuse on February 15, 2012, 04:05:43 PM
log: copy paste fult terminal output (http://www.avidemux.org/smf/index.php?topic=10156.msg55053#msg55053) <-click
On what flavor of Linux are you trying to compile? Perhaps a dependency did not install? Check these individually:
sudo apt-get install build-essential
sudo apt-get install cmake
sudo apt-get install fakeroot
sudo apt-get install gcc
sudo apt-get install g++
sudo apt-get install gettext
sudo apt-get install liba52-0.7.4
sudo apt-get install liba52-0.7.4-dev
sudo apt-get install libasound2-dev
sudo apt-get install libarts1-dev
sudo apt-get install libfaac-dev
sudo apt-get install libfaad-dev
sudo apt-get install libgtk2.0-dev
sudo apt-get install libglib2.0-dev
sudo apt-get install libmad0-dev
sudo apt-get install libpng12-dev
sudo apt-get install libqt4-dev
sudo apt-get install libqt4-opengl
sudo apt-get install libqt4-opengl-dev
sudo apt-get install libvorbis-dev
sudo apt-get install libx264-dev
sudo apt-get install libxv-dev
sudo apt-get install libxml2-dev
sudo apt-get install libxvidcore-dev
sudo apt-get install make
sudo apt-get install pkg-config
sudo apt-get install subversion
sudo apt-get install yasm

Unless you use KDE 3 with aRts, you don't need libarts (libarts1-dev). It's obsolete (and therefore not available in the default repositories anymore).
sudo apt-get install libarts1-dev
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on February 24, 2012, 08:44:04 AM
I use Debian Squeeze with enabled repositories debian-multimedia. Everything is installed, here is the output from compilation.
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: Jan Gruuthuse on February 24, 2012, 10:06:48 AM
Complains of missing files?
Quotegcc: ffmpeg.o: Adresár alebo súbor neexistuje
gcc: cmdutils.o: Adresár alebo súbor neexistuje

Quote[ 94%] Building CXX object avidemux/ADM_UIs/ADM_QT4/src/CMakeFiles/ADM_UIQT4.dir/FAC_frame.cpp.o
ADM_infoExtractor/libADM_infoExtractor_cli.a(ADM_infoextractor_h264.cpp.o): In function `get_se_golomb':
ADM_infoextractor_h264.cpp:(.text+0x347): undefined reference to `ff_se_golomb_vlc_code'
collect2: ld returned 1 exit status
make[2]: *** [avidemux/avidemux2_cli] Error 1
make[1]: *** [avidemux/CMakeFiles/avidemux2_cli.dir/all] Error 2
If you used tarball 2.5.6 Can you use this svn? svn co svn://svn.berlios.de/avidemux/branches/avidemux_2.5_branch_gruntster/
This  is the latest source, perhaps issues have gone in this version?
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on February 25, 2012, 06:22:40 AM
I'm afraid SVN makes no difference eventually  ???
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: nibbles on February 25, 2012, 07:43:55 AM
A few of things come to mind.  First is what compiler are you using?  I think I saw gcc.  If so please tell me what it says:

gcc --version

Next, we can get a lot more info out of CMake if we build verbosely.  Please change this line in bootStrap.sh

cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DAVIDEMUX_INSTALL_PREFIX=$PREFIX .. || fail cmake

to read this

cmake -DCMAKE_VERBOSE_MAKEFILE=true -DCMAKE_INSTALL_PREFIX=$PREFIX -DAVIDEMUX_INSTALL_PREFIX=$PREFIX .. || fail cmake

Also, ffmpeg has been known to be twitchy when you compile in parallel.  Please change this line in bootStrap.sh

make -j 3 || fail make_main

to read this:

make -j 1 || fail make_main

Do a clean extract and build like you did before.  When you want to show us what happened, please do not attach your log file.  Please paste your logfile into a gist or pastebin, and put the URL to it in your reply.  That makes your issue searchable on google, makes it easy to see if someone doesn't have a login here, and conforms to forum standards where attachments are discouraged due to security issues.  Not to be a jerk, but I'm getting tired of those things.
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: Jan Gruuthuse on February 25, 2012, 08:03:16 AM
Thanks for stepping in nibbles. Is this making a difference? Building as user with sudo or as SU?

tuharsky:
Quoteroot@bluetux:/usr/src/avidemux_2.5_branch_gruntster# ./bootStrap.sh
* Avidemux simple build script *
* Need sudo to install libs *
* Building Main *

Jan Gruuthuse:
Quotejan@DH67BL:~/avidemux_2.5_branch_gruntster$ sudo ./bootStrap.sh
* Avidemux simple build script *
* Need sudo to install libs *
* Building Main *
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on February 25, 2012, 11:11:05 AM
gcc is of version (Debian 4.4.5-8) 4.4.5
Output after modyfication of bootStrap.sh is here: https://gist.github.com/1907870
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: nibbles on February 27, 2012, 03:41:02 AM
@Jan that is just reminder message that gets echo to your screen, in case you are like most people and your system dirs are not writeable.

@tuharsky - The file that is failing to compile or work right, ADM_infoExtractor_h264.cpp, gets built into libADM_infoExtractor_cli.a.
It contains an undefined reference.  So let's go back up the config log and find that file, when it is compiled into that lib.
There we can see what is happening, if all the -I/include/stuff/is/there or not, or whatever.

Here's a gist of when ADM_infoExtractor_h264.cpp is compiled. (https://gist.github.com/1921156)

It says MALLOC.H and MANGLE are redefined.  That's probably not good.  Can anybody confirm?  Other chaos ensues.
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: Jan Gruuthuse on February 27, 2012, 08:34:38 AM
uploaded the same part for ADM_infoextractor_h264.cpp.o git://gist.github.com/1922572.git (https://gist.github.com/1922572)
after successful compilation Ubuntu 11.10 64-bit on Intel cpu: *  All Done  *
warning: "HAVE_MALLOC_H" redefined [enabled by default]
warning: "MANGLE" redefined [enabled by default]
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on February 27, 2012, 10:09:55 AM
@nibbles Please, give me a more verbose hint on what to do. I'm not a programmer.  ???
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: nibbles on February 28, 2012, 03:35:20 AM
I was wrong, those are just warning, as Jan pointed out.  Searching the net for ff_se_golomb_vlc_code, it turns out there's already a thread here that Jan was on (heh).  It's over here:  http://www.avidemux.org/smf/index.php?topic=10204.0

It looks like we'll have to add an object file to the executable.  Easy enough.  Let met check on it here....
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: nibbles on February 28, 2012, 08:29:38 AM
The avidemux2_cli is linking against this:

ADM_libraries/ffmpeg/libavcodec/libADM5avcodec.so.53

but to see how libavcodec is being built, we need to build ffmpeg verbosely.  Mean was able to get 2.6 to build verbosely, but I can't so far.  I'm working on it.  I want to see if libavcodec is being built against golomb.o.  It is on 2.6 on my machine.  But that's not helpful really.  Ok that's it for now.  (I tried to use  /usr/bin/make V=1 VERBOSE=1 for the make command to ffmpeg, but no joy).
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: Jan Gruuthuse on February 28, 2012, 10:34:05 AM
when doing an @ ~/avidemux_2.5_branch_gruntster$ sudo ./bootStrap_debug.sh the error is occurring to, as mean noticed in the other thread?
QuoteLD   ffmpeg_g
gcc: error: ffmpeg.o: No such file or directory
gcc: error: cmdutils.o: No such file or directory
make[3]: *** [ffmpeg_g] Error 1
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: nibbles on March 01, 2012, 07:11:29 AM
I was just going to try to reproduce his error.  I'll start that when svn starts working again.

As far as trying to get his software to link, the avidemux cmake code is ok.  It is likely a compiler or optimization issue like Mean suggested.  This is a widespread bug though, and we should figure it out why he can't compile this.

@Jan I'm sorry I didn't understand why you posted that, unless you think it's similar.  But that's ffmpeg.o not found, as versus golomb.o not being linked into libavcodec, which we can't see what's happening because no verbose output.  We should be able to ldd the thing though and find whether the golomb symbols are there.
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: gruntster on March 01, 2012, 07:45:00 AM
Quote[ 94%] Building CXX object avidemux/ADM_UIs/ADM_QT4/src/CMakeFiles/ADM_UIQT4.dir/FAC_frame.cpp.o
ADM_infoExtractor/libADM_infoExtractor_cli.a(ADM_infoextractor_h264.cpp.o): In function `get_se_golomb':
ADM_infoextractor_h264.cpp:(.text+0x347): undefined reference to `ff_se_golomb_vlc_code'
collect2: ld returned 1 exit status
make[2]: *** [avidemux/avidemux2_cli] Error 1
make[1]: *** [avidemux/CMakeFiles/avidemux2_cli.dir/all] Error 2

We patch ffmpeg during the CMake process to make private APIs available to Avidemux.  "ff_se_golomb_vlc_code" is not one we've needed to expose in the past but you could try adding "ff_se_golomb_vlc_code" to the "libavcodec.v" file (in avidemux/ADM_libraries/ffmpeg/libavcodec) so it is exported.  Not sure why other platforms don't need this though.
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: nibbles on March 03, 2012, 12:58:48 AM
I was able to confirm the OP original issue in 2.5.6.  Encode an xvid lame mkv, open the mkv, mark ab, save in copy copy as mkv, error.  Working on a decent analysis with output and debug trace.
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: nibbles on March 03, 2012, 07:53:44 AM
On OSX, looking up the symbols inside libavcodec, using

$ nm -gm /usr/local/lib/libADM5avcodec.53.dylib | grep ff_se_golomb
0000000000340a60 (__TEXT,__const) external _ff_se_golomb_vlc_code


I see it there on my system, consistent with Gruntster's experience.
I expect you will not find it if you do the same thing.

As Grunster mentioned, they patch libavcodec.v already using a patchfile.
We will give you a new patchfile for 2.5.6 with ff_se_golomb_vlc_code in it.

Replace this original:
cmake/patches/libavcodec_libavcodec.v.patch

with this new patchfile (https://raw.github.com/2bits/patches/master/libavcodec_libavcodec.v.patch) I crafted and stored on github.  Let us know how it works.
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on March 04, 2012, 10:19:11 AM
@nibbles My attempt ended with cmake error
https://gist.github.com/1971811
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: nibbles on March 05, 2012, 01:01:32 AM
Interesting.  I created the patch for 2.5.6.  You might tray that.
From your gist, it looks like it patched ok:

-- Checking for patch
-- ******************
-- Found patch

patching file libavcodec/avcodec.h
patching file libavcodec/ff_spsinfo.h
patching file libavcodec/mpeg12enc.c
patching file libavcodec/ffv1.c
patching file libavcodec/h264_parser.c
patching file libavcodec/h264.c
patching file libavcodec/mpegvideo.c
patching file libavcodec/libavcodec.v
patching file libavcodec/mpegvideo_enc.c
patching file libavformat/isom.c
patching file libavcodec/mpeg12.c
patching file libavcodec/h263dec.c
patching file libavcodec/vc1dec.c
patching file libavutil/avutil.h
patching file libavformat/matroskaenc.c
patching file common.mak


But then it complains about configure failing:

-- Configuring incomplete, errors occurred!
*** fail cmake ***


We'll have to investigate whether I did something weird to the patch that could affect configure.  Seems odd, but anyway.  Let's have you find your config.log for ffmpeg which should be left in the directories somewhere.  Start in the top level where bootStrap.sh is, and

find . -type f -name "config.log"
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on March 09, 2012, 07:17:20 AM
The log is here: /usr/src/avidemux_2.5_branch_gruntster/buildMain/avidemux/ADM_libraries/ffmpeg

posted at Gist:
https://gist.github.com/2002970
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: nibbles on March 10, 2012, 11:18:08 AM
I can't tell from that last gist.  It looks like normal output as it tries different flags.
Don't build as root though.  That's asking for problems you might wish to avoid risking.

What I would do, and it's complex sort of, but essentially this is the idea:
extract the source from tarball and hack admFFMpegBuild.cmake so that
you exit 1 just before it runs configure for ffmpeg.

Then manually run configure in the terminal, copying the configure command
from that gist you posted.  That way ffmpeg will be freshly extracted and
patched by cmake as usual.
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on March 30, 2012, 03:17:58 AM
I'm sorry, but this is beyond my skills.

Any idea, what is making Avidemux crash upon saving a part of MKV?
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on May 26, 2012, 04:33:01 AM
Hi,

has anybody else been successfull debuging the crash on copy-save mkv?
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: Jan Gruuthuse on May 26, 2012, 09:00:42 AM
No, that is far beyond my knowledge. You're still trying to compile 2.5.6? When you started in your terminal it shows you where logged in as root or as superuser and not as normal user. Normal terminal prompt should end like this:
Quotejan@DH67BL:~$
The prompt for your terminal showed:
Quoteroot@bluetux:/usr/src/avidemux_2.5_branch_gruntster#
That might have created problems with read-write rights issues.
Best you remove/delete /usr/src/avidemux_2.5_branch_gruntster might need to do that as root and try the complete process again.
Make sure you're in User Terminal and not Root terminal! if prompt not ending with $ you don't have a user terminal!

Change to your home directory:
cd ~

Get source code
svn co svn://svn.berlios.de/avidemux/branches/avidemux_2.5_branch_gruntster/

Go into to newly created directory
cd ~/avidemux_2.5.6

Start building:
sudo ./bootStrap.sh

If all goes well it should end with this:
Quote-- Installing: /usr/lib/ADM_plugins/audioEncoders/libADM_ae_faac.so
*  All Done  *


Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: tuharsky on July 09, 2012, 07:37:50 PM
I have successfully compiled SVN Avidemux 2.5.5 (r7908).

Now, the videos are saved without error message, however, the resulting files are incorrect - sound synchronisation seems corrupt, and the latter part of video cannot seek properly.

In contrast, the stable version complains during save with some files, however the resulting files seem fully correct.
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: Jan Gruuthuse on July 10, 2012, 02:24:22 PM
Try with 2.6? Most sound issues are gone there?
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: mean on July 11, 2012, 05:44:38 AM
Check ff_se_golomb_vlc_code is present in the text file
libavcodec.ver
Title: Re: Crash on copy-saving part of video encoded by Avidemux (mpeg4-asp(xvid)/mp3/mkv)
Post by: Jan Gruuthuse on July 11, 2012, 10:00:23 AM
for avidemux_2.5_branch_gruntster, says something else :
                ff_h264_info;
ff_golomb_vlc_len;
ff_ue_golomb_vlc_code;
        local:  *;
};