comskip segmentation fault with ffmpeg 4-4

Here you can ask your questions on how to use Comskip for the detection of commercials. Also questions on how to remove commercials are welcome
Post Reply
CraigD
Posts: 12
Joined: Sat Nov 25, 2017 6:04 pm

comskip segmentation fault with ffmpeg 4-4

Post by CraigD »

I am having a problem with comskip on Arch linux using ffmpeg 4.4-1. Comskip runs to completion if no comskip.ini is specified. With my very old comskip.ini it failed with a segmentation fault all or nearly all the time. I thought it might be the comments in the file were somehow not being recognized as comments so I removed all the comments. Things were better but still mostly seg faults. Next I compared my ini to the verbose output and deleted anything from my ini that was the same as the default. Now it runs to completion ~60-70% of the time if run manually but for some reason only about 25% when run from a script triggered by NextPVR. I am not at home at the moment so I can't load my ini or script files but I will do later.

Additional information, when I discovered the problem I went back to ffmpeg 4.3-6 with no other changes and comskip worked flawlessly as it had in the past. I'm not sure how necessary but I rebuilt comskip with ffmpeg 4-4-1 when trying to get it to work and rebuilt it with ffmpeg 4.3-6 when dropping back down. Unfortunately, recent update require ffmpeg 4.4-1 so I either need to keep a increasing list of libraries not to update or find a way to get comskip working with ffmpeg 4.4-1.

My next step is to eliminate the ini and start with an empty ini and add in one line at a time to see if I can find a specific option that is at fault.

Most distributions are using much older versions of ffmpeg, this seems to be a disadvantage of running a leading edge distro.

Thanks for any input on resolution,

Craig

CraigD
Posts: 12
Joined: Sat Nov 25, 2017 6:04 pm

my ini file that segfaults

Post by CraigD »

Code: Select all

detect_method=43
verbose=0
max_brightness=56
maxbright=1
test_brightness=36
max_avg_brightness=16
max_commercialbreak=240
min_commercialbreak=25
max_commercial_size=240
min_commercial_size=4
min_show_segment_length=240
max_volume=150
non_uniformity=100
disable_heuristics=48
cut_on_ac_change=1
thread_count=4
max_repair_size=200
volume_slip=20
always_keep_last_seconds=40
give_up_logo_search=5000
delay_logo_search=60
logo_max_percentage_of_screen=0.18
logo_threshold=0.6
logo_percentage_threshold=0.25
logo_filter=4
edge_step=2
connect_blocks_with_logo=0
shrink_logo=0
output_default=0
output_edl=1
output_framearray=0
output_debugwindow=0
output_tuning=0
output_data=0
edl_skip_field=3

CraigD
Posts: 12
Joined: Sat Nov 25, 2017 6:04 pm

Re: comskip segmentation fault with ffmpeg 4-4

Post by CraigD »

I was mistaken, comskip with no comskip.ini or with a comskip.ini that only contains "detect_method=43" still ends up with a segmentation fault. For testing I was running comskip on a variety of recorded *.ts files. With no or very minimal comskip.in it runs ok for several recordings then starts segmentation faulting. It doesn't fault on every recording and if run again it very well may process completely files that previously resulted in a fault. I am a user not a programmer so I have exhausted my ability to troubleshoot.

Regards,

Craig

CraigD
Posts: 12
Joined: Sat Nov 25, 2017 6:04 pm

Re: comskip segmentation fault with ffmpeg 4-4

Post by CraigD »

Update: I found a solution that works for me
Basically, I installed the older version ffmpeg-4.3.2 that worked with comskip prior to the recent upgrade. I installed it into a non-traditional directory, /$HOME/bin. With installation in /$HOME/bin the change only affects a single user and if you delete the /$HOME/bin directory ffmpeg-4.3.2 is gone, very simple removal. You can use your own destination directory, just adjust the commands as necessary.

I downloaded the ffmpeg-4.3.2 tar file into /$HOME/Downloads

You may need to install additional programs. If configure has an error about a program, install the program and retry until all the missing programs have been installed.

Code: Select all

cd /$HOME/Downloads
wget -O ffmpeg-4.3.2.tar.bz2 https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2 
tar xf ffmpeg-4.3.2.tar.bz2
cd ffmpeg-4.3.2  
PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/bin/lib/pkgconfig" ./configure   --prefix="$HOME/bin"   \
	--pkg-config-flags="--static"   --extra-cflags="-I$HOME/bin/include"   --extra-ldflags="-L$HOME/lib"   --extra-libs="-lpthread -lm"   \
	--ld="g++"   --bindir="$HOME/bin"   --enable-gpl   --enable-libaom   --enable-libass   --enable-libfreetype   --enable-libmp3lame   \
	--enable-libopus --enable-libvorbis --enable-libvpx --enable-nonfree && PATH="$HOME/bin:$PATH" make -j4  \
	&& make install && hash -r && source ~/.profile

Next up build comskip, this is the same for me as it has always been.

Code: Select all

git clone  git://github.com/erikkaashoek/Comskip /$HOME/Comskip
cd  /$HOME/Comskip
./autogen.sh
./configure 
make
sudo make install
I still have ffmpeg-4.4 installed but using the code below makes the new installation of ffmpeg-4.3.2 the default. These commands are part of the code above but listed here as a point of explanation.

Code: Select all

hash -r
source ~/.profile


I wrote this up in case it helps someone else who has problems in the future when their distribution upgrades to ffmpeg-4.4. I'm assuming it may be some time before Ubuntu and Debian, but you never know. Maybe the next update to ffmpeg will fix the current situation but for now I have a fix.

Craig
Last edited by CraigD on Tue May 25, 2021 2:00 am, edited 7 times in total.

CraigD
Posts: 12
Joined: Sat Nov 25, 2017 6:04 pm

Re: comskip segmentation fault with ffmpeg 4-4

Post by CraigD »

The other solution I came up with that also worked was to install wine and use the windows version comskip.exe.

Code: Select all

https://www.winehq.org
Download and unzip the file

Code: Select all

http://www.kaashoek.com/files/comskip82_010.zip
wine <path to comskip.exe> <path/filename of file to be processed>

I still prefer using the native linux comskip. Hopefully, it continues to work for me.

Craig

Post Reply