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

Crashes after a few seconds #1231

Closed
1 of 13 tasks
roger- opened this issue Nov 8, 2022 · 2 comments
Closed
1 of 13 tasks

Crashes after a few seconds #1231

roger- opened this issue Nov 8, 2022 · 2 comments

Comments

@roger-
Copy link

roger- commented Nov 8, 2022

Which version are you using?

v0.20.2

Which operating system are you using?

Raspberry Pi OS
Linux raspberrypi4 5.15.61-v8+

  • Linux amd64 standard
  • Linux amd64 Docker
  • Linux arm64 standard
  • Linux arm64 Docker
  • Linux arm7 standard
  • Linux arm7 Docker
  • Linux arm6 standard
  • Linux arm6 Docker
  • Windows amd64 standard
  • Windows amd64 Docker (WSL backend)
  • macOS amd64 standard
  • macOS amd64 Docker
  • Other (please describe)

Describe the issue

I'm converting an mjpeg stream to h264 (h264_v4l2m2m encoder) as a Raspberry Pi 4 using ffmpeg (ffmpeg version 4.3.4-0+deb11u1+rpt3) and publishing to rtsp-simple-server using the command:

INPUT_OPTS=" -loglevel debug -reconnect_delay_max 10 -hide_banner -avoid_negative_ts make_zero -fflags nobuffer -flags low_delay -strict experimental -fflags +genpts+discardcorrupt -use_wallclock_as_timestamps 1 -f mjpeg -re"
OUTPUT_OPTS="-an -c:v h264_v4l2m2m -g 20 -pix_fmt yuv420p -vsync 2 -b:v 900K -maxrate 1M  -f rtsp -rtsp_transport tcp -force_key_frames 'expr:gte(t,n_forced*2)' -r 10"

ffmpeg $INPUT_OPTS -i $URL $OUTPUT_OPTS  $RTSP_SERVER"

It seems to run for a few seconds but then rtsp-simple-server crashes with the log below.

Describe how to replicate the issue

Run command above

Did you attach the server logs?

yes

panic: runtime error: index out of range [0] with length 0

goroutine 89 [running]:
github.com/aler9/rtsp-simple-server/internal/hls.(*muxerVariantMPEGTSSegmenter).writeH264(0x400046f698?, {0x99510?, 0xc79c39bbfb7?, 0xcb8260?}, 0x116a9bed0068dc80?, {0x40004e2d70?, 0x400046f6a8?, 0x5bd15c?})
        /s/internal/hls/muxer_variant_mpegts_segmenter.go:64 +0x47c
github.com/aler9/rtsp-simple-server/internal/hls.(*muxerVariantMPEGTS).writeH264(0x4000122b00?, {0x0?, 0x0?, 0xcb8260?}, 0x0?, {0x40004e2d70?, 0x0?, 0x0?})
        /s/internal/hls/muxer_variant_mpegts.go:43 +0x2c
github.com/aler9/rtsp-simple-server/internal/hls.(*Muxer).WriteH264(...)
        /s/internal/hls/muxer.go:81
github.com/aler9/rtsp-simple-server/internal/core.(*hlsMuxer).runWriter(0x40003f9680, 0x4000248780, 0x0, 0x0, 0xffffffffffffffff)
        /s/internal/core/hls_muxer.go:419 +0x180
github.com/aler9/rtsp-simple-server/internal/core.(*hlsMuxer).runInner.func2()
        /s/internal/core/hls_muxer.go:356 +0x3c
created by github.com/aler9/rtsp-simple-server/internal/core.(*hlsMuxer).runInner
        /s/internal/core/hls_muxer.go:355 +0x5dc

Did you attach a network dump?

no

EDIT: this issue actually only happens with the stock ffmpeg 4.3.4, using a new build of ffmpeg 5 from here (e.g. ffmpeg version N-60837-ge81242bb13-static), things seems to be fine.

@aler9
Copy link
Member

aler9 commented Dec 9, 2022

duplicate of #1155

@aler9 aler9 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2022
@github-actions
Copy link
Contributor

This issue is being locked automatically because it has been closed for more than 6 months.
Please open a new issue in case you encounter a similar problem.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants