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

[BUG] Song ending immediately using the -u <custom_url> option #392

Closed
kylehild opened this issue Sep 4, 2024 · 22 comments
Closed

[BUG] Song ending immediately using the -u <custom_url> option #392

kylehild opened this issue Sep 4, 2024 · 22 comments

Comments

@kylehild
Copy link

kylehild commented Sep 4, 2024

Describe the bug
I have had pikaraoke working for a while, but decided to try to update to the new pip install version. In order to do that, I needed to install Raspberry Pi OS with the desktop in order to have the splash screen open, whereas before I was using a desktopless version of Raspberry Pi OS. In order to keep all of my songs, I copied them onto my NAS.

Now, I installed Raspberry Pi OS Bullseye, installed python 3.12.5, pip installed pikaraoke, pointed it at my NAS with my already downloaded songs, and connected to it using my phone.

All of this seems to be working correctly, but whenever I try to play a song, it loads it as Up Next, begins to "play" the song (never actually leaving the slash screen), and then the song stops. I thought it may have something to do with hosting my songs on my NAS, but I pointed pikaraoke to it's default location, downloaded a new song, and the same behavior is happening.

I thought this may be similar to #317 or #332 but it doesn't seem cdg related (all of the files are mp4) and I am not seeing the media play at all.

I know you and @mariugul are in the middle of a refactor of the code base, but I don't see why this could contribute to my issue. I think it has something to do with my ffmpeg version, settings, or something else related, but I don't know enough about that.

Expected behavior
Songs should play on the screen.

Platform (please complete the following information):

  • Hardware: Raspberry Pi 3B
  • OS: Raspberry Pi OS
  • OS version: Raspberry pi Debian Bullseye 32-bit Desktop
  • Browser: any
  • Version: 1.4.1
  • Ffmpeg Version:
ffmpeg version 4.3.7-0+deb11u1+rpt2 Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 10 (Raspbian 10.2.1-6+rpi1)
configuration: --prefix=/usr --extra-version=0+deb11u1+rpt2 --toolchain=hardened --incdir=/usr/include/arm-linux-gnueabihf --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-mmal --enable-neon --enable-rpi --enable-v4l2-request --enable-libudev --enable-epoxy --enable-pocketsphinx --enable-libdc1394 --enable-libdrm --enable-vout-drm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared --libdir=/usr/lib/arm-linux-gnueabihf --cpu=arm1176jzf-s --arch=arm
libavutil      56. 51.100 / 56. 51.100
libavcodec     58. 91.100 / 58. 91.100
libavformat    58. 45.100 / 58. 45.100
libavdevice    58. 10.100 / 58. 10.100
libavfilter     7. 85.100 /  7. 85.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  7.100 /  5.  7.100
libswresample   3.  7.100 /  3.  7.100
libpostproc    55.  7.100 / 55.  7.100
@vicwomg
Copy link
Owner

vicwomg commented Sep 4, 2024 via email

@vicwomg
Copy link
Owner

vicwomg commented Sep 4, 2024 via email

@mariugul
Copy link
Collaborator

mariugul commented Sep 4, 2024

Describe the bug I have had pikaraoke working for a while, but decided to try to update to the new pip install version. In order to do that, I needed to install Raspberry Pi OS with the desktop in order to have the splash screen open, whereas before I was using a desktopless version of Raspberry Pi OS. In order to keep all of my songs, I copied them onto my NAS.

I would try a newer ffmpeg version first. Someething like >6.0.0.

@kylehild
Copy link
Author

kylehild commented Sep 4, 2024

How did you install ffmpeg?

I didn't install it separately. I think it is the version installed by default by the Raspberry Pi Image.

Also bullseye is likely too old. See the readme for the OS recommendation.

Haha, I picked bullseye specifically because the README recommended it.

For Pi 3: 32-bit Bullseye OS and overclocking is recommended for smoother playback.

I tried overclocking the pi but I don't think that helped. I can try pushing it up a bit more though to see if that helps. If that doesn't help, I'll try Bookworm and see if that has any differences.

I would try a newer ffmpeg version first. Someething like >6.0.0.

I could try this too, but it looks like most of the ways people are recommending to upgrade is by compiling it myself. SDo you know of a better way to upgrade ffmpeg to >6.0.0 natively?

@vicwomg
Copy link
Owner

vicwomg commented Sep 4, 2024

@kylehild you're right, sorry ;) bullseye is in the README. That may no longer be accurate, and bookworm might be the preferred version. I'll need to test that.

I think 4.3.7 is correct. ffmpeg 6.0 is not available for pi if I recall correctly. My pi3 has 4.3.6 on it. However, I am seeing the same issue, mp4 files are skipping. Not the case on my bookworm pi 4. There appears to have been some kind of regression.

@vicwomg vicwomg changed the title [BUG] Song ending immediately after playing [BUG] Song ending immediately after playing on RPi 3 devices Sep 4, 2024
@vicwomg
Copy link
Owner

vicwomg commented Sep 4, 2024

In pi3 + bookworm 64-bit + ffmpeg 5.1.5-0+rpt1+deb12u1, I was able to play a mp4s. They are a little choppy, but probably fine for karaoke. So I may change the bullseye recommendation to bookworm.

However, if I enabled the normalization feature "-n", they start to skip. This all seems to point to reaching the performance max of the pi3 which is exhausting the video buffer and causing an early skip. Unfortunately, the combination of ffmpeg transcoding and chromium mp4 playback rendering is a bit much for this older hardware. Not sure what can be done about this in the short term.

@vicwomg
Copy link
Owner

vicwomg commented Sep 4, 2024

I have removed the Bullseye recommendation from the README, as I could not get it to work.

With Bookworm 64-bit on my pi3 seems fine. Video playback is a bit low-framerate, but audio works and it seems good enough. CDG and transposition still seems to work well.

@kylehild LMK if you continue to see problems with bookworm 64

@vicwomg vicwomg changed the title [BUG] Song ending immediately after playing on RPi 3 devices [BUG] Song ending immediately after playing on RPi 3 / Bullseye devices Sep 5, 2024
@kylehild
Copy link
Author

kylehild commented Sep 6, 2024

I am still seeing the exact same issue as before. The song says that it starts playing in the top right of thsplash screen and the logs, but it immediately stops without playing at all. I didn't have problems like this before the requirement was added to use the desktop version of Raspberry Pi OS. Is there a good time for me to roll back to in order to continue using this project on my RPi 3B?

I understand the RPi 3 is becoming older and older, but I still think supporting it should be a high priority for a project named pikaraoke. LMK if there is anything I can do to help troubleshoot this more or contribute in a way that allows continued support for RPi 3s.

@kylehild
Copy link
Author

kylehild commented Sep 6, 2024

To be clear, I reinstalled Raspberry Pi OS using the 64bit Bookworm version and my current ffmpeg version is 5.1.6-0+deb12u1+rpt1. LEt me know if any other information would be helpful but all I did was install the OS using the RPi imager and follow the instructions in the README.

@vicwomg
Copy link
Owner

vicwomg commented Sep 6, 2024

To answer your question: the version you are accustomed to is here:
https://github.com/vicwomg/pikaraoke/releases/tag/1.1.2
You're welcome to roll back and see if it still works. The prebuilt image is still hosted there.

Nobody said anything about ending support for the Pi 3.

@kylehild
Copy link
Author

kylehild commented Sep 6, 2024

Nobody said anything about ending support for the Pi 3.

Yeah, understood. Sorry, I didn't mean to imply that you did!

One thing to note, I have tried installing and running pikaraoke on a debian VM on proxmox and I am having the exact same behavior as my pi, so it is either something I am doing wrong, or a larger problem. I'm hoping it is just me, but I can't see anything weird. Luckily, with the new pip install method it is very easy for me to test. :) This is happening for newly downloaded songs, as well as any songs that I moved to my NAS before I started the reinstall process.

@kylehild
Copy link
Author

kylehild commented Sep 6, 2024

Okay, I actually have some new information. It looks like this issue is only happening when I send in the -u flag in order for the splash screen to show my FQDN instead of the IP:PORT for the machine.

This behavior happens if I pass that flag no matter what, if I access the site through the IP:PORT or through the FQDN. Are you seeing the same behavior if you use that flag?

@mariugul
Copy link
Collaborator

mariugul commented Sep 6, 2024

Okay, I actually have some new information. It looks like this issue is only happening when I send in the -u flag in order for the splash screen to show my FQDN instead of the IP:PORT for the machine.

This behavior happens if I pass that flag no matter what, if I access the site through the IP:PORT or through the FQDN. Are you seeing the same behavior if you use that flag?

What does the log output in the terminal for you: Overriding URL with " + self.url_override? What's the input you send into -u?

@kylehild
Copy link
Author

kylehild commented Sep 6, 2024

This is my output:

$ pikaraoke --headless -u https://karaoke.local.{redacted}.com
[2024-09-06 14:30:37] INFO: Fetching available songs in: /home/kylehild/pikaraoke-songs/
[2024-09-06 14:30:37] INFO: Upgrading youtube-dl, current version: 2024.08.06
[2024-09-06 14:30:38] INFO: Latest version: [email protected] from yt-dlp/yt-dlp
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp)
[2024-09-06 14:30:39] INFO: Done. New version: 2024.08.06
[06/Sep/2024:14:30:39] ENGINE Bus STARTING
[2024-09-06 14:30:39] INFO: [06/Sep/2024:14:30:39] ENGINE Bus STARTING
[06/Sep/2024:14:30:39] ENGINE Serving on http://0.0.0.0:5555
[2024-09-06 14:30:39] INFO: [06/Sep/2024:14:30:39] ENGINE Serving on http://0.0.0.0:5555
[06/Sep/2024:14:30:39] ENGINE Bus STARTED
[2024-09-06 14:30:39] INFO: [06/Sep/2024:14:30:39] ENGINE Bus STARTED
[2024-09-06 14:30:39] INFO: Starting PiKaraoke!
[2024-09-06 14:30:39] INFO: Connect the player host to: https://karaoke.local.{redacted}.com/splash

I'm not seeing the specific overriding line.

@kylehild
Copy link
Author

kylehild commented Sep 6, 2024

Oh sorry, just noticed that is a DEBUG log in the code. Here is the output:

$ pikaraoke --headless -u https://karaoke.local.{redacted}.com -l 10
[2024-09-06 14:37:05] DEBUG: 
    http port: 5555
    ffmpeg port 5556
    hide URL: False
    prefer hostname: False
    url override: https://karaoke.local.{redacted}.com
    hide RaspiWiFi instructions: False
    headless (hide splash): True
    splash_delay: 3
    screensaver_timeout: 300
    high quality video: False
    download path: /home/kylehild/pikaraoke-songs/
    default volume: 0.85
    normalize audio: False
    youtube-dl path: yt-dlp
    logo path: /opt/pikaraoke/.venv/lib/python3.11/site-packages/pikaraoke/logo.png
    log_level: 10
    hide overlay: False

    platform: linux
    os version: #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15)
    ffmpeg version: 5.1.6-0+deb12u1
    hardware h264 encoding: False
    youtubedl-version: 2024.08.06

[2024-09-06 14:37:05] DEBUG: IP address (for QR code and splash screen): 192.168.0.206
[2024-09-06 14:37:05] DEBUG: Overriding URL with https://karaoke.local.{redacted}.com
[2024-09-06 14:37:05] INFO: Fetching available songs in: /home/kylehild/pikaraoke-songs/

@mariugul
Copy link
Collaborator

mariugul commented Sep 6, 2024

Oh sorry, just noticed that is a DEBUG log in the code. Here is the output:

$ pikaraoke --headless -u https://karaoke.local.{redacted}.com -l 10
[2024-09-06 14:37:05] DEBUG: 
    http port: 5555
    ffmpeg port 5556
    hide URL: False
    prefer hostname: False
    url override: https://karaoke.local.{redacted}.com
    hide RaspiWiFi instructions: False
    headless (hide splash): True
    splash_delay: 3
    screensaver_timeout: 300
    high quality video: False
    download path: /home/kylehild/pikaraoke-songs/
    default volume: 0.85
    normalize audio: False
    youtube-dl path: yt-dlp
    logo path: /opt/pikaraoke/.venv/lib/python3.11/site-packages/pikaraoke/logo.png
    log_level: 10
    hide overlay: False

    platform: linux
    os version: #1 SMP PREEMPT_DYNAMIC Debian 6.1.99-1 (2024-07-15)
    ffmpeg version: 5.1.6-0+deb12u1
    hardware h264 encoding: False
    youtubedl-version: 2024.08.06

[2024-09-06 14:37:05] DEBUG: IP address (for QR code and splash screen): 192.168.0.206
[2024-09-06 14:37:05] DEBUG: Overriding URL with https://karaoke.local.{redacted}.com
[2024-09-06 14:37:05] INFO: Fetching available songs in: /home/kylehild/pikaraoke-songs/

Why is it you input https://karaoke.local.{redacted}.com? I am referring to the {redacted} part. I'm not so sure this works, though I'm no expert in web urls.

Edit: I see, you just hid it from the comment, lol 😄 To me it looked like python brackets

@vicwomg
Copy link
Owner

vicwomg commented Sep 6, 2024

I cannot test the -u option because I don't have a FQDN configured.

Would be great to see the logs (with debug) when you actually try to play the file.

In order for streaming to work, the ffmpeg URL would end up being: https://karaoke.local.{redacted}.com:5556. The URL and the port 5556 must be accessible to the splash screen client.

Other suggestion, have you tried the --prefer-hostname option instead of -u? That will default to whatever hostname is available, such as pikaraoke.local. -u seems reserved for more advanced networking (someone requested this feature for some kind of remote deployment, and I assume they knew what they were doing wrt the routing... I certainly have no idea).

@mariugul
Copy link
Collaborator

mariugul commented Sep 6, 2024

I cannot test the -u option because I don't have a FQDN configured.

Would be great to see the logs (with debug) when you actually try to play the file.

In order for streaming to work, the ffmpeg URL would end up being: https://karaoke.local.{redacted}.com:5556. The URL and the port 5556 must be accessible to the splash screen client.

Other suggestion, have you tried the --prefer-hostname option instead of -u? That will default to whatever hostname is available, such as pikaraoke.local. -u seems reserved for more advanced networking (someone requested this feature for some kind of remote deployment, and I assume they knew what they were doing wrt the routing... I certainly have no idea).

In what cases is the port number not necessary?

@kylehild
Copy link
Author

kylehild commented Sep 6, 2024

Here is the debug output when the song is played:

[2024-09-06 15:16:14] INFO: 'kylehild' is adding song to queue: /home/kylehild/pikaraoke-songs/Chappell Roan - HOT TO GO! (Karaoke Version)---tRAVVvXUKDA.mp4
[2024-09-06 15:16:17] INFO: Playing file: /home/kylehild/pikaraoke-songs/Chappell Roan - HOT TO GO! (Karaoke Version)---tRAVVvXUKDA.mp4 transposed 0 semitones
[2024-09-06 15:16:17] DEBUG: COMMAND: ffmpeg -i /home/kylehild/pikaraoke-songs/Chappell Roan - HOT TO GO! (Karaoke Version)---tRAVVvXUKDA.mp4 -map 0:a -map 0:v -f mp4 -b:v 5M -acodec copy -listen 1 -movflags frag_keyframe+default_base_moof -preset ultrafast -vcodec copy http://0.0.0.0:5556/1725650177
[2024-09-06 15:16:17] DEBUG: Killing ffmpeg process
[2024-09-06 15:16:18] DEBUG: [FFMPEG] ffmpeg version 5.1.6-0+deb12u1 Copyright (c) 2000-2024 the FFmpeg developers
[2024-09-06 15:16:18] DEBUG: [FFMPEG] built with gcc 12 (Debian 12.2.0-14)
[2024-09-06 15:16:18] DEBUG: [FFMPEG] configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libavutil      57. 28.100 / 57. 28.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libavcodec     59. 37.100 / 59. 37.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libavformat    59. 27.100 / 59. 27.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libavdevice    59.  7.100 / 59.  7.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libavfilter     8. 44.100 /  8. 44.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libswscale      6.  7.100 /  6.  7.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libswresample   4.  7.100 /  4.  7.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libpostproc    56.  6.100 / 56.  6.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/kylehild/pikaraoke-songs/Chappell Roan - HOT TO GO! (Karaoke Version)---tRAVVvXUKDA.mp4':
[2024-09-06 15:16:18] DEBUG: [FFMPEG] Metadata:
[2024-09-06 15:16:18] DEBUG: [FFMPEG] major_brand     : mp42
[2024-09-06 15:16:18] DEBUG: [FFMPEG] minor_version   : 0
[2024-09-06 15:16:18] DEBUG: [FFMPEG] compatible_brands: isommp42
[2024-09-06 15:16:18] DEBUG: [FFMPEG] encoder         : Google
[2024-09-06 15:16:18] DEBUG: [FFMPEG] Duration: 00:03:21.06, start: 0.000000, bitrate: 195 kb/s
[2024-09-06 15:16:18] DEBUG: [FFMPEG] Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 96 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
[2024-09-06 15:16:18] DEBUG: Stream ready!
[2024-09-06 15:16:18] INFO: Song ending: Chappell Roan - HOT TO GO! (Karaoke Version)
[2024-09-06 15:16:18] DEBUG: Killing ffmpeg process
[2024-09-06 15:16:18] DEBUG: ffmpeg process killed
[2024-09-06 15:16:19] INFO: Song starting: None
[2024-09-06 15:16:19] DEBUG: Stream is playing
[2024-09-06 15:16:28] INFO: Song ending: None
[2024-09-06 15:16:28] DEBUG: Killing ffmpeg process
[2024-09-06 15:16:28] DEBUG: ffmpeg process killed

@mariugul
Copy link
Collaborator

mariugul commented Sep 6, 2024

Here is the debug output when the song is played:

[2024-09-06 15:16:14] INFO: 'kylehild' is adding song to queue: /home/kylehild/pikaraoke-songs/Chappell Roan - HOT TO GO! (Karaoke Version)---tRAVVvXUKDA.mp4
[2024-09-06 15:16:17] INFO: Playing file: /home/kylehild/pikaraoke-songs/Chappell Roan - HOT TO GO! (Karaoke Version)---tRAVVvXUKDA.mp4 transposed 0 semitones
[2024-09-06 15:16:17] DEBUG: COMMAND: ffmpeg -i /home/kylehild/pikaraoke-songs/Chappell Roan - HOT TO GO! (Karaoke Version)---tRAVVvXUKDA.mp4 -map 0:a -map 0:v -f mp4 -b:v 5M -acodec copy -listen 1 -movflags frag_keyframe+default_base_moof -preset ultrafast -vcodec copy http://0.0.0.0:5556/1725650177
[2024-09-06 15:16:17] DEBUG: Killing ffmpeg process
[2024-09-06 15:16:18] DEBUG: [FFMPEG] ffmpeg version 5.1.6-0+deb12u1 Copyright (c) 2000-2024 the FFmpeg developers
[2024-09-06 15:16:18] DEBUG: [FFMPEG] built with gcc 12 (Debian 12.2.0-14)
[2024-09-06 15:16:18] DEBUG: [FFMPEG] configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libavutil      57. 28.100 / 57. 28.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libavcodec     59. 37.100 / 59. 37.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libavformat    59. 27.100 / 59. 27.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libavdevice    59.  7.100 / 59.  7.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libavfilter     8. 44.100 /  8. 44.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libswscale      6.  7.100 /  6.  7.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libswresample   4.  7.100 /  4.  7.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] libpostproc    56.  6.100 / 56.  6.100
[2024-09-06 15:16:18] DEBUG: [FFMPEG] Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/kylehild/pikaraoke-songs/Chappell Roan - HOT TO GO! (Karaoke Version)---tRAVVvXUKDA.mp4':
[2024-09-06 15:16:18] DEBUG: [FFMPEG] Metadata:
[2024-09-06 15:16:18] DEBUG: [FFMPEG] major_brand     : mp42
[2024-09-06 15:16:18] DEBUG: [FFMPEG] minor_version   : 0
[2024-09-06 15:16:18] DEBUG: [FFMPEG] compatible_brands: isommp42
[2024-09-06 15:16:18] DEBUG: [FFMPEG] encoder         : Google
[2024-09-06 15:16:18] DEBUG: [FFMPEG] Duration: 00:03:21.06, start: 0.000000, bitrate: 195 kb/s
[2024-09-06 15:16:18] DEBUG: [FFMPEG] Stream #0:0[0x1](und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x360 [SAR 1:1 DAR 16:9], 96 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)
[2024-09-06 15:16:18] DEBUG: Stream ready!
[2024-09-06 15:16:18] INFO: Song ending: Chappell Roan - HOT TO GO! (Karaoke Version)
[2024-09-06 15:16:18] DEBUG: Killing ffmpeg process
[2024-09-06 15:16:18] DEBUG: ffmpeg process killed
[2024-09-06 15:16:19] INFO: Song starting: None
[2024-09-06 15:16:19] DEBUG: Stream is playing
[2024-09-06 15:16:28] INFO: Song ending: None
[2024-09-06 15:16:28] DEBUG: Killing ffmpeg process
[2024-09-06 15:16:28] DEBUG: ffmpeg process killed

@vicwomg might know the answer however I'm in the process of adding a lot more comprehensive logging so these issues should be easier to debug I hope 😄

@vicwomg
Copy link
Owner

vicwomg commented Sep 6, 2024

I think the problem is specifying the hostname manually with -u doesn't account for the ports. By default, Pikaraoke needs two different ports, 5555 (splash screen) and 5556 (ffmpeg stream).

So if you somehow configured your domain to route to your pikaraoke server port 5555, you'll have to do the same with 5556 (perhaps as a different sub domain route entirely). You will likely also need to specify a manual --ffmpeg-url for the port 5556 routing. -u is considered an expert setup feature for folks familiar with advanced networking. I'd be open to posting a guide in the wiki, but will need someone else to come up with that guide

If you just want to use a more friendly URL for LAN use, I'd recommend going with the --prefer-hostname option instead.

@vicwomg vicwomg changed the title [BUG] Song ending immediately after playing on RPi 3 / Bullseye devices [BUG] Song ending immediately using the -u <custom_url> option Sep 6, 2024
@kylehild
Copy link
Author

kylehild commented Sep 6, 2024

That was it! I used my reverse proxy to point a new url (https://karaoke-ffmpeg.local.{redacted}.com) to the ffmpeg port on the server and then sent that url in with the -m flag and now everything plays perfectly on my VM.

I'll switch back to my RPi 3 and test again when I can but that seems like the culprit. Thank you both so much for the help!

It probably makes sense to update the help command to point out that those flags should be used in conjunction with each other.

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