Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comskip infinite loops on some h264s #31

Closed
essandess opened this issue Oct 16, 2015 · 13 comments
Closed

Comskip infinite loops on some h264s #31

essandess opened this issue Oct 16, 2015 · 13 comments

Comments

@essandess
Copy link
Contributor

Comskip goes into an infinite loop on some h264s. This happens often enough that I've incorporated a gtimeout into my MarkCommercials script to kill off runaway comskip processes. This happens with both DOS (run under wine) and natively compiled donator versions.

I can provide a download of the .mpg if you'd like.

The logs look like this:

Retry=0 at frame=59261, time= 120.12 seconds
Retry target pos=3966728184, pts=183369186
[h264 @ 0x7fbd1b028600] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fbd1b028600] non-existing PPS 0 referenced
[h264 @ 0x7fbd1b028600] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fbd1b028600] non-existing PPS 0 referenced
[h264 @ 0x7fbd1b028600] decode_slice_header error
[h264 @ 0x7fbd1b028600] no frame!
[h264 @ 0x7fbd1b028600] non-existing PPS 0 referenced
[h264 @ 0x7fbd1b028600] non-existing PPS 0 referenced
[h264 @ 0x7fbd1b028600] decode_slice_header error
[h264 @ 0x7fbd1b028600] no frame!
Retry t_pos=3966728184, l_pos=3765581908, t_pts=183369186, l_pts=174177723
Strange audio pts step of 18.02650 instead of 0.00000 at frame 59261
Positioning file failing with pts= 18.08

@tmm1
Copy link
Collaborator

tmm1 commented Oct 16, 2015

h264

Are you sure it's a mpeg2 file? It's using the x264 decoder.

Can you paste what ffmpeg -i filename says about the file?

@essandess
Copy link
Contributor Author

Sorry s/mpeg2/h264/g:

$ ffmpeg -i /Volumes/Macintosh\ HD2/Documents/EyeTV\ Archive/The\ Nightly\ Show\ With\ Larry\ Wilmore[2].eyetv/000000001bcfe1d8.mpg
ffmpeg version 2.8 Copyright (c) 2000-2015 the FFmpeg developers
built with Apple LLVM version 7.0.0 (clang-700.0.72)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-libtheora --enable-libschroedinger --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-indev=jack --disable-outdev=xv --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --enable-vda --enable-videotoolbox --arch=x86_64 --enable-yasm --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[h264 @ 0x7fc56b82bc00] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fc56b82bc00] non-existing PPS 0 referenced
[h264 @ 0x7fc56b82bc00] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fc56b82bc00] non-existing PPS 0 referenced
[h264 @ 0x7fc56b82bc00] decode_slice_header error
[h264 @ 0x7fc56b82bc00] no frame!
[h264 @ 0x7fc56b82bc00] non-existing PPS 0 referenced
Last message repeated 1 times
[h264 @ 0x7fc56b82bc00] decode_slice_header error
[h264 @ 0x7fc56b82bc00] no frame!
Input #0, mpegts, from '/Volumes/Macintosh HD2/Documents/EyeTV Archive/The Nightly Show With Larry Wilmore[2].eyetv/000000001bcfe1d8.mpg':
Duration: 00:02:00.22, start: 1917.282033, bitrate: 263967 kb/s
Program 1
Stream #0:0[0x23]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x22]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 161 kb/s
At least one output file must be specified

@essandess essandess changed the title Comskip infinite loops on some mpeg2s Comskip infinite loops on some h264s Oct 16, 2015
@erikkaashoek
Copy link
Owner

Set retries=0
and do not process while recording but only after the recording is finished.
The error is caused by a reposition that fails on your specific recording.
You can use comskip --selftest=1 recording.file to verify positioning

@essandess
Copy link
Contributor Author

Thanks Erik. Adding retries=0 does not change the looping. Here's a link to the comskip.ini file I'm using, with "retries=0" now added just before the "live_tv=0" directive.

The the etv-comskip scripts are setup to invoke comskip AFTER recording AND transcoding AND iTunes Exporting are finished. After all that, MarkCommercials runs comskip, sticks the .edl file in the right place, and mp4tags imbeds the comskip information into iTunes recordings.

With "retries=0" the comskip log looks the same:

Retry=0 at frame=59261, time= 120.12 seconds
Retry target pos=3966728184, pts=183369186
[h264 @ 0x7fb4dd025800] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fb4dd025800] non-existing PPS 0 referenced
[h264 @ 0x7fb4dd025800] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fb4dd025800] non-existing PPS 0 referenced
[h264 @ 0x7fb4dd025800] decode_slice_header error
[h264 @ 0x7fb4dd025800] no frame!
[h264 @ 0x7fb4dd025800] non-existing PPS 0 referenced
[h264 @ 0x7fb4dd025800] non-existing PPS 0 referenced
[h264 @ 0x7fb4dd025800] decode_slice_header error
[h264 @ 0x7fb4dd025800] no frame!
Retry t_pos=3966728184, l_pos=3765581908, t_pts=183369186, l_pts=174177723
Strange audio pts step of 18.02650 instead of 0.00000 at frame 59261
Positioning file failing with pts= 18.08

Retry=0 at frame=59261, time= 120.12 seconds
Retry target pos=3966728184, pts=183369186
[h264 @ 0x7fb4dc809600] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fb4dc809600] non-existing PPS 0 referenced
[h264 @ 0x7fb4dc809600] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fb4dc809600] non-existing PPS 0 referenced
[h264 @ 0x7fb4dc809600] decode_slice_header error
[h264 @ 0x7fb4dc809600] no frame!
[h264 @ 0x7fb4dc809600] non-existing PPS 0 referenced
[h264 @ 0x7fb4dc809600] non-existing PPS 0 referenced
[h264 @ 0x7fb4dc809600] decode_slice_header error
[h264 @ 0x7fb4dc809600] no frame!
Retry t_pos=3966728184, l_pos=3765581908, t_pts=183369186, l_pts=174177723
Strange audio pts step of 18.02650 instead of 0.00000 at frame 59261
Positioning file failing with pts= 18.08

@erikkaashoek
Copy link
Owner

My error
live_tv_retries=0

This is the clue the seeking is failing : "Positioning file failing with
pts= 18.08"

Erik.

2015-10-16 12:23 GMT+02:00 Steve Smith notifications@github.com:

Thanks Erik. Adding retries=0 does not change the looping. Here's a link
to the comskip.ini
https://github.com/essandess/etv-comskip/blob/master/src/comskip_ini/comskip.ini
file I'm using, with "retries=0" now added just before the "live_tv=0"
directive.

The the etv-comskip https://github.com/essandess/etv-comskip scripts
are setup to invoke comskip AFTER recording AND transcoding AND iTunes
Exporting are finished. After all that, MarkCommercials runs comskip,
sticks the .edl file in the right place, and mp4tags imbeds the comskip
information into iTunes recordings.

With "retries=0" the comskip log looks the same:

Retry=0 at frame=59261, time= 120.12 seconds
Retry target pos=3966728184, pts=183369186
[h264 @ 0x7fb4dd025800] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fb4dd025800] non-existing PPS 0 referenced
[h264 @ 0x7fb4dd025800] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fb4dd025800] non-existing PPS 0 referenced
[h264 @ 0x7fb4dd025800] decode_slice_header error
[h264 @ 0x7fb4dd025800] no frame!
[h264 @ 0x7fb4dd025800] non-existing PPS 0 referenced
[h264 @ 0x7fb4dd025800] non-existing PPS 0 referenced
[h264 @ 0x7fb4dd025800] decode_slice_header error
[h264 @ 0x7fb4dd025800] no frame!
Retry t_pos=3966728184, l_pos=3765581908, t_pts=183369186, l_pts=174177723
Strange audio pts step of 18.02650 instead of 0.00000 at frame 59261
Positioning file failing with pts= 18.08

Retry=0 at frame=59261, time= 120.12 seconds
Retry target pos=3966728184, pts=183369186
[h264 @ 0x7fb4dc809600] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fb4dc809600] non-existing PPS 0 referenced
[h264 @ 0x7fb4dc809600] non-existing SPS 0 referenced in buffering period
[h264 @ 0x7fb4dc809600] non-existing PPS 0 referenced
[h264 @ 0x7fb4dc809600] decode_slice_header error
[h264 @ 0x7fb4dc809600] no frame!
[h264 @ 0x7fb4dc809600] non-existing PPS 0 referenced
[h264 @ 0x7fb4dc809600] non-existing PPS 0 referenced
[h264 @ 0x7fb4dc809600] decode_slice_header error
[h264 @ 0x7fb4dc809600] no frame!
Retry t_pos=3966728184, l_pos=3765581908, t_pts=183369186, l_pts=174177723
Strange audio pts step of 18.02650 instead of 0.00000 at frame 59261
Positioning file failing with pts= 18.08


Reply to this email directly or view it on GitHub
#31 (comment)
.

@essandess
Copy link
Contributor Author

That works—thanks again Erik.

I'll leave the ticket open to ask if it's a "feature" for Comskip to use the live_tv_retries directive when live_tv=0.

@erikkaashoek
Copy link
Owner

live_tv controls the output of detected commercials during processing, it increases CPU load but you can skip commercials before the recording is finished.
I never use this
live_tv_retries controlls the ability to process while recording.
I always use this.
So these are separately needed.

@essandess
Copy link
Contributor Author

Got it. Thanks again. I forgot it was possible to watch live tv! 😃

We used to have etv-comskip configured for live tv options back in the non-HD dark ages. Then I ported to use comskip for HD, and turned off all the live options both because comskip with ffmpeg stopped supporting that capability, and the cpu load for live HD plus recording plus comskip is really high (and because personally I'm lucky to be a only couple weeks behind viewing stuff).

Is live tv comskip a thing again? If so, and we switched back to live tv support, is the behavior above an issue?

@erikkaashoek
Copy link
Owner

Could you "send" me one of the recordings that loop? This will enable me to improve the seeking in Comskip

@erikkaashoek
Copy link
Owner

Many people do use live tv processing with the latest build
On certain ill behaving streams comskip will hang while doing live tv processing.
So if you don't want to run any risk don't use live tv processing

@essandess
Copy link
Contributor Author

Thanks. I sent you an out-of-band message.

@erikkaashoek
Copy link
Owner

Thanks for the recording, it contains many bitstream errors so its an excellent opportunity to improve robustness. I already solved one problem, at least one more to go.

@essandess
Copy link
Contributor Author

Thank you very much Erik. I confirm that this commit fixes the issue for me. I also see that it addresses the asynchronous timestamp issue as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants