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

Refactor Transcoding #358

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Shadowghost
Copy link
Contributor

@Shadowghost Shadowghost commented Dec 27, 2024

Changes:

  • Use fMP4 for HLS which supports more codecs when transcoding/remuxing
  • Use server-provided subtitle download URLs with correct codec file ending
  • Fix transcoding bitrate selector
  • Only enforce transcoding settings on forced transcode - otherwise remuxing will never happen

Issue:

@mcarlton00
Copy link
Member

Just testing functionality right now

when trying to force transcode a movie. Set the bitrate, select the subtitle stream. It seems to work on another option that also has an audio stream selection.

2025-01-18 11:19:32.294 T:1178360   error <general>: Exception in thread
2025-01-18 11:19:32.294 T:1178360   error <general>: Thread-4
2025-01-18 11:19:32.294 T:1178360   error <general>: :

2025-01-18 11:19:32.295 T:1178360   error <general>: Traceback (most recent call last):

2025-01-18 11:19:32.296 T:1178360   error <general>:
2025-01-18 11:19:32.296 T:1178360   error <general>:   File "/usr/lib/python3.13/threading.py", line 1041, in _bootstrap_inner
                                                       self.run()
                                                       ~~~~~~~~^^

2025-01-18 11:19:32.296 T:1178360   error <general>:
2025-01-18 11:19:32.296 T:1178360   error <general>:   File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/monitors.py", line 41, in run
                                                       show_menu(params)
                                                       ~~~~~~~~~^^^^^^^^

2025-01-18 11:19:32.296 T:1178360   error <general>:
2025-01-18 11:19:32.296 T:1178360   error <general>:   File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/functions.py", line 556, in show_menu
                                                       play_action(params)
                                                       ~~~~~~~~~~~^^^^^^^^

2025-01-18 11:19:32.296 T:1178360   error <general>:
2025-01-18 11:19:32.296 T:1178360   error <general>:   File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/functions.py", line 943, in play_action
                                                       play_file(play_info)
                                                       ~~~~~~~~~^^^^^^^^^^^

2025-01-18 11:19:32.296 T:1178360   error <general>:
2025-01-18 11:19:32.296 T:1178360   error <general>:   File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/tracking.py", line 25, in wrapper
                                                       value = func(*args, **kwargs)

2025-01-18 11:19:32.296 T:1178360   error <general>:
2025-01-18 11:19:32.296 T:1178360   error <general>:   File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/play_utils.py", line 464, in play_file
                                                       playurl = audio_subs_pref(playurl, list_item, selected_media_source, item_id, audio_stream_index,
                                                                                 subtitle_stream_index)

2025-01-18 11:19:32.296 T:1178360   error <general>:
2025-01-18 11:19:32.296 T:1178360   error <general>:   File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/play_utils.py", line 868, in audio_subs_pref
                                                       delivery_url = downloadable_streams[select_subs_index]['DeliveryUrl']
                                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^

2025-01-18 11:19:32.296 T:1178360   error <general>:
2025-01-18 11:19:32.296 T:1178360   error <general>: TypeError: 'int' object is not subscriptable

When trying to playback a livetv stream:

2025-01-18 11:21:36.798 T:1181919    info <general>: JELLYFIN.resources.lib.functions -> INFO::resources/lib/functions.py:942 Sending jellycon_play_action : {'action': 'play', 'item_id': 'a0242c16b96145b49c9bb758fb5495a3', 'auto_resume': '-1', 'force_transcode': False, 'media_source_id': '', 'subtitle_stream_index': None, 'audio_stream_index': None}
2025-01-18 11:21:43.452 T:1181919   error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'KeyError'>
                                                   Error Contents: 'TranscodingUrl'
                                                   Traceback (most recent call last):
                                                     File "/home/matt/.kodi/addons/plugin.video.jellycon/default.py", line 18, in <module>
                                                       main_entry_point()
                                                       ~~~~~~~~~~~~~~~~^^
                                                     File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/tracking.py", line 25, in wrapper
                                                       value = func(*args, **kwargs)
                                                     File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/functions.py", line 156, in main_entry_point
                                                       play_action(params)
                                                       ~~~~~~~~~~~^^^^^^^^
                                                     File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/functions.py", line 943, in play_action
                                                       play_file(play_info)
                                                       ~~~~~~~~~^^^^^^^^^^^
                                                     File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/tracking.py", line 25, in wrapper
                                                       value = func(*args, **kwargs)
                                                     File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/play_utils.py", line 424, in play_file
                                                       playurl, playback_type, listitem_props = get_play_url(selected_media_source, play_session_id, channel_id)
                                                                                                ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                                                     File "/home/matt/.kodi/addons/plugin.video.jellycon/resources/lib/play_utils.py", line 1244, in get_play_url
                                                       playurl = '{}{}'.format(server, media_source['TranscodingUrl'])
                                                                                       ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
                                                   KeyError: 'TranscodingUrl'
                                                   -->End of Python script error report<--

@Shadowghost
Copy link
Contributor Author

Just to understand, this only appears if you force transcode a media file with exactly one video, one audio but multiple subtitle streams?

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

Successfully merging this pull request may close these issues.

Support for fMP4
2 participants