jellyfin-android icon indicating copy to clipboard operation
jellyfin-android copied to clipboard

Exoplayer with LiveTV stream no sound and keep streaming after close client

Open yongman opened this issue 1 year ago • 3 comments

Describe the bug

Watching LiveTV using ExoPlayer, audio stream have mp2 format, but no sound in device.

And when I exit client, the stream keep going in server, and xteve not stopped (using web client xteve streaming stopped after client exit)

Input #0, mpegts, from 'http://192.168.31.15:8096/LiveTv/LiveStreamFiles/712f8e2018f246559e1aa09e72aed0cb/stream.ts':
  Duration: N/A, start: 1.440000, bitrate: N/A
  Program 1 
    Metadata:
      service_name    : live
      service_provider: FFmpeg
  Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn
  Stream #0:1[0x101]: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Output #0, hls, to '/media/cache/jellyfin/transcodes/89d95469be403f8cccb9470185cf7560.m3u8':
  Metadata:
    encoder         : Lavf59.27.100
  Stream #0:0: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 25 tbr, 90k tbn
  Stream #0:1: Audio: mp2 ([3][0][0][0] / 0x0003), 48000 Hz, stereo, fltp, 192 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)

Logs

No response

Application version

2.4.4

Where did you install the app from?

Sideloaded APK (libre build)

Device information

Android 12, OnePlus 9Pro

Android version

Android 12

Jellyfin server version

10.8.4

Which video player implementations does this bug apply to?

  • [x] Web player (default)
  • [X] Integrated player (ExoPlayer)
  • [ ] External player (VLC, mpv, MX Player)

yongman avatar Aug 20 '22 15:08 yongman

Can confirm this behaviour. Additionally when using the Web player there is no sound for mp2 streams. When switching to ac3 (which gets transcoded to aac) sound is there. Can you force mp2 to get transcoded?

lomion0815 avatar Aug 25 '22 19:08 lomion0815

I investigated this issue further. This problem is not limited to the android app but applies also to jellyfin-web (since the android app is a wrapper around jellyfin-web this makes absolute sense). Jellyfin-web does some assumptions about the support of mp2 based on the browser engine and if mp3 is supported. (see https://github.com/jellyfin/jellyfin-web/blob/f426747b6210adeb71f7714a6459a41079867b93/src/scripts/browserDeviceProfile.js#L385 ff). While this is valid for the desktop it does not apply to Android based browsers. Verified by forcing let supportsMp2VideoAudio = false; then the audio gets transcoded to aac and I have audio on my mobile. Suggestions:

  1. Fix the jellyfin-web code to correctly set supportsMp2VideoAudio for Android based devices (does not fix the Exoplayer problem)
  2. Get https://github.com/jellyfin/jellyfin-android/blob/44d403f461f18d6f08cd360982a3879c5a1aa3b4/app/src/main/java/org/jellyfin/mobile/player/deviceprofile/DeviceProfileBuilder.kt to set the deviceProfile correctly.

lomion0815 avatar Aug 26 '22 12:08 lomion0815

Update: Option 1: This works when using the Web Player. Changed jellyfin-web on my server. Doesn't need change in Jellyfin-Android. Option 2: Have a changed version which already requests a transcoded stream (without mp2) but I can not test it because I always receive a player_error_network_failure when starting the Exoplayer for transcoded stream (DirectPlay works). This seems not to be related to this problem but I can not test any fix.

lomion0815 avatar Aug 26 '22 19:08 lomion0815