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

Hardware acceleration for jetson #6604

Closed
wants to merge 7 commits into from
Closed

Conversation

mattangus
Copy link

Changes

Adds a docker file for building and installing jocover/jetson-ffmpeg to allow for hardware acceleration for the nvidia jetson.

I have tested this on the jetson nano. Please let me know if there is a better way to handle the jetson case. Currently you can find a built image on dockerhub (https://hub.docker.com/r/mattangus/jellyfin-jetson).

docker needs to be run with --runtime nvidia.

for some reason I could only get it to work with docker-compose by adding mkdir /usr/lib/jellyfin-ffmpeg; ln -s /usr/bin/ffmpeg /usr/lib/jellyfin-ffmpeg/ffmpeg to the entry point.

Issues

Implements: #5674 (or https://features.jellyfin.org/posts/1118/add-jetson-ffmpeg-nvmpi-support)

@mattangus mattangus changed the title initial commit for jetson Hardware acceleration for jetson Sep 24, 2021
@cvium
Copy link
Member

cvium commented Sep 26, 2021

None of us have a jetson device, so I'd be very hesitant to add an official docker image for it. Not to mention that building ffmpeg in the image is a bit too much, it should be built elsewhere.

@mattangus
Copy link
Author

Ok, when I have the time I can set up a dockerfile for building ffmpeg in jocover/jetson-ffmpeg, and then the jellyfin one can pull from that. But It seems like that won't be enough to get this merged, am I correct? Is there an offical place for unoffical docker images that this could go?

@Artiume
Copy link
Contributor

Artiume commented Sep 29, 2021

https://jellyfin.org/docs/general/administration/installing.html#container-images

We do advertise third party images here by linuxserver and hotio. We could add it here as an unofficial image

@LinusCDE
Copy link

LinusCDE commented Nov 10, 2021

This seems like a nice step already. I'm gonna try this in a sec as I need to work out the linuxserver to vanilla docker changes to keep everything mounted correctly.

I had done some testing a while ago. After some nasty mapping I got it to work but had to remove some unsupported/renamed parameters and also experienced some weird systemd crashes when using docker with the nvidia runtime for jellyfin.

Nvidia also added official hw decode suport a while ago. I added the patch and fixed it to work with ffmpeg 4.4 together with jetson-ffmpeg.

Can someone tell me whether this patch will be included in a future ffmpeg? I only followed a couple of messages and am not sure why the patch is not in the latest release already. Will it ever get merged? http://ffmpeg.org/pipermail/ffmpeg-devel/2020-June/263746.html

@LinusCDE
Copy link

for some reason I could only get it to work with docker-compose by adding mkdir /usr/lib/jellyfin-ffmpeg; ln -s /usr/bin/ffmpeg /usr/lib/jellyfin-ffmpeg/ffmpeg to the entry point.

It seems that the source uses --ffmpeg only as a second choice. The comment [here] explains it well:

// 1) Custom path stored in config/encoding xml file under tag <EncoderAppPath> takes precedence

And it seems that this file has /usr/lib/jellyfin-ffmpeg/ffmpeg set. But could also be from my old linuxserver installation (from which I just migrated).

This works in theory but needs a encoder profile. I'll try to add one.

It should also be noted that this ffmpeg version has a hard requirement on nvidias runtime. If the docker is not run with the nvidia container runtime, ffmpeg will error out with Could not create Default NvBufferSession for everything (even just ffmpeg). So it won't work even if hardware decoding is disabled in jellyfin.

@LinusCDE
Copy link

LinusCDE commented Nov 11, 2021

Did a lot more digging and finally got nvmpi to work great thanks to your image!

Since I'm not really into C# I did a "quick" wrapper script that turns "no hardware accel" into using nvmpi for both decoding and encoding. My earlier tests were using a suboptimal way of integrating ffmpeg and the quality was also always garbage which made me not persue it at the time. Now this is solved.

Edit: Teaser image (transcoding Doctor Strange (BluRay; 1080p @ ~30MBit/s) to 1080 with 15 MBit/s with hardware acceleration:

screenshot4274

NVMPI Supported extra flags:

nvmpi doesn't support some flags like -crf and certain presets here is what is the help output to see what is supported:

ffmpeg -h encoder=h264_nvmpi
Encoder h264_nvmpi [nvmpi H.264 encoder wrapper]:
    General capabilities: delay hardware 
    Threading capabilities: none
    Supported pixel formats: yuv420p
h264_nvmpi_encoder AVOptions:
  -num_capture_buffers <int>        E..V....... Number of buffers in the capture context (from 1 to 32) (default 10)
  -profile           <int>        E..V....... Set the encoding profile (from -99 to 100) (default -99)
     baseline        66           E..V....... 
     main            77           E..V....... 
     high            100          E..V....... 
  -level             <int>        E..V....... Profile Level (from 0 to 62) (default auto)
     auto            0            E..V....... 
     1.0             10           E..V....... 
     1.1             11           E..V....... 
     1.2             12           E..V....... 
     1.3             13           E..V....... 
     2.0             20           E..V....... 
     2.1             21           E..V....... 
     2.2             22           E..V....... 
     3.0             30           E..V....... 
     3.1             31           E..V....... 
     3.2             32           E..V....... 
     4.0             40           E..V....... 
     4.1             41           E..V....... 
     4.2             42           E..V....... 
     5.0             50           E..V....... 
     5.1             51           E..V....... 
  -rc                <int>        E..V....... Override the preset rate-control (from -1 to INT_MAX) (default -1)
     cbr             0            E..V....... Constant bitrate mode
     vbr             1            E..V....... Variable bitrate mode
  -preset            <int>        E..V....... Set the encoding preset (from 1 to 4) (default default)
     default         3            E..V....... 
     slow            4            E..V....... 
     medium          3            E..V....... 
     fast            2            E..V....... 
     ultrafast       1            E..V....... 
ffmpeg -h encoder=hevc_nvmpi
Encoder hevc_nvmpi [nvmpi HEVC encoder wrapper]:
    General capabilities: delay hardware 
    Threading capabilities: none
    Supported pixel formats: yuv420p
hevc_nvmpi_encoder AVOptions:
  -num_capture_buffers <int>        E..V....... Number of buffers in the capture context (from 1 to 32) (default 10)
  -profile           <int>        E..V....... Set the encoding profile (from -99 to 100) (default -99)
     baseline        66           E..V....... 
     main            77           E..V....... 
     high            100          E..V....... 
  -level             <int>        E..V....... Profile Level (from 0 to 62) (default auto)
     auto            0            E..V....... 
     1.0             10           E..V....... 
     1.1             11           E..V....... 
     1.2             12           E..V....... 
     1.3             13           E..V....... 
     2.0             20           E..V....... 
     2.1             21           E..V....... 
     2.2             22           E..V....... 
     3.0             30           E..V....... 
     3.1             31           E..V....... 
     3.2             32           E..V....... 
     4.0             40           E..V....... 
     4.1             41           E..V....... 
     4.2             42           E..V....... 
     5.0             50           E..V....... 
     5.1             51           E..V....... 
  -rc                <int>        E..V....... Override the preset rate-control (from -1 to INT_MAX) (default -1)
     cbr             0            E..V....... Constant bitrate mode
     vbr             1            E..V....... Variable bitrate mode
  -preset            <int>        E..V....... Set the encoding preset (from 1 to 4) (default default)
     default         3            E..V....... 
     slow            4            E..V....... 
     medium          3            E..V....... 
     fast            2            E..V....... 
     ultrafast       1            E..V....... 

Wrapper script changes

Edit: I also made sure that the wrapper script doesn't interfere when no transcoding is done. So help and other command should just works as well.

The wrapper script does a few things:

  • Runs ffprobe on the file specified after -i to determine the codec. Then prepends ffmpeg arguments with -c:v CODEC_nvmpi to use hardware decoding.
  • Replaces libx264 with h264_nvmpi and libx265 with hevc_nvmpi to use hardware encoding
  • Turns -crf <num> into -rc crf. If no -crf is provided -rc vbr will be added instead.
  • Removes some unsupported flags (-x264opts:0 and subme...).
  • Maps all common presets to just slow, medium, fast and ultrafast
  • Sets the bitrate to be the maximum rate (-b:v <maxrate_param>). The hardware encoder otherwise defaults to a very low bitrate and doesn't really pay attention to the maxrate resulting in horrible video which I encountered at first. This seems to be the magic bullet for good quality!

Instructions

Docker image

Use the image from @mattangus: mattangus/jellyfin-jetson:latest

If you previously used linuxserver you may want to add this (make a backup of your old volumes and check this as well!):

    environment:
      - JELLYFIN_DATA_DIR=/config/data
      - JELLYFIN_CONFIG_DIR=/config
      - JELLYFIN_LOG_DIR=/config/log
      - JELLYFIN_CACHE_DIR=/config/cache
    entrypoint: [ "./jellyfin/jellyfin", "--ffmpeg", "/usr/bin/ffmpeg" ]

Nvidia runtime

Ensure you're running with the nvidia runtime. Not even software de/encoding will work without it! If you're using docker-compose v2 (the newer fancy go version) then runtime: nvidia will just get silently ignored. You can use this instead to enable it:

    environment:
      - NVIDIA_DRIVER_CAPABILITIES=all # May not be needed
      - NVIDIA_VISIBLE_DEVICES=all # May not be needed
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              capabilities: [gpu]

Add wrapper script

This script act as ffmpeg and turn jellyfin's and change the en/decoders into nvmpi ones instead (while also removing/altering unsupported flags): https://gist.github.com/LinusCDE/9b7c9901ad6a5c56eeb7b2781443fd0b

Make this script executable and mount it into the jellyfin container into the same directory as ffmpeg (the script assumes ffmpeg and ffprobe to be in the same directory).

    volumes:
      - ./ffmpeg-wrapper.sh:/usr/bin/ffmpeg-wrapper
      # ...

Make jellyfin use the wrapper instead

Tell jellyfin that ffmpeg is at /usr/bin/ffmpeg-wrapper by either editing it in the web interface, changing the --ffmpeg flag or changing the content of <EncoderAppPath> in <CONFIG_DIR>/encoding.xml.

Encoder settings

Do not select any hardware acceleration in the jellyfin playback. Videos should already play and a tool like jtop should show you usage of nvenc and nvdec.

It shouldn't be a problem now to also change the encoding preset to "Slow" or similar. The default/auto seems to be "veryfast".


This should be it. Feel free to try out. It would be really cool if we could have some encoder support in case ffmpeg -encoders lists e.g. h264_nvmpi. Then people could use the alternate Dockerfile and have hardware support ready to go without much hassle. The provided information should help for knowing that settings this encoder likes or can't handle. I'm willing to test this out if anyone makes a prototype for software integration.

@mattangus
Copy link
Author

I have now moved the building of ffmpeg to another container. I also added the wrapper script from @LinusCDE. @cvium is this moving in the right direction?

@mattangus
Copy link
Author

The only modification I made to your script @LinusCDE is turning off hardware acceleration when the pixel format is unsupported.

@LinusCDE
Copy link

The only modification I made to your script @LinusCDE is turning off hardware acceleration when the pixel format is unsupported.

Good point. I also encountered an error when playing back doctor who. Not sure what it was but smaller/odd resolutions might have some kind of bug. I didn't get to investigate it, yet. So the script might have a lot of problems. From a maintainers perspective, this script is also probably just a dirty hack and I wouldn't wonder if an actual HW Profile in Jellyfin would be required for a merge.

But the script should at least make this change more easily testable and lay out the needed changes for such a HW Profile.

@insaaniManav
Copy link

insaaniManav commented Jan 8, 2022

HI, any way I can test this out still ?
Where is the docker image hosted ? couldn't find it on dockerhub

@LinusCDE
Copy link

LinusCDE commented Jan 8, 2022

It is linked in the first post:

I have tested this on the jetson nano. Please let me know if there is a better way to handle the jetson case. Currently you can find a built image on dockerhub (https://hub.docker.com/r/mattangus/jellyfin-jetson).

@insaaniManav
Copy link

It is linked in the first post:

I have tested this on the jetson nano. Please let me know if there is a better way to handle the jetson case. Currently you can find a built image on dockerhub (https://hub.docker.com/r/mattangus/jellyfin-jetson).

Hi, Sorry to bug you again is there a recommended docker-compose file with all the recommended flags etc ?

@LinusCDE
Copy link

This is my current config. You can probably just use a standard provided one while using the custom image. Some paths and envs more more complex here, since I migrated from linuxservers to test this.

version: "2"
services:
  jellyfin:
    image: mattangus/jellyfin-jetson
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              capabilities: [gpu]
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - NVIDIA_DRIVER_CAPABILITIES=all
      - NVIDIA_VISIBLE_DEVICES=all
    # Non linuserver image
      - JELLYFIN_DATA_DIR=/config/data
      - JELLYFIN_CONFIG_DIR=/config
      - JELLYFIN_LOG_DIR=/config/log
      - JELLYFIN_CACHE_DIR=/config/cache
    #entrypoint: [ "/config/entrypoint.sh" ]
    ports:
      - "127.0.0.1:84:8096"
    volumes:
      - ./config:/config
      - /path/to/your/media:/data:ro

@TomErnst1972
Copy link

TomErnst1972 commented Mar 4, 2022

had to update/use docker-compose on the older ubuntu on the jetson nano, now it runs...

but, it doesnt accelerate the videos and looks wierd:
jelly

any ideas?

Sorry for beeing a newbie, but:
how can i start the docker image with your config file beeing provided? is this docker-compose?

@LinusCDE
Copy link

LinusCDE commented Mar 4, 2022

[...] it doesnt accelerate the videos and looks wierd

The normal case when it shouldn't try to accelerate is:

  • The stream video is source quality / passthrough » Set a lower bitrate and/or resolution
  • The format of the video is something non-h264/h265 (not sure whether vp8/9 was enabled in the script)

It might also be some weird resolution. I have some shows that just fail to de-/encode rn as well. Try something h264/h265 with fhd resolution. For examples, blurays play fine for me (which are fhd) but stuff like Doctor Who doesn't since some early episodes have some weird dvd-like resolution. Not sure on the exact reason but this is an area that needs to be investigated and improved more.

That image sure looks weird. For me it was usually "works" or "fails" but never any weird output. Some more details might be helpful (e.g. the output of ffprobe <path_to_your_file>).

The current solution for sure is not production ready as it is more a poc rn. It should probably be marked as Draft, @mattangus .

Sorry for beeing a newbie, but:
how can i start the docker image with your config file beeing provided? is this docker-compose?

The script I posted above your answer should be a working docker-compose.yml. Best is to try with a clean installation, but I think I discussed how I migrated my linuxserver instance. It should work fine if you used the official container from here.

If you want to built it, you can clone mattangus' repo and replace the image in the docker-compose with the following:

    build:
      context: path_to_jellyfin_repo
      dockerfile: context: path_to_jellyfin_repo/Dockerfile.arm64-jetson

This should build the docker locally and then use it. Add --build to docker-compose up -d to ensure it checks the file again if you changed something.

@TomErnst1972
Copy link

thx for you help! will continue to investigate. just for making sure:

  • is it enough to use the mentioned docker image or do i have to compile jetson-ffmpeg on the Nano? (which i did, even removed the ubuntu original ffmpeg just to make sure, that there is no overlapping beetween distro and selfcompiled version...
  • would you be so kind to write a few short lines summary what has to be done to reach the goal? (jellyfin with hw accel on Jetson Nano)

would appreciate it! :-) even kust pointing to me some ressources...

best from Cologne,
Tom

@LinusCDE
Copy link

LinusCDE commented Mar 5, 2022

would you be so kind to write a few short lines summary

It should be. However I do not own a Jetson Nano. I think the current script just assumes that certain codecs just work on all resolutions and I'm not sure if there might be some corner case with like H265/FHD or similar regarding the Nano's HW accel capabilities.

Here are some ramblings on possible problems that come to my mind:

You should certainly be able to see, NVDec and/or NVEnc be active in jtop. Error's should be visible in the log (docker-compose logs -f). If you recompile it (or just log into the container, you can modify the scripts/ffmpeg-jetson-wrapper script to verify it is actually executed and, by uncommenting the echo "Wrapper... lines, can see how the original ffmpeg command was altered (which I used a bunch for initial debugging).

You can also use the output and run it with a locally built jetson-ffmpeg. That way you could ensure whether it really is an incompatible ffmpeg build or more easily diagnose other ffmpeg/hw issues.

I doubt that the script is not running in your case. Otherwise it should just use plain old sw de/encoding without anything of note. Otherwise [this earlier reply] might help.

is it enough to use the mentioned docker image or do i have to compile jetson-ffmpeg on the Nano?

I think the provided image should just work with the docker-compose example above. If not maybe it's some hardware problem (like using the max bitrate as the min/target one) could be it. In that case, maybe commenting out this part might help.

One thing that also might be it, is whether there is some incompatibility with the Ubuntu/Jetpack version and nvidias shipped libs.

I'm currently running these versions of stuff:

image

(Yeah, I'm a horrible person that treats the device as a server which it was never intended to and thus has now a really outdated setup)

I don't fully grasp how nvidia is structuring their library stuff, so that part is probably way better explained by @mattangus .

@mattangus
Copy link
Author

@TomErnst1972 I have a jetson nano and it works fine for me. Can you post the following:

$ jetson_release
 - NVIDIA Jetson Nano (Developer Kit Version)
   * Jetpack 4.5.1 [L4T 32.5.1]
   * NV Power Mode: MAXN - Type: 0
   * jetson_stats.service: active
 - Libraries:
   * CUDA: 10.2.89
   * cuDNN: 8.0.0.180
   * TensorRT: 7.1.3.0
   * Visionworks: 1.6.0.501
   * OpenCV:  compiled CUDA: NO
   * VPI: ii libnvvpi1 1.0.15 arm64 NVIDIA Vision Programming Interface library
   * Vulkan: 1.2.70

@mattangus
Copy link
Author

Also post ffprobe <video you are trying to watch> so we can see if it has something to do with the encoding.

@mattangus
Copy link
Author

I actually happend to encounter an issue like this myself. Here is a photo. It only happens on my android tv. Here is a photo:

WhatsApp Image 2022-03-19 at 3 20 01 PM

Here is the log from jellyfin.

[15:00:07] [INF] [106] Jellyfin.Api.Controllers.MediaInfoController: GetPostedPlaybackInfo profile: {"Name": "AndroidTV-libVLC", "Id": null, "Identification": null, "FriendlyName": null, "Manufacturer": null, "ManufacturerUrl": null, "ModelName": null, "ModelDescription": null, "ModelNumber": null, "ModelUrl": null, "SerialNumber": null, "EnableAlbumArtInDidl": false, "EnableSingleAlbumArtLimit": false, "EnableSingleSubtitleLimit": false, "SupportedMediaTypes": "Audio,Photo,Video", "UserId": null, "AlbumArtPn": null, "MaxAlbumArtWidth": 0, "MaxAlbumArtHeight": 0, "MaxIconWidth": null, "MaxIconHeight": null, "MaxStreamingBitrate": 20000000, "MaxStaticBitrate": 100000000, "MusicStreamingTranscodingBitrate": 128000, "MaxStaticMusicBitrate": 8000000, "SonyAggregationFlags": null, "ProtocolInfo": null, "TimelineOffsetSeconds": 0, "RequiresPlainVideoItems": false, "RequiresPlainFolders": false, "EnableMSMediaReceiverRegistrar": false, "IgnoreTranscodeByteRangeRequests": false, "XmlRootAttributes": [], "DirectPlayProfiles": [{"Container": "m4v,3gp,ts,mpegts,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,m2v,avi,mpg,mpeg,mp4,webm,wtv", "AudioCodec": "aac,mp3,mp2,ac3,wma,wmav2,dca,dts,pcm,PCM_S16LE,PCM_S24LE,opus,flac,truehd", "VideoCodec": null, "Type": "Video", "$type": "DirectPlayProfile"}, {"Container": "flac,aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "jpg,jpeg,png,gif,webp", "AudioCodec": null, "VideoCodec": null, "Type": "Photo", "$type": "DirectPlayProfile"}], "TranscodingProfiles": [{"Container": "mkv", "Type": "Video", "VideoCodec": "h264", "AudioCodec": "aac,mp3", "Protocol": "", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": true, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": null, "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "mp3", "Type": "Audio", "VideoCodec": "", "AudioCodec": "mp3", "Protocol": "", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": null, "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}], "ContainerProfiles": [{"Type": "Video", "Conditions": [{"Condition": "NotEquals", "Property": "VideoCodecTag", "Value": "xvid", "IsRequired": false, "$type": "ProfileCondition"}], "Container": "avi", "$type": "ContainerProfile"}], "CodecProfiles": [{"Type": "Video", "Conditions": [{"Condition": "NotEquals", "Property": "VideoProfile", "Value": "none", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "hevc", "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "EqualsAny", "Property": "VideoProfile", "Value": "high|main|baseline|constrained baseline", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "LessThanEqual", "Property": "VideoLevel", "Value": "51", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "h264", "Container": null, "$type": "CodecProfile"}, {"Type": "VideoAudio", "Conditions": [{"Condition": "LessThanEqual", "Property": "AudioChannels", "Value": "8", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": null, "Container": null, "$type": "CodecProfile"}], "ResponseProfiles": [], "SubtitleProfiles": [{"Format": "srt", "Method": "External", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "srt", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "subrip", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ass", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ssa", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "pgs", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "pgssub", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "dvdsub", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "vtt", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "sub", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "smi", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "idx", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}], "$type": "DeviceProfile"}
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for matt. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-libVLC, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: AndroidTV-libVLC for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-libVLC, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: AndroidTV-libVLC for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-libVLC, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: AndroidTV-libVLC for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:00:07] [INF] [122] Jellyfin.Api.Controllers.MediaInfoController: GetPostedPlaybackInfo profile: {"Name": "AndroidTV-ExoPlayer", "Id": null, "Identification": null, "FriendlyName": null, "Manufacturer": null, "ManufacturerUrl": null, "ModelName": null, "ModelDescription": null, "ModelNumber": null, "ModelUrl": null, "SerialNumber": null, "EnableAlbumArtInDidl": false, "EnableSingleAlbumArtLimit": false, "EnableSingleSubtitleLimit": false, "SupportedMediaTypes": "Audio,Photo,Video", "UserId": null, "AlbumArtPn": null, "MaxAlbumArtWidth": 0, "MaxAlbumArtHeight": 0, "MaxIconWidth": null, "MaxIconHeight": null, "MaxStreamingBitrate": 20000000, "MaxStaticBitrate": 100000000, "MusicStreamingTranscodingBitrate": 128000, "MaxStaticMusicBitrate": 8000000, "SonyAggregationFlags": null, "ProtocolInfo": null, "TimelineOffsetSeconds": 0, "RequiresPlainVideoItems": false, "RequiresPlainFolders": false, "EnableMSMediaReceiverRegistrar": false, "IgnoreTranscodeByteRangeRequests": false, "XmlRootAttributes": [], "DirectPlayProfiles": [{"Container": "m4v,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,mp4,webm", "AudioCodec": "aac,ac3,eac3,aac_latm,mp3,mp2,dca,dts", "VideoCodec": "h264,hevc,vp8,vp9,mpeg,mpeg2video", "Type": "Video", "$type": "DirectPlayProfile"}, {"Container": "aac,mp3,mpa,flac,wav,wma,mp2,ogg,oga,webma,ape,opus", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "jpg,jpeg,png,gif,webp", "AudioCodec": null, "VideoCodec": null, "Type": "Photo", "$type": "DirectPlayProfile"}], "TranscodingProfiles": [{"Container": "mkv", "Type": "Video", "VideoCodec": "h264", "AudioCodec": "ac3,aac,mp3", "Protocol": "", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": true, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": null, "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "mp3", "Type": "Audio", "VideoCodec": "", "AudioCodec": "mp3", "Protocol": "", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": null, "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}], "ContainerProfiles": [], "CodecProfiles": [{"Type": "Video", "Conditions": [{"Condition": "EqualsAny", "Property": "VideoProfile", "Value": "high|main|baseline|constrained baseline", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "LessThanEqual", "Property": "VideoLevel", "Value": "51", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "h264", "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "LessThanEqual", "Property": "RefFrames", "Value": "12", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [{"Condition": "GreaterThanEqual", "Property": "Width", "Value": "1200", "IsRequired": false, "$type": "ProfileCondition"}], "Codec": "h264", "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "LessThanEqual", "Property": "RefFrames", "Value": "4", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [{"Condition": "GreaterThanEqual", "Property": "Width", "Value": "1900", "IsRequired": false, "$type": "ProfileCondition"}], "Codec": "h264", "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "NotEquals", "Property": "VideoProfile", "Value": "none", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "hevc", "Container": null, "$type": "CodecProfile"}, {"Type": "VideoAudio", "Conditions": [{"Condition": "LessThanEqual", "Property": "AudioChannels", "Value": "6", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": null, "Container": null, "$type": "CodecProfile"}], "ResponseProfiles": [], "SubtitleProfiles": [{"Format": "srt", "Method": "External", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "srt", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "subrip", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ass", "Method": "Encode", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ssa", "Method": "Encode", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "pgs", "Method": "Encode", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "pgssub", "Method": "Encode", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "dvdsub", "Method": "Encode", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "vtt", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "sub", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "idx", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}], "$type": "DeviceProfile"}
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for matt. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-ExoPlayer, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-ExoPlayer, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-ExoPlayer, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [45] Jellyfin.Api.Helpers.TranscodingJobHelper: /usr/lib/jellyfin-ffmpeg/ffmpeg -f matroska,webm -i file:"/media/TV/Severance/Season 1/Severance.S01E01.mkv" -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -force_key_frames "expr:gte(t,n_forced*5)" -vf "scale=trunc(min(max(iw\,ih*dar)\,720)/2)*2:trunc(ow/dar/2)*2,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709" -copyts -avoid_negative_ts disabled -start_at_zero -pix_fmt yuv420p -preset superfast -crf 23 -maxrate 1016253 -bufsize 2032506 -profile:v:0 high -level 41 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 ac3 -ac 6 -ab 384000 -y "/config/transcodes/86de14434e5c664178655d3a77baed21.mkv"
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
875967048
842091865
Opening in BLOCKING MODE
Opening in BLOCKING MODE
875967048
842091865
[15:00:12] [WRN] [41] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/stream.mkv?DeviceId=9366926a67e0d06bcfe8bfdc99bc7f965aa0687e&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=ac3,aac,mp3&AudioStreamIndex=1&VideoBitrate=1016253&AudioBitrate=384000&PlaySessionId=1da7c32359414de8806990cc4d9f5b95&api_key=ff687020790f4c1d87c46bb75eac0964&CopyTimestamps=true&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&h264-maxrefframes=12&ac3-audiochannels=6&aac-audiochannels=6&mp3-audiochannels=6&TranscodeReasons=ContainerBitrateExceedsLimit&allowVideoStreamCopy=false&allowAudioStreamCopy=false&allowAudioStreamCopy=false to 192.168.1.101 in 0:00:04.8125706 with Status Code 200
[15:00:19] [INF] [101] Jellyfin.Api.Helpers.TranscodingJobHelper: Stopping ffmpeg process with q command for /config/transcodes/86de14434e5c664178655d3a77baed21.mkv
[15:00:20] [ERR] [101] Jellyfin.Api.Helpers.TranscodingJobHelper: FFmpeg exited with code 139
[15:00:20] [INF] [101] Jellyfin.Api.Helpers.TranscodingJobHelper: Deleting partial stream file(s) /config/transcodes/86de14434e5c664178655d3a77baed21.mkv
[15:00:22] [INF] [41] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app Android TV 0.12.3 playing Good News About Hell. Stopped at 5135 ms
[15:00:22] [WRN] [41] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Sessions/Playing/Stopped to 192.168.1.101 in 0:00:03.4573286 with Status Code 204

It only happens when transcoding this video becuase it works on my desktop using the browser and I get this log:

[15:01:58] [INF] [103] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for matt has succeeded.
[15:01:58] [INF] [103] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user matt: 2/0
[15:01:58] [INF] [103] Emby.Server.Implementations.Session.SessionManager: Creating new access token for user bce332e1-2ff5-4c84-ac64-a6032b024a6a
[15:01:59] [WRN] [103] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Users/authenticatebyname to 192.168.1.103 in 0:00:00.752396 with Status Code 200
[15:01:59] [INF] [62] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 192.168.1.103 request
[15:02:00] [WRN] [58] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/c41740b2d93ad4c944b07278fbc06dcf/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=def3eff6b93e35c43a1a77b1c67bb416 to 192.168.1.103 in 0:00:00.6560097 with Status Code 200
[15:02:00] [WRN] [58] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/279d1eadb338e57096c4a2b80c626bee/Images/Primary?fillHeight=335&fillWidth=223&quality=96&tag=7e8b6b4c0906cba1b06a1055bf4acb62 to 192.168.1.103 in 0:00:00.6337082 with Status Code 200
[15:02:00] [WRN] [104] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/6a721dc0fd05ebfd949761f490b185c4/Images/Primary?fillHeight=335&fillWidth=223&quality=96&tag=f52428fdb43aa18cd0d17944469d99aa to 192.168.1.103 in 0:00:00.8638928 with Status Code 200
[15:02:01] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/f72e9ce532bdff201a6cd859aeda30a8/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=d701678d9ddf431be75b420fc6b0ce5a to 192.168.1.103 in 0:00:02.4268139 with Status Code 200
[15:02:02] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/2476d555ebfd0ac55ecb878839b0b4a4/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=9c7d21ffb18c9e1e2aea3786441127f6 to 192.168.1.103 in 0:00:00.7314507 with Status Code 200
[15:02:02] [WRN] [103] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/556a0a953baad0f385ccbbcaa73ac839/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=48a57942c3f82b92bdcf62b191579d54 to 192.168.1.103 in 0:00:03.1681946 with Status Code 200
[15:02:03] [WRN] [104] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/556a0a953baad0f385ccbbcaa73ac839/Images/Primary?fillHeight=335&fillWidth=223&quality=96&tag=d92fafae8f870c854044d1bacc2ecde7 to 192.168.1.103 in 0:00:00.5030415 with Status Code 200
[15:02:04] [WRN] [58] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/7e0410d54beb56e3afb24607f31ae682/Images/Primary?fillHeight=335&fillWidth=223&quality=96&tag=39adf4acfd6626f0c3c8917f00541852 to 192.168.1.103 in 0:00:04.3194498 with Status Code 200
[15:02:04] [WRN] [58] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/6841e0d6fa7ea7a6d7643ec49e52cd95/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=a42af5cf31b55736223450c5ba31be4b to 192.168.1.103 in 0:00:02.6178795 with Status Code 200
[15:02:04] [WRN] [23] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/2f00f886b6af401e121a68d01c68b323/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=dc8dea4f0ffb3f811b94abacde8bc132 to 192.168.1.103 in 0:00:02.9727994 with Status Code 200
[15:02:04] [INF] [111] Jellyfin.Api.Controllers.MediaInfoController: GetPostedPlaybackInfo profile: {"Name": null, "Id": null, "Identification": null, "FriendlyName": null, "Manufacturer": null, "ManufacturerUrl": null, "ModelName": null, "ModelDescription": null, "ModelNumber": null, "ModelUrl": null, "SerialNumber": null, "EnableAlbumArtInDidl": false, "EnableSingleAlbumArtLimit": false, "EnableSingleSubtitleLimit": false, "SupportedMediaTypes": "Audio,Photo,Video", "UserId": null, "AlbumArtPn": null, "MaxAlbumArtWidth": null, "MaxAlbumArtHeight": null, "MaxIconWidth": null, "MaxIconHeight": null, "MaxStreamingBitrate": 120000000, "MaxStaticBitrate": 100000000, "MusicStreamingTranscodingBitrate": 384000, "MaxStaticMusicBitrate": 8000000, "SonyAggregationFlags": null, "ProtocolInfo": null, "TimelineOffsetSeconds": 0, "RequiresPlainVideoItems": false, "RequiresPlainFolders": false, "EnableMSMediaReceiverRegistrar": false, "IgnoreTranscodeByteRangeRequests": false, "XmlRootAttributes": [], "DirectPlayProfiles": [{"Container": "webm", "AudioCodec": "vorbis,opus", "VideoCodec": "vp8,vp9,av1", "Type": "Video", "$type": "DirectPlayProfile"}, {"Container": "mp4,m4v", "AudioCodec": "aac,mp3,opus,flac,vorbis", "VideoCodec": "h264,vp8,vp9,av1", "Type": "Video", "$type": "DirectPlayProfile"}, {"Container": "mov", "AudioCodec": "aac,mp3,opus,flac,vorbis", "VideoCodec": "h264", "Type": "Video", "$type": "DirectPlayProfile"}, {"Container": "opus", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "webm", "AudioCodec": "opus", "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "mp3", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "aac", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "m4a", "AudioCodec": "aac", "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "m4b", "AudioCodec": "aac", "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "flac", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "webma", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "webm", "AudioCodec": "webma", "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "wav", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "ogg", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}], "TranscodingProfiles": [{"Container": "ts", "Type": "Audio", "VideoCodec": "", "AudioCodec": "aac", "Protocol": "hls", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 1, "SegmentLength": 0, "BreakOnNonKeyFrames": true, "$type": "TranscodingProfile"}, {"Container": "aac", "Type": "Audio", "VideoCodec": "", "AudioCodec": "aac", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "mp3", "Type": "Audio", "VideoCodec": "", "AudioCodec": "mp3", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "opus", "Type": "Audio", "VideoCodec": "", "AudioCodec": "opus", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "wav", "Type": "Audio", "VideoCodec": "", "AudioCodec": "wav", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "opus", "Type": "Audio", "VideoCodec": "", "AudioCodec": "opus", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Static", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "mp3", "Type": "Audio", "VideoCodec": "", "AudioCodec": "mp3", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Static", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "aac", "Type": "Audio", "VideoCodec": "", "AudioCodec": "aac", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Static", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "wav", "Type": "Audio", "VideoCodec": "", "AudioCodec": "wav", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Static", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "ts", "Type": "Video", "VideoCodec": "h264", "AudioCodec": "aac,mp3", "Protocol": "hls", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 1, "SegmentLength": 0, "BreakOnNonKeyFrames": true, "$type": "TranscodingProfile"}, {"Container": "webm", "Type": "Video", "VideoCodec": "vp8,vp9,av1,vpx", "AudioCodec": "vorbis,opus", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "mp4", "Type": "Video", "VideoCodec": "h264", "AudioCodec": "aac,mp3,opus,flac,vorbis", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Static", "EnableSubtitlesInManifest": false, "MaxAudioChannels": null, "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}], "ContainerProfiles": [], "CodecProfiles": [{"Type": "VideoAudio", "Conditions": [{"Condition": "Equals", "Property": "IsSecondaryAudio", "Value": "false", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "aac", "Container": null, "$type": "CodecProfile"}, {"Type": "VideoAudio", "Conditions": [{"Condition": "Equals", "Property": "IsSecondaryAudio", "Value": "false", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": null, "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "NotEquals", "Property": "IsAnamorphic", "Value": "true", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "EqualsAny", "Property": "VideoProfile", "Value": "high|main|baseline|constrained baseline|high 10", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "LessThanEqual", "Property": "VideoLevel", "Value": "52", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "NotEquals", "Property": "IsInterlaced", "Value": "true", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "h264", "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "NotEquals", "Property": "IsAnamorphic", "Value": "true", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "EqualsAny", "Property": "VideoProfile", "Value": "main", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "LessThanEqual", "Property": "VideoLevel", "Value": "120", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "NotEquals", "Property": "IsInterlaced", "Value": "true", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "hevc", "Container": null, "$type": "CodecProfile"}], "ResponseProfiles": [{"Container": "m4v", "AudioCodec": null, "VideoCodec": null, "Type": "Video", "OrgPn": null, "MimeType": "video/mp4", "Conditions": [], "$type": "ResponseProfile"}], "SubtitleProfiles": [{"Format": "vtt", "Method": "External", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ass", "Method": "External", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ssa", "Method": "External", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}], "$type": "DeviceProfile"}
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for matt. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: Unknown Profile, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: unknown profile for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: Unknown Profile, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: unknown profile for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: Unknown Profile, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: unknown profile for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:02:05] [INF] [23] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesnt support non-keyframe breaks but one is requested, ignoring that request
[15:02:05] [INF] [23] Jellyfin.Api.Helpers.TranscodingJobHelper: /usr/lib/jellyfin-ffmpeg/ffmpeg -fflags +genpts -f matroska,webm -i file:"/media/TV/Severance/Season 1/Severance.S01E01.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 copy -bsf:v h264_mp4toannexb -start_at_zero -vsync -1 -codec:a:0 aac -ac 6 -ab 640000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 6 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/transcodes/39591c8a725a245c731e35ed3e20f5f4%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/transcodes/39591c8a725a245c731e35ed3e20f5f4.m3u8"
[15:02:12] [WRN] [30] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/0.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:06.5052982 with Status Code 200
[15:02:13] [WRN] [92] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Sessions/Playing/Progress to 192.168.1.103 in 0:00:00.7072706 with Status Code 204
[15:02:13] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Sessions/Playing to 192.168.1.103 in 0:00:00.9045571 with Status Code 204
[15:02:14] [WRN] [62] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/1.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:02.5591249 with Status Code 200
[15:02:16] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/2.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:02.1133206 with Status Code 200
[15:02:19] [WRN] [121] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/3.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:02.3127499 with Status Code 200
[15:02:20] [WRN] [58] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/4.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:01.3207155 with Status Code 200
[15:02:22] [WRN] [92] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/5.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:01.7167299 with Status Code 200
[15:02:22] [INF] [50] Jellyfin.Api.Helpers.TranscodingJobHelper: Stopping ffmpeg process with q command for /config/transcodes/39591c8a725a245c731e35ed3e20f5f4.m3u8
[15:02:23] [INF] [50] Jellyfin.Api.Helpers.TranscodingJobHelper: FFmpeg exited with code 0
[15:02:23] [INF] [50] Jellyfin.Api.Helpers.TranscodingJobHelper: Deleting partial stream file(s) /config/transcodes/39591c8a725a245c731e35ed3e20f5f4.m3u8
[15:02:23] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/6.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:00.7697376 with Status Code 200
[15:02:24] [INF] [50] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app Jellyfin Web 10.8.0 playing Good News About Hell. Stopped at 8223 ms
[15:02:24] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Sessions/Playing/Stopped to 192.168.1.103 in 0:00:02.2417985 with Status Code 204

Here is the ffprobe:

$ ffprobe Severance.S01E01.mkv
ffprobe version 174ed00 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --enable-nvmpi
  WARNING: library configuration mismatch
  avutil      configuration: --enable-shared --enable-libx264 --enable-gpl
  avcodec     configuration: --enable-shared --enable-libx264 --enable-gpl
  avformat    configuration: --enable-shared --enable-libx264 --enable-gpl
  avdevice    configuration: --enable-shared --enable-libx264 --enable-gpl
  avfilter    configuration: --enable-shared --enable-libx264 --enable-gpl
  swscale     configuration: --enable-shared --enable-libx264 --enable-gpl
  swresample  configuration: --enable-shared --enable-libx264 --enable-gpl
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
Input #0, matroska,webm, from 'Severance.S01E01.720p.WEB.h264-KOGi[rartv].mkv':
  Metadata:
    encoder         : libebml v1.4.2 + libmatroska v1.6.4
  Duration: 00:57:14.75, start: 0.000000, bitrate: 3644 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1482x620 [SAR 1:1 DAR 741:310], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 2870049
      DURATION        : 00:57:14.723000000
      NUMBER_OF_FRAMES: 82351
      NUMBER_OF_BYTES : 1232228208
      _STATISTICS_WRITING_APP: mkvmerge v64.0.0 ('Willows') 64-bit
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 6 channels, fltp (default)
........... (cut out meta data of subtitles)

I can confirm it's using both NVENC and NVDEC:

image

@cvium would you (or anyone else contributing to jellyfin) be able to help sort out why this is going wrong, or some steps to debug? I'm not that familiar with ffmpeg. I'll try to get this running with the regular jellyfin to see if it is in fact the new jetson port.

@LinusCDE
Copy link

Does the current jeston-ffmpeg also include the sw encoders/decoders? I think the official jetson-ffmpeg does not. Would probably interesting to see whether this stop occuring when not using the hw encoder. I doubt that the decoder would cause this.

Also published my mad combination/update of jetson-ffmpeg with most sw encoders/decoders, nvidias official decoders and a youtube-dl/yt-dlp merge fix here: https://github.com/LinusCDE/mad-jetson-ffmpeg

@nyanmisaka
Copy link
Member

nyanmisaka commented Mar 19, 2022

I'm wondering why NVIDIA doesn't provide the normal CUVID(CUDA VIDEO) path for Jetson/Tegra X1, which is a quite mature video API and can utilize the existing ffmpeg impl as well as CUDA filtering(scale+deint+tonemap+overlay).

They introduced nvmpi firstly but the decoded data will be copied back to memory before encoding. It will make a big loss in terms of the transcoding performance. And HW filtering is not available too due to the lacking of interoperability with existing CUDA hwcontext in ffmpeg.

Then nvv4l2dec decoder was submitted to ffmpeg's mailing list but devs gave the similar question - why not reuse the existing APIs?

NVIDIA seems to have put the video transcoding part of the Jetson/Terga X1 in a very awkward position. If they provide CUVID at the driver level then there is basically no need to make much changes in ffmpeg.

@pjueon
Copy link

pjueon commented Mar 23, 2022

Thank you for the guide. I'll give it a try!

@pjueon
Copy link

pjueon commented Mar 25, 2022

I actually happend to encounter an issue like this myself. Here is a photo. It only happens on my android tv. Here is a photo:

WhatsApp Image 2022-03-19 at 3 20 01 PM

Here is the log from jellyfin.

[15:00:07] [INF] [106] Jellyfin.Api.Controllers.MediaInfoController: GetPostedPlaybackInfo profile: {"Name": "AndroidTV-libVLC", "Id": null, "Identification": null, "FriendlyName": null, "Manufacturer": null, "ManufacturerUrl": null, "ModelName": null, "ModelDescription": null, "ModelNumber": null, "ModelUrl": null, "SerialNumber": null, "EnableAlbumArtInDidl": false, "EnableSingleAlbumArtLimit": false, "EnableSingleSubtitleLimit": false, "SupportedMediaTypes": "Audio,Photo,Video", "UserId": null, "AlbumArtPn": null, "MaxAlbumArtWidth": 0, "MaxAlbumArtHeight": 0, "MaxIconWidth": null, "MaxIconHeight": null, "MaxStreamingBitrate": 20000000, "MaxStaticBitrate": 100000000, "MusicStreamingTranscodingBitrate": 128000, "MaxStaticMusicBitrate": 8000000, "SonyAggregationFlags": null, "ProtocolInfo": null, "TimelineOffsetSeconds": 0, "RequiresPlainVideoItems": false, "RequiresPlainFolders": false, "EnableMSMediaReceiverRegistrar": false, "IgnoreTranscodeByteRangeRequests": false, "XmlRootAttributes": [], "DirectPlayProfiles": [{"Container": "m4v,3gp,ts,mpegts,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,m2v,avi,mpg,mpeg,mp4,webm,wtv", "AudioCodec": "aac,mp3,mp2,ac3,wma,wmav2,dca,dts,pcm,PCM_S16LE,PCM_S24LE,opus,flac,truehd", "VideoCodec": null, "Type": "Video", "$type": "DirectPlayProfile"}, {"Container": "flac,aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "jpg,jpeg,png,gif,webp", "AudioCodec": null, "VideoCodec": null, "Type": "Photo", "$type": "DirectPlayProfile"}], "TranscodingProfiles": [{"Container": "mkv", "Type": "Video", "VideoCodec": "h264", "AudioCodec": "aac,mp3", "Protocol": "", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": true, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": null, "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "mp3", "Type": "Audio", "VideoCodec": "", "AudioCodec": "mp3", "Protocol": "", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": null, "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}], "ContainerProfiles": [{"Type": "Video", "Conditions": [{"Condition": "NotEquals", "Property": "VideoCodecTag", "Value": "xvid", "IsRequired": false, "$type": "ProfileCondition"}], "Container": "avi", "$type": "ContainerProfile"}], "CodecProfiles": [{"Type": "Video", "Conditions": [{"Condition": "NotEquals", "Property": "VideoProfile", "Value": "none", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "hevc", "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "EqualsAny", "Property": "VideoProfile", "Value": "high|main|baseline|constrained baseline", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "LessThanEqual", "Property": "VideoLevel", "Value": "51", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "h264", "Container": null, "$type": "CodecProfile"}, {"Type": "VideoAudio", "Conditions": [{"Condition": "LessThanEqual", "Property": "AudioChannels", "Value": "8", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": null, "Container": null, "$type": "CodecProfile"}], "ResponseProfiles": [], "SubtitleProfiles": [{"Format": "srt", "Method": "External", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "srt", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "subrip", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ass", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ssa", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "pgs", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "pgssub", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "dvdsub", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "vtt", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "sub", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "smi", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "idx", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}], "$type": "DeviceProfile"}
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for matt. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-libVLC, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: AndroidTV-libVLC for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-libVLC, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: AndroidTV-libVLC for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-libVLC, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [106] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: AndroidTV-libVLC for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:00:07] [INF] [122] Jellyfin.Api.Controllers.MediaInfoController: GetPostedPlaybackInfo profile: {"Name": "AndroidTV-ExoPlayer", "Id": null, "Identification": null, "FriendlyName": null, "Manufacturer": null, "ManufacturerUrl": null, "ModelName": null, "ModelDescription": null, "ModelNumber": null, "ModelUrl": null, "SerialNumber": null, "EnableAlbumArtInDidl": false, "EnableSingleAlbumArtLimit": false, "EnableSingleSubtitleLimit": false, "SupportedMediaTypes": "Audio,Photo,Video", "UserId": null, "AlbumArtPn": null, "MaxAlbumArtWidth": 0, "MaxAlbumArtHeight": 0, "MaxIconWidth": null, "MaxIconHeight": null, "MaxStreamingBitrate": 20000000, "MaxStaticBitrate": 100000000, "MusicStreamingTranscodingBitrate": 128000, "MaxStaticMusicBitrate": 8000000, "SonyAggregationFlags": null, "ProtocolInfo": null, "TimelineOffsetSeconds": 0, "RequiresPlainVideoItems": false, "RequiresPlainFolders": false, "EnableMSMediaReceiverRegistrar": false, "IgnoreTranscodeByteRangeRequests": false, "XmlRootAttributes": [], "DirectPlayProfiles": [{"Container": "m4v,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,mp4,webm", "AudioCodec": "aac,ac3,eac3,aac_latm,mp3,mp2,dca,dts", "VideoCodec": "h264,hevc,vp8,vp9,mpeg,mpeg2video", "Type": "Video", "$type": "DirectPlayProfile"}, {"Container": "aac,mp3,mpa,flac,wav,wma,mp2,ogg,oga,webma,ape,opus", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "jpg,jpeg,png,gif,webp", "AudioCodec": null, "VideoCodec": null, "Type": "Photo", "$type": "DirectPlayProfile"}], "TranscodingProfiles": [{"Container": "mkv", "Type": "Video", "VideoCodec": "h264", "AudioCodec": "ac3,aac,mp3", "Protocol": "", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": true, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": null, "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "mp3", "Type": "Audio", "VideoCodec": "", "AudioCodec": "mp3", "Protocol": "", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": null, "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}], "ContainerProfiles": [], "CodecProfiles": [{"Type": "Video", "Conditions": [{"Condition": "EqualsAny", "Property": "VideoProfile", "Value": "high|main|baseline|constrained baseline", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "LessThanEqual", "Property": "VideoLevel", "Value": "51", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "h264", "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "LessThanEqual", "Property": "RefFrames", "Value": "12", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [{"Condition": "GreaterThanEqual", "Property": "Width", "Value": "1200", "IsRequired": false, "$type": "ProfileCondition"}], "Codec": "h264", "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "LessThanEqual", "Property": "RefFrames", "Value": "4", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [{"Condition": "GreaterThanEqual", "Property": "Width", "Value": "1900", "IsRequired": false, "$type": "ProfileCondition"}], "Codec": "h264", "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "NotEquals", "Property": "VideoProfile", "Value": "none", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "hevc", "Container": null, "$type": "CodecProfile"}, {"Type": "VideoAudio", "Conditions": [{"Condition": "LessThanEqual", "Property": "AudioChannels", "Value": "6", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": null, "Container": null, "$type": "CodecProfile"}], "ResponseProfiles": [], "SubtitleProfiles": [{"Format": "srt", "Method": "External", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "srt", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "subrip", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ass", "Method": "Encode", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ssa", "Method": "Encode", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "pgs", "Method": "Encode", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "pgssub", "Method": "Encode", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "dvdsub", "Method": "Encode", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "vtt", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "sub", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "idx", "Method": "Embed", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}], "$type": "DeviceProfile"}
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for matt. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-ExoPlayer, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-ExoPlayer, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Bitrate exceeds DirectStream limit: media bitrate: 4412583, max bitrate: 1400253
[15:00:07] [INF] [122] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: AndroidTV-ExoPlayer, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: False
[15:00:07] [INF] [45] Jellyfin.Api.Helpers.TranscodingJobHelper: /usr/lib/jellyfin-ffmpeg/ffmpeg -f matroska,webm -i file:"/media/TV/Severance/Season 1/Severance.S01E01.mkv" -map 0:0 -map 0:1 -map -0:s -codec:v:0 libx264 -force_key_frames "expr:gte(t,n_forced*5)" -vf "scale=trunc(min(max(iw\,ih*dar)\,720)/2)*2:trunc(ow/dar/2)*2,setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709" -copyts -avoid_negative_ts disabled -start_at_zero -pix_fmt yuv420p -preset superfast -crf 23 -maxrate 1016253 -bufsize 2032506 -profile:v:0 high -level 41 -x264opts:0 subme=0:me_range=4:rc_lookahead=10:me=dia:no_chroma_me:8x8dct=0:partitions=none -vsync -1 -map_metadata -1 -map_chapters -1 -threads 0 -codec:a:0 ac3 -ac 6 -ab 384000 -y "/config/transcodes/86de14434e5c664178655d3a77baed21.mkv"
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
Opening in BLOCKING MODE
875967048
842091865
Opening in BLOCKING MODE
Opening in BLOCKING MODE
875967048
842091865
[15:00:12] [WRN] [41] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/stream.mkv?DeviceId=9366926a67e0d06bcfe8bfdc99bc7f965aa0687e&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=ac3,aac,mp3&AudioStreamIndex=1&VideoBitrate=1016253&AudioBitrate=384000&PlaySessionId=1da7c32359414de8806990cc4d9f5b95&api_key=ff687020790f4c1d87c46bb75eac0964&CopyTimestamps=true&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&h264-maxrefframes=12&ac3-audiochannels=6&aac-audiochannels=6&mp3-audiochannels=6&TranscodeReasons=ContainerBitrateExceedsLimit&allowVideoStreamCopy=false&allowAudioStreamCopy=false&allowAudioStreamCopy=false to 192.168.1.101 in 0:00:04.8125706 with Status Code 200
[15:00:19] [INF] [101] Jellyfin.Api.Helpers.TranscodingJobHelper: Stopping ffmpeg process with q command for /config/transcodes/86de14434e5c664178655d3a77baed21.mkv
[15:00:20] [ERR] [101] Jellyfin.Api.Helpers.TranscodingJobHelper: FFmpeg exited with code 139
[15:00:20] [INF] [101] Jellyfin.Api.Helpers.TranscodingJobHelper: Deleting partial stream file(s) /config/transcodes/86de14434e5c664178655d3a77baed21.mkv
[15:00:22] [INF] [41] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app Android TV 0.12.3 playing Good News About Hell. Stopped at 5135 ms
[15:00:22] [WRN] [41] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Sessions/Playing/Stopped to 192.168.1.101 in 0:00:03.4573286 with Status Code 204

It only happens when transcoding this video becuase it works on my desktop using the browser and I get this log:

[15:01:58] [INF] [103] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for matt has succeeded.
[15:01:58] [INF] [103] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user matt: 2/0
[15:01:58] [INF] [103] Emby.Server.Implementations.Session.SessionManager: Creating new access token for user bce332e1-2ff5-4c84-ac64-a6032b024a6a
[15:01:59] [WRN] [103] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Users/authenticatebyname to 192.168.1.103 in 0:00:00.752396 with Status Code 200
[15:01:59] [INF] [62] Emby.Server.Implementations.HttpServer.WebSocketManager: WS 192.168.1.103 request
[15:02:00] [WRN] [58] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/c41740b2d93ad4c944b07278fbc06dcf/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=def3eff6b93e35c43a1a77b1c67bb416 to 192.168.1.103 in 0:00:00.6560097 with Status Code 200
[15:02:00] [WRN] [58] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/279d1eadb338e57096c4a2b80c626bee/Images/Primary?fillHeight=335&fillWidth=223&quality=96&tag=7e8b6b4c0906cba1b06a1055bf4acb62 to 192.168.1.103 in 0:00:00.6337082 with Status Code 200
[15:02:00] [WRN] [104] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/6a721dc0fd05ebfd949761f490b185c4/Images/Primary?fillHeight=335&fillWidth=223&quality=96&tag=f52428fdb43aa18cd0d17944469d99aa to 192.168.1.103 in 0:00:00.8638928 with Status Code 200
[15:02:01] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/f72e9ce532bdff201a6cd859aeda30a8/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=d701678d9ddf431be75b420fc6b0ce5a to 192.168.1.103 in 0:00:02.4268139 with Status Code 200
[15:02:02] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/2476d555ebfd0ac55ecb878839b0b4a4/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=9c7d21ffb18c9e1e2aea3786441127f6 to 192.168.1.103 in 0:00:00.7314507 with Status Code 200
[15:02:02] [WRN] [103] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/556a0a953baad0f385ccbbcaa73ac839/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=48a57942c3f82b92bdcf62b191579d54 to 192.168.1.103 in 0:00:03.1681946 with Status Code 200
[15:02:03] [WRN] [104] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/556a0a953baad0f385ccbbcaa73ac839/Images/Primary?fillHeight=335&fillWidth=223&quality=96&tag=d92fafae8f870c854044d1bacc2ecde7 to 192.168.1.103 in 0:00:00.5030415 with Status Code 200
[15:02:04] [WRN] [58] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/7e0410d54beb56e3afb24607f31ae682/Images/Primary?fillHeight=335&fillWidth=223&quality=96&tag=39adf4acfd6626f0c3c8917f00541852 to 192.168.1.103 in 0:00:04.3194498 with Status Code 200
[15:02:04] [WRN] [58] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/6841e0d6fa7ea7a6d7643ec49e52cd95/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=a42af5cf31b55736223450c5ba31be4b to 192.168.1.103 in 0:00:02.6178795 with Status Code 200
[15:02:04] [WRN] [23] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Items/2f00f886b6af401e121a68d01c68b323/Images/Backdrop?fillHeight=200&fillWidth=355&quality=96&tag=dc8dea4f0ffb3f811b94abacde8bc132 to 192.168.1.103 in 0:00:02.9727994 with Status Code 200
[15:02:04] [INF] [111] Jellyfin.Api.Controllers.MediaInfoController: GetPostedPlaybackInfo profile: {"Name": null, "Id": null, "Identification": null, "FriendlyName": null, "Manufacturer": null, "ManufacturerUrl": null, "ModelName": null, "ModelDescription": null, "ModelNumber": null, "ModelUrl": null, "SerialNumber": null, "EnableAlbumArtInDidl": false, "EnableSingleAlbumArtLimit": false, "EnableSingleSubtitleLimit": false, "SupportedMediaTypes": "Audio,Photo,Video", "UserId": null, "AlbumArtPn": null, "MaxAlbumArtWidth": null, "MaxAlbumArtHeight": null, "MaxIconWidth": null, "MaxIconHeight": null, "MaxStreamingBitrate": 120000000, "MaxStaticBitrate": 100000000, "MusicStreamingTranscodingBitrate": 384000, "MaxStaticMusicBitrate": 8000000, "SonyAggregationFlags": null, "ProtocolInfo": null, "TimelineOffsetSeconds": 0, "RequiresPlainVideoItems": false, "RequiresPlainFolders": false, "EnableMSMediaReceiverRegistrar": false, "IgnoreTranscodeByteRangeRequests": false, "XmlRootAttributes": [], "DirectPlayProfiles": [{"Container": "webm", "AudioCodec": "vorbis,opus", "VideoCodec": "vp8,vp9,av1", "Type": "Video", "$type": "DirectPlayProfile"}, {"Container": "mp4,m4v", "AudioCodec": "aac,mp3,opus,flac,vorbis", "VideoCodec": "h264,vp8,vp9,av1", "Type": "Video", "$type": "DirectPlayProfile"}, {"Container": "mov", "AudioCodec": "aac,mp3,opus,flac,vorbis", "VideoCodec": "h264", "Type": "Video", "$type": "DirectPlayProfile"}, {"Container": "opus", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "webm", "AudioCodec": "opus", "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "mp3", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "aac", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "m4a", "AudioCodec": "aac", "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "m4b", "AudioCodec": "aac", "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "flac", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "webma", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "webm", "AudioCodec": "webma", "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "wav", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}, {"Container": "ogg", "AudioCodec": null, "VideoCodec": null, "Type": "Audio", "$type": "DirectPlayProfile"}], "TranscodingProfiles": [{"Container": "ts", "Type": "Audio", "VideoCodec": "", "AudioCodec": "aac", "Protocol": "hls", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 1, "SegmentLength": 0, "BreakOnNonKeyFrames": true, "$type": "TranscodingProfile"}, {"Container": "aac", "Type": "Audio", "VideoCodec": "", "AudioCodec": "aac", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "mp3", "Type": "Audio", "VideoCodec": "", "AudioCodec": "mp3", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "opus", "Type": "Audio", "VideoCodec": "", "AudioCodec": "opus", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "wav", "Type": "Audio", "VideoCodec": "", "AudioCodec": "wav", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "opus", "Type": "Audio", "VideoCodec": "", "AudioCodec": "opus", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Static", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "mp3", "Type": "Audio", "VideoCodec": "", "AudioCodec": "mp3", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Static", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "aac", "Type": "Audio", "VideoCodec": "", "AudioCodec": "aac", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Static", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "wav", "Type": "Audio", "VideoCodec": "", "AudioCodec": "wav", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Static", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "ts", "Type": "Video", "VideoCodec": "h264", "AudioCodec": "aac,mp3", "Protocol": "hls", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 1, "SegmentLength": 0, "BreakOnNonKeyFrames": true, "$type": "TranscodingProfile"}, {"Container": "webm", "Type": "Video", "VideoCodec": "vp8,vp9,av1,vpx", "AudioCodec": "vorbis,opus", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Streaming", "EnableSubtitlesInManifest": false, "MaxAudioChannels": "6", "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}, {"Container": "mp4", "Type": "Video", "VideoCodec": "h264", "AudioCodec": "aac,mp3,opus,flac,vorbis", "Protocol": "http", "EstimateContentLength": false, "EnableMpegtsM2TsMode": false, "TranscodeSeekInfo": "Auto", "CopyTimestamps": false, "Context": "Static", "EnableSubtitlesInManifest": false, "MaxAudioChannels": null, "MinSegments": 0, "SegmentLength": 0, "BreakOnNonKeyFrames": false, "$type": "TranscodingProfile"}], "ContainerProfiles": [], "CodecProfiles": [{"Type": "VideoAudio", "Conditions": [{"Condition": "Equals", "Property": "IsSecondaryAudio", "Value": "false", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "aac", "Container": null, "$type": "CodecProfile"}, {"Type": "VideoAudio", "Conditions": [{"Condition": "Equals", "Property": "IsSecondaryAudio", "Value": "false", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": null, "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "NotEquals", "Property": "IsAnamorphic", "Value": "true", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "EqualsAny", "Property": "VideoProfile", "Value": "high|main|baseline|constrained baseline|high 10", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "LessThanEqual", "Property": "VideoLevel", "Value": "52", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "NotEquals", "Property": "IsInterlaced", "Value": "true", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "h264", "Container": null, "$type": "CodecProfile"}, {"Type": "Video", "Conditions": [{"Condition": "NotEquals", "Property": "IsAnamorphic", "Value": "true", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "EqualsAny", "Property": "VideoProfile", "Value": "main", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "LessThanEqual", "Property": "VideoLevel", "Value": "120", "IsRequired": false, "$type": "ProfileCondition"}, {"Condition": "NotEquals", "Property": "IsInterlaced", "Value": "true", "IsRequired": false, "$type": "ProfileCondition"}], "ApplyConditions": [], "Codec": "hevc", "Container": null, "$type": "CodecProfile"}], "ResponseProfiles": [{"Container": "m4v", "AudioCodec": null, "VideoCodec": null, "Type": "Video", "OrgPn": null, "MimeType": "video/mp4", "Conditions": [], "$type": "ResponseProfile"}], "SubtitleProfiles": [{"Format": "vtt", "Method": "External", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ass", "Method": "External", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}, {"Format": "ssa", "Method": "External", "DidlMode": null, "Language": null, "Container": null, "$type": "SubtitleProfile"}], "$type": "DeviceProfile"}
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for matt. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: Unknown Profile, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: unknown profile for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: Unknown Profile, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: unknown profile for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Profile: Unknown Profile, Path: /media/TV/Severance/Season 1/Severance.S01E01.mkv, isEligibleForDirectPlay: True, isEligibleForDirectStream: True
[15:02:05] [INF] [111] Jellyfin.Api.Helpers.MediaInfoHelper: Container: mkv,webm, Video: h264, Audio: eac3 cannot be direct played by profile: unknown profile for path: /media/TV/Severance/Season 1/Severance.S01E01.mkv
[15:02:05] [INF] [23] Jellyfin.Api.Controllers.DynamicHlsController: Current HLS implementation doesnt support non-keyframe breaks but one is requested, ignoring that request
[15:02:05] [INF] [23] Jellyfin.Api.Helpers.TranscodingJobHelper: /usr/lib/jellyfin-ffmpeg/ffmpeg -fflags +genpts -f matroska,webm -i file:"/media/TV/Severance/Season 1/Severance.S01E01.mkv" -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 copy -bsf:v h264_mp4toannexb -start_at_zero -vsync -1 -codec:a:0 aac -ac 6 -ab 640000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 6 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/transcodes/39591c8a725a245c731e35ed3e20f5f4%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/transcodes/39591c8a725a245c731e35ed3e20f5f4.m3u8"
[15:02:12] [WRN] [30] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/0.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:06.5052982 with Status Code 200
[15:02:13] [WRN] [92] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Sessions/Playing/Progress to 192.168.1.103 in 0:00:00.7072706 with Status Code 204
[15:02:13] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Sessions/Playing to 192.168.1.103 in 0:00:00.9045571 with Status Code 204
[15:02:14] [WRN] [62] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/1.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:02.5591249 with Status Code 200
[15:02:16] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/2.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:02.1133206 with Status Code 200
[15:02:19] [WRN] [121] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/3.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:02.3127499 with Status Code 200
[15:02:20] [WRN] [58] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/4.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:01.3207155 with Status Code 200
[15:02:22] [WRN] [92] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/5.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:01.7167299 with Status Code 200
[15:02:22] [INF] [50] Jellyfin.Api.Helpers.TranscodingJobHelper: Stopping ffmpeg process with q command for /config/transcodes/39591c8a725a245c731e35ed3e20f5f4.m3u8
[15:02:23] [INF] [50] Jellyfin.Api.Helpers.TranscodingJobHelper: FFmpeg exited with code 0
[15:02:23] [INF] [50] Jellyfin.Api.Helpers.TranscodingJobHelper: Deleting partial stream file(s) /config/transcodes/39591c8a725a245c731e35ed3e20f5f4.m3u8
[15:02:23] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/videos/f7602c78-a73d-a8cb-d62b-4a9a74d7d18a/hls1/main/6.ts?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzk5LjAuNDg0NC43NCBTYWZhcmkvNTM3LjM2fDE2NDc3MDIxMTUyNDQ1&MediaSourceId=f7602c78a73da8cbd62b4a9a74d7d18a&VideoCodec=h264&AudioCodec=aac,mp3&AudioStreamIndex=1&VideoBitrate=139360000&AudioBitrate=640000&PlaySessionId=fdc3b1a0c6944083a253c603a51e8bdf&api_key=5045484f2b7e4d82911ce586610f1673&SubtitleMethod=Encode&TranscodingMaxAudioChannels=6&RequireAvc=false&Tag=69f27e8708bb4d6a20b9e53c0e8cd39d&SegmentContainer=ts&MinSegments=1&BreakOnNonKeyFrames=True&h264-profile=high,main,baseline,constrainedbaseline,high10&h264-level=52&h264-deinterlace=true&TranscodeReasons=VideoCodecNotSupported,AudioCodecNotSupported to 192.168.1.103 in 0:00:00.7697376 with Status Code 200
[15:02:24] [INF] [50] Emby.Server.Implementations.Session.SessionManager: Playback stopped reported by app Jellyfin Web 10.8.0 playing Good News About Hell. Stopped at 8223 ms
[15:02:24] [WRN] [50] Jellyfin.Server.Middleware.ResponseTimeMiddleware: Slow HTTP Response from http://192.168.1.113:8096/Sessions/Playing/Stopped to 192.168.1.103 in 0:00:02.2417985 with Status Code 204

Here is the ffprobe:

$ ffprobe Severance.S01E01.mkv
ffprobe version 174ed00 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --enable-nvmpi
  WARNING: library configuration mismatch
  avutil      configuration: --enable-shared --enable-libx264 --enable-gpl
  avcodec     configuration: --enable-shared --enable-libx264 --enable-gpl
  avformat    configuration: --enable-shared --enable-libx264 --enable-gpl
  avdevice    configuration: --enable-shared --enable-libx264 --enable-gpl
  avfilter    configuration: --enable-shared --enable-libx264 --enable-gpl
  swscale     configuration: --enable-shared --enable-libx264 --enable-gpl
  swresample  configuration: --enable-shared --enable-libx264 --enable-gpl
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
Input #0, matroska,webm, from 'Severance.S01E01.720p.WEB.h264-KOGi[rartv].mkv':
  Metadata:
    encoder         : libebml v1.4.2 + libmatroska v1.6.4
  Duration: 00:57:14.75, start: 0.000000, bitrate: 3644 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1482x620 [SAR 1:1 DAR 741:310], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      BPS             : 2870049
      DURATION        : 00:57:14.723000000
      NUMBER_OF_FRAMES: 82351
      NUMBER_OF_BYTES : 1232228208
      _STATISTICS_WRITING_APP: mkvmerge v64.0.0 ('Willows') 64-bit
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(eng): Audio: eac3, 48000 Hz, 6 channels, fltp (default)
........... (cut out meta data of subtitles)

I can confirm it's using both NVENC and NVDEC:

image

@cvium would you (or anyone else contributing to jellyfin) be able to help sort out why this is going wrong, or some steps to debug? I'm not that familiar with ffmpeg. I'll t

@mattangus
Hi, I've encountered probably same issue, I got the video just like your photo.
I'm using your docker image on jetson nano 2GB model.
This issue occured when I used Jellyfin Media Player on Windows 10.

The original video is 1080p I manually set the playback video quallity to 480p 1.5Mbps for the test.
And I got the broken green screen just like your photo.

jellyfin_bug

If I play the video 1080p, 720p, or 480p 3Mbps it was fine.

I can also reproduce this issue with windows 11 laptop and another 1080p video file.
This only happens on 480p 1.5Mbps so far. 480p 3Mbps is fine.

I think it might be the jetson-ffmpeg issue(not sure).
I found some pull requests on https://github.com/jocover/jetson-ffmpeg/pulls that are saying they fixed some issues.
Maybe these could fix this issue.

I also found a fork of jetson-ffmpeg that merged some of those pull requests.
https://github.com/HunterAP23/jetson-ffmpeg/commits/master

This one looks good to test if those pull requests can fix the issue. I'll test it lator.

@pjueon
Copy link

pjueon commented Mar 26, 2022

@LinusCDE @mattangus

I'm trying to rebuild the docker image and I found that the docker file seems like using mattangus/jetson-ffmpeg.

Could you help me to rebuild jetson-ffmpeg image for the jellyfin with this fork?
https://github.com/HunterAP23/jetson-ffmpeg/commits/master

I'm new to both docker and jetson-ffmpeg, so I have no idea how to do this.

@pjueon
Copy link

pjueon commented Mar 26, 2022

Thank you for the amazing work! Here's my test result so far.

using mattangus/jellyfin-jetson with Jetson Nano 2GB
(jetpack 4.5.1)

In most case, it works great.

  • I can see nvenc/nvdec is acivated while playing videos. And CPU usage is about 50~70%.

  • For some video files, nvenc/nvdec is off and all 4 CPU cores are almost 100%.
    I assume that hw acceleration is not supported for some formats.

Here are the issues I have right now.

  1. The server freezes and stops responsing right after the media scan completed.
    On jtop, I can see 1 CPU core is used 100%.
    To make the server work again, I need to restart the docker container.

  2. I'm not sure if it's related, I can see some ffmpeg errors in the log while the media scan.
    Looks like errors from extracting thumbnail image from the videos with ffmpeg.

[2022-03-26 03:26:59.497 +00:00] [INF] [30] Emby.Server.Implementations.ScheduledTasks.TaskManager: Executing "Scan Media Library"
[2022-03-26 03:26:59.506 +00:00] [INF] [30] Emby.Server.Implementations.Library.LibraryManager: Validating media library
[2022-03-26 03:27:17.363 +00:00] [ERR] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for "file:\"/data/videos/TV 애니메이션/Vivy - Fluorite Eye's Song/Season 00/EP013.5_総集編.mkv\""
[2022-03-26 03:27:17.367 +00:00] [ERR] [6] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: I-frame image extraction failed, will attempt standard way. Input: "file:\"/data/videos/TV 애니메이션/Vivy - Fluorite Eye's Song/Season 00/EP013.5_総集編.mkv\""
MediaBrowser.Common.FfmpegException: ffmpeg image extraction failed for file:"/data/videos/TV 애니메이션/Vivy - Fluorite Eye's Song/Season 00/EP013.5_総集編.mkv"
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, Nullable`1 threedFormat, Nullable`1 offset, Boolean useIFrame, Nullable`1 targetFormat, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String inputFile, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, MediaSourceInfo mediaSource, Boolean isAudio, Nullable`1 threedFormat, Nullable`1 offset, Nullable`1 targetFormat, CancellationToken cancellationToken)
[2022-03-26 03:27:18.369 +00:00] [ERR] [40] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for "file:\"/data/videos/TV 애니메이션/Vivy - Fluorite Eye's Song/Season 00/EP013.5_総集編.mkv\""
[2022-03-26 03:27:18.378 +00:00] [ERR] [40] MediaBrowser.Providers.TV.EpisodeMetadataService: Error in "Embedded Image Extractor"
MediaBrowser.Common.FfmpegException: ffmpeg image extraction failed for file:"/data/videos/TV 애니메이션/Vivy - Fluorite Eye's Song/Season 00/EP013.5_総集編.mkv"
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, Nullable`1 threedFormat, Nullable`1 offset, Boolean useIFrame, Nullable`1 targetFormat, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String inputFile, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, MediaSourceInfo mediaSource, Boolean isAudio, Nullable`1 threedFormat, Nullable`1 offset, Nullable`1 targetFormat, CancellationToken cancellationToken)
   at MediaBrowser.Providers.MediaInfo.EmbeddedImageProvider.ExtractAttachment(Video item, MediaAttachment attachmentStream, MediaSourceInfo mediaSource, CancellationToken cancellationToken)
   at MediaBrowser.Providers.MediaInfo.EmbeddedImageProvider.GetEmbeddedImage(Video item, ImageType type, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.ItemImageProvider.RefreshFromProvider(BaseItem item, IDynamicImageProvider provider, ImageRefreshOptions refreshOptions, TypeOptions savedOptions, ICollection`1 downloadedImages, RefreshResult result, CancellationToken cancellationToken)
[2022-03-26 03:27:19.027 +00:00] [ERR] [11] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for "file:\"/data/videos/TV 애니메이션/Vivy - Fluorite Eye's Song/Season 00/EP013.5_総集編.mkv\""
[2022-03-26 03:27:19.028 +00:00] [ERR] [11] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: I-frame image extraction failed, will attempt standard way. Input: "file:\"/data/videos/TV 애니메이션/Vivy - Fluorite Eye's Song/Season 00/EP013.5_総集編.mkv\""
MediaBrowser.Common.FfmpegException: ffmpeg image extraction failed for file:"/data/videos/TV 애니메이션/Vivy - Fluorite Eye's Song/Season 00/EP013.5_総集編.mkv"
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, Nullable`1 threedFormat, Nullable`1 offset, Boolean useIFrame, Nullable`1 targetFormat, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String inputFile, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, MediaSourceInfo mediaSource, Boolean isAudio, Nullable`1 threedFormat, Nullable`1 offset, Nullable`1 targetFormat, CancellationToken cancellationToken)
[2022-03-26 03:27:19.666 +00:00] [ERR] [43] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for "file:\"/data/videos/TV 애니메이션/Vivy - Fluorite Eye's Song/Season 00/EP013.5_総集編.mkv\""
[2022-03-26 03:27:19.670 +00:00] [ERR] [43] MediaBrowser.Providers.TV.EpisodeMetadataService: Error in "Screen Grabber"
MediaBrowser.Common.FfmpegException: ffmpeg image extraction failed for file:"/data/videos/TV 애니메이션/Vivy - Fluorite Eye's Song/Season 00/EP013.5_総集編.mkv"
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, Nullable`1 threedFormat, Nullable`1 offset, Boolean useIFrame, Nullable`1 targetFormat, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String inputFile, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, MediaSourceInfo mediaSource, Boolean isAudio, Nullable`1 threedFormat, Nullable`1 offset, Nullable`1 targetFormat, CancellationToken cancellationToken)
   at MediaBrowser.Providers.MediaInfo.VideoImageProvider.GetVideoImage(Video item, CancellationToken cancellationToken)
   at MediaBrowser.Providers.Manager.ItemImageProvider.RefreshFromProvider(BaseItem item, IDynamicImageProvider provider, ImageRefreshOptions refreshOptions, TypeOptions savedOptions, ICollection`1 downloadedImages, RefreshResult result, CancellationToken cancellationToken)
[2022-03-26 03:27:37.761 +00:00] [INF] [24] Jellyfin.Server.Implementations.Users.UserManager: Authentication request for "jueony" has succeeded.
[2022-03-26 03:27:37.764 +00:00] [INF] [24] Emby.Server.Implementations.Session.SessionManager: Current/Max sessions for user "jueony": 0/0
[2022-03-26 03:27:37.830 +00:00] [INF] [39] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Killing ffmpeg process
[2022-03-26 03:27:37.835 +00:00] [ERR] [39] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: ffmpeg image extraction failed for "file:\"/data/videos/TV 애니메이션/SHIROBAKO/Season 00/OVA02_『第三飛行少女隊』第1話.mkv\""
[2022-03-26 03:27:37.850 +00:00] [ERR] [39] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: I-frame image extraction failed, will attempt standard way. Input: "file:\"/data/videos/TV 애니메이션/SHIROBAKO/Season 00/OVA02_『第三飛行少女隊』第1話.mkv\""
MediaBrowser.Common.FfmpegException: ffmpeg image extraction failed for file:"/data/videos/TV 애니메이션/SHIROBAKO/Season 00/OVA02_『第三飛行少女隊』第1話.mkv"
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImageInternal(String inputPath, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, Nullable`1 threedFormat, Nullable`1 offset, Boolean useIFrame, Nullable`1 targetFormat, CancellationToken cancellationToken)
   at MediaBrowser.MediaEncoding.Encoder.MediaEncoder.ExtractImage(String inputFile, String container, MediaStream videoStream, Nullable`1 imageStreamIndex, MediaSourceInfo mediaSource, Boolean isAudio, Nullable`1 threedFormat, Nullable`1 offset, Nullable`1 targetFormat, CancellationToken cancellationToken)

Theses videos are extras/special videos so probably jellyfin couldn't find any episode thumbnails for them,
and trying to extract from the video.
This issue is only in the log, the episode thumbnails looks fine after the media scan and restart.

  1. As I posted earlier, if I set the video quality to 480p 1.5Mbps, I got the broken green screen
    The input video file is 1080p, and I'm playing it with Jellyfin Media Player on Windows 10/11.

jellyfin_bug

  1. I tried to build the server from the latest source.
    I pulled the latest master branch and added scripts/ffmpeg-jetson-wrapper, Dockerfile.arm64-jetson files.
    When I tried to build I got the dotnet version error, so I changed DOTNET_VERSION=5.0 to DOTNET_VERSION=6.0 in the dockerfile. And I could build the image.

With the built image, I could install the tvdb plugin.
But after I run the media scan the server freezed as I described in 1.
And in this time, even if I restart the docker image the server didn't response and could not use it at all.

@pjueon
Copy link

pjueon commented Mar 27, 2022

Ok, I found a way to make the jellyfin serve not freeze after scan.
I disabled monitoring the directory option when I added a library and then the server doesn't freeze.

It seems like monitoring the directory makes my jellyfin server freeze.
I'm not sure if this is the original jellyfin's issue or not.

@pjueon
Copy link

pjueon commented Mar 29, 2022

Is the hw acceleration not supported for 10 bit videos?

@LinusCDE
Copy link

LinusCDE commented Mar 29, 2022

Is the hw acceleration not supported for 10 bit videos?

I mentioned the help output of the encoders here.

Supported pixel formats: yuv420p

I'm not into hdr stuff yet, but yuv420p should not include 10-bit pixel formats afaik.

Edit: However, it should be doable to use sw decoding when the pixel format isn't supported. In that case, we could probably at least downsample 10-bit files to play them at all. There is not much benefit in HW decoding speed when only person is using it (at least on the Xavier agx 8 core cpu). So in that case, not using HW Decode shouldn't be a performance problem.

@pjueon
Copy link

pjueon commented Mar 30, 2022

Thanks for the reply.
I tested 1080p HEVC SDR YUV444p10le video, and only NVENC was activated and NVDEC was off(and all four of CPU cores were used almost 100%).

As you said, it seems like the hw decoding is not supported some of pixel formats.
Is this some kind of hw limitation, or just a sw issue(not implemented yet, etc)?

Another question.
From my log, I can see that some GPU-related features are not available.

[2022-03-30 12:12:09.200 +00:00] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available filters: []
[2022-03-30 12:12:09.299 +00:00] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "scale_cuda" with option "Output format (default \"same\")" is not available
[2022-03-30 12:12:09.399 +00:00] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "tonemap_cuda" with option "GPU accelerated HDR to SDR tonemapping" is not available
[2022-03-30 12:12:09.494 +00:00] [WRN] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Filter: "tonemap_opencl" with option "bt2390" is not available
[2022-03-30 12:12:09.596 +00:00] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: Available hwaccel types: ["vdpau", "vaapi"]
[2022-03-30 12:12:09.695 +00:00] [INF] [1] MediaBrowser.MediaEncoding.Encoder.MediaEncoder: FFmpeg: "/usr/bin/ffmpeg-jetson-wrapper"

I thought we can use cuda features because the cuda runtime is available on Jetson.
Is there any method to enable these features? I think it would be cool if we can fully use the Jetson's HW acceleration.

@LinusCDE
Copy link

As you said, it seems like the hw decoding is not supported some of pixel formats.
Is this some kind of hw limitation, or just a sw issue(not implemented yet, etc)?

I would say it's a bit of both. jetson-ffmpeg doesn't seem to include all possible formats as nvidias own decoder supports a pixel format called nv12 as well:

ffmpeg -h decoder=h264_nvv4l2dec
ffmpeg version n4.4.1-5-g70c6dd2fff Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --disable-debug --disable-stripping --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-version3 --enable-nvmpi --enable-nvv4l2dec --enable-libv4l2 --enable-shared --extra-libs='-L/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils' --extra-cflags='-I /usr/src/jetson_multimedia_api/include/'
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Decoder h264_nvv4l2dec [h264 (nvv4l2dec)]:
    General capabilities: delay avoidprobe hardware 
    Threading capabilities: none
    Supported pixel formats: yuv420p nv12

I would guess that they would at least try to include more if possible, but their focus seems to be more on gstreamer.

From their standpoint I also doubt, better pixel formats would make sense, as the jetson devices are meant to process camera footage and process those with AI models. I don't see how HDR would fit in their usecase and it would only make the hardware decoders more expensive for no reason.

@LinusCDE
Copy link

I thought we can use cuda features because the cuda runtime is available on Jetson.
Is there any method to enable these features? I think it would be cool if we can fully use the Jetson's HW acceleration.

I can try to include them, as I already have a working, hacky ffmpeg build. I'm not really deep into cuda or the ffmpeg codebase though, so no guarantees.

@LinusCDE
Copy link

@pjueon Regarding the cuda stuff. Probably won't work. Seems that "cuda" is tied to nvidia's "nvcodec" in ffmpeg. I managed to add support to it when follwing most of the instructions from this post (namely installing the nv-codec-headers and adding the --enable-cuda flag to configure).

It built succesfully and displays certain encoders I thought impossible on the Jetson:

Output when looking for de/encoders with "nv" and "cuda" in the names
$ ffmpeg -decoders | grep nv                                                                                                                                                    1 ↵
ffmpeg version n4.4.1-7-g911d118cde Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --disable-debug --disable-stripping --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-version3 --enable-nvmpi --enable-cuda --enable-nvv4l2dec --enable-libv4l2 --enable-shared --extra-libs='-L/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils' --extra-cflags='-I /usr/src/jetson_multimedia_api/include/'
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
 V....D dsicinvideo          Delphine Software International CIN video
 V..... h264_nvmpi           h264 (nvmpi) (codec h264)
 V..... h264_nvv4l2dec       h264 (nvv4l2dec) (codec h264)
 V..... hevc_nvmpi           hevc (nvmpi) (codec hevc)
 V..... hevc_nvv4l2dec       hevc (nvv4l2dec) (codec hevc)
 V....D idcinvideo           id Quake II CIN video (codec idcin)
 V..... mpeg2_nvmpi          mpeg2 (nvmpi) (codec mpeg2video)
 V..... mpeg2_nvv4l2dec      mpeg2 (nvv4l2dec) (codec mpeg2video)
 V..... mpeg4_nvmpi          mpeg4 (nvmpi) (codec mpeg4)
 V..... mpeg4_nvv4l2dec      mpeg4 (nvv4l2dec) (codec mpeg4)
 V..... vp8_nvmpi            vp8 (nvmpi) (codec vp8)
 V..... vp8_nvv4l2dec        vp8 (nvv4l2dec) (codec vp8)
 V..... vp9_nvmpi            vp9 (nvmpi) (codec vp9)
 V..... vp9_nvv4l2dec        vp9 (nvv4l2dec) (codec vp9)
 V....D wnv1                 Winnov WNV1
 A....D twinvq               VQF TwinVQ

$ ffmpeg -encoders | grep nv
ffmpeg version n4.4.1-7-g911d118cde Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --disable-debug --disable-stripping --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-version3 --enable-nvmpi --enable-cuda --enable-nvv4l2dec --enable-libv4l2 --enable-shared --extra-libs='-L/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils' --extra-cflags='-I /usr/src/jetson_multimedia_api/include/'
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
 V....D h264_nvenc           NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc                NVIDIA NVENC H.264 encoder (codec h264)
 V..... nvenc_h264           NVIDIA NVENC H.264 encoder (codec h264)
 V..... h264_nvmpi           nvmpi H.264 encoder wrapper (codec h264)
 V..... nvenc_hevc           NVIDIA NVENC hevc encoder (codec hevc)
 V....D hevc_nvenc           NVIDIA NVENC hevc encoder (codec hevc)
 V..... hevc_nvmpi           nvmpi HEVC encoder wrapper (codec hevc)

$ ffmpeg -decoders | grep cuda                                                                                                                                                  1 ↵
ffmpeg version n4.4.1-7-g911d118cde Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --disable-debug --disable-stripping --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-version3 --enable-nvmpi --enable-cuda --enable-nvv4l2dec --enable-libv4l2 --enable-shared --extra-libs='-L/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils' --extra-cflags='-I /usr/src/jetson_multimedia_api/include/'
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100

$ ffmpeg -encoders | grep cuda
ffmpeg version n4.4.1-7-g911d118cde Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --disable-debug --disable-stripping --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-version3 --enable-nvmpi --enable-cuda --enable-nvv4l2dec --enable-libv4l2 --enable-shared --extra-libs='-L/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils' --extra-cflags='-I /usr/src/jetson_multimedia_api/include/'
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100

It seems to actually include the "nvenc" encoders, but using them fails:

$ ffmpeg -i jellyfish-3-mbps-hd-hevc-10bit.mkv -vcodec hevc_nvenc jellyfish-3-mbps-hd-hevc-10bit_hwreencode.mkv
ffmpeg version n4.4.1-7-g911d118cde Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --disable-debug --disable-stripping --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-version3 --enable-nvmpi --enable-cuda --enable-nvv4l2dec --enable-libv4l2 --enable-shared --extra-libs='-L/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils' --extra-cflags='-I /usr/src/jetson_multimedia_api/include/'
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, matroska,webm, from 'jellyfish-3-mbps-hd-hevc-10bit.mkv':
  Metadata:
    COMPATIBLE_BRANDS: iso4hvc1iso6
    MAJOR_BRAND     : iso4
    MINOR_VERSION   : 1
    ENCODER         : Lavf56.3.100
  Duration: 00:00:30.10, start: 0.067000, bitrate: 2986 kb/s
  Stream #0:0(und): Video: hevc (Main 10), yuv420p10le(tv), 1920x1080 [SAR 1:1 DAR 16:9], 29.97 fps, 29.97 tbr, 1k tbn, 29.97 tbc (default)
    Metadata:
      CREATION_TIME   : 2016-02-04 02:39:21
      LANGUAGE        : und
      HANDLER_NAME    : [email protected]
Stream mapping:
  Stream #0:0 -> #0:0 (hevc (native) -> hevc (hevc_nvenc))
Press [q] to stop, [?] for help
[hevc_nvenc @ 0x557eaa0790] Cannot load libnvidia-encode.so.1
[hevc_nvenc @ 0x557eaa0790] The minimum required Nvidia driver for nvenc is (unknown) or newer
Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height
Conversion failed!

The culprit seems to be the absense of libnvidia-encode.so.1 and this post stated in 2016:

We don’t have plan to support libnvidia-encode on Tegra series.

I doubt this will have changed.

Only possibility might be to somehow use cuda independant of the nvcodec libs. I have not looked into this, but I guess this will range from "just strip out the nvenc/nvdec stuff" to "a lot needs to be reimplemented that nvidia did in their libs for nvenc/nvdec".

@LinusCDE
Copy link

LinusCDE commented Apr 1, 2022

There seems to be a new/modified encoder that supports more pixel formats: jocover/jetson-ffmpeg#112

ffmpeg -h encoder=h264_nvv4l2
ffmpeg version n4.4-33-g1d0dbfb724 Copyright (c) 2000-2021 the FFmpeg developers                                                                                                      
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)                                                                                                                               
  configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --disable-debug --disable-stripping --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enab
le-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --e
nable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --
enable-version3 --enable-nvv4l2 --enable-libv4l2 --enable-shared --extra-libs='-L/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils' --extra-cflags='-I /usr/src/jetson_multimedia_api/include/'
  libavutil      56. 70.100 / 56. 70.100                                                                                                                                              
  libavcodec     58.134.100 / 58.134.100                                                                                                                                              
  libavformat    58. 76.100 / 58. 76.100                                                                                                                                              
  libavdevice    58. 13.100 / 58. 13.100                                                                                                                                              
  libavfilter     7.110.100 /  7.110.100                                                                                                                                              
  libswscale      5.  9.100 /  5.  9.100                                                                                                                                              
  libswresample   3.  9.100 /  3.  9.100                                                                                                                                              
  libpostproc    55.  9.100 / 55.  9.100                                                                                                                                              
Encoder h264_nvv4l2 [h264 NVV4L2 HW encoder for Tegra]:                                                                                                                               
    General capabilities: delay hardware                                                                                                                                              
    Threading capabilities: none                                                                                                                                                      
    Supported pixel formats: yuv420p yuv444p nv12 p010le
nvv4l2_h264_enc AVOptions:                                                                 
  -num_capture_buffers <int>        E..V....... Number of buffers in the capture context (from 1 to 32) (default 10)                                                                                                                           
  -profile           <int>        E..V....... Set the encoding profile (from 66 to 244) (default main)                                                                                                                                         
     baseline        66           E..V....... 
     main            77           E..V....... 
     high            100          E..V....... 
     high444         244          E..V....... 
  -level             <int>        E..V....... Profile Level (from 9 to 51) (default 5.1)
     1.0             10           E..V.......                                                                          
     1b              9            E..V.......                                                                          
     1.1             11           E..V.......                                                                          
     1.2             12           E..V.......                                                                          
     1.3             13           E..V.......                                                                          
     2.0             20           E..V.......                                                                          
     2.1             21           E..V.......                                                                          
     2.2             22           E..V.......                                                                          
     3.0             30           E..V.......                                                                          
     3.1             31           E..V.......                                                                          
     3.2             32           E..V.......                                                                          
     4.0             40           E..V.......                                                                          
     4.1             41           E..V.......                                                                          
     4.2             42           E..V.......                                                                          
     5.0             50           E..V.......                                                                          
     5.1             51           E..V.......                                                                          
  -lossless          <int>        E..V....... Enable lossless encoding (from 0 to 1) (default off)                                                                                                                                             
     off             0            E..V.......                                                                          
     on              1            E..V.......                                                                          
  -rc                <int>        E..V....... Override the preset rate-control (from 0 to 1) (default vbr)                                                                                                                                     
     cbr             0            E..V....... Constant bitrate mode                                                    
     vbr             1            E..V....... Variable bitrate mode                                                    
  -preset            <int>        E..V....... Set the encoding preset (from 1 to 4) (default default)                                                                                                                                          
     default         3            E..V.......                                                                          
     slow            4            E..V.......                                                                          
     medium          3            E..V.......                                                                          
     fast            2            E..V.......                                                                          
     ultrafast       1            E..V.......                                                                          
  -2pass             <int>        E..V....... Enable Two-Pass CBR. (Forces CBR). (from 0 to 1) (default 0)                                                                                                                                     

@pjueon The pixel format p010le seems especially interesting since it seems to be 10 bit compatible according to this comment

Edit: So far, it seems, while vp8 is mentioned in source code, I didn't manage to find them when compiled. The hevc encoder has a pretty similar help output and both decoders don't seem to support that 10 bit pixel format (yet?).

@pjueon
Copy link

pjueon commented Apr 5, 2022

Thanks for the info! Did you try that ffmpeg for jellyfin?

@LinusCDE
Copy link

LinusCDE commented Apr 5, 2022

Not yet. I supposed it might work a bit better. But I don't have anything that would take advantage of it.

It doesn't seem worth the hassle for me rn. Having support for smaller weird resolutions and general sw encoder stuff (afaik, jetson-ffmpeg doesn't intend to include sw coders in the default config). This is especially needed, if your format happens to be a ripped DVD or similar.

@pjueon
Copy link

pjueon commented Apr 14, 2022

@pjueon Regarding the cuda stuff. Probably won't work. Seems that "cuda" is tied to nvidia's "nvcodec" in ffmpeg. I managed to add support to it when follwing most of the instructions from this post (namely installing the nv-codec-headers and adding the --enable-cuda flag to configure).

It built succesfully and displays certain encoders I thought impossible on the Jetson:

Output when looking for de/encoders with "nv" and "cuda" in the names
It seems to actually include the "nvenc" encoders, but using them fails:

$ ffmpeg -i jellyfish-3-mbps-hd-hevc-10bit.mkv -vcodec hevc_nvenc jellyfish-3-mbps-hd-hevc-10bit_hwreencode.mkv
The culprit seems to be the absense of libnvidia-encode.so.1 and this post stated in 2016:

We don’t have plan to support libnvidia-encode on Tegra series.

I doubt this will have changed.

Only possibility might be to somehow use cuda independant of the nvcodec libs. I have not looked into this, but I guess this will range from "just strip out the nvenc/nvdec stuff" to "a lot needs to be reimplemented that nvidia did in their libs for nvenc/nvdec".

@LinusCDE
Is it possible to use cuda-related filters like scale_cuda, sclae_npp with your build?

@LinusCDE
Copy link

Is it possible to use cuda-related filters like scale_cuda, sclae_npp with your build?

Nope:

╰─$ ffmpeg -i canvas-frames2.mp4 -vf scale_cuda=8000:4000 canvas-frames2_testscale.mp4                                                                                            1 ↵
ffmpeg version n4.4.1-7-g911d118cde Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr/local --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --disable-debug --disable-stripping --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-version3 --enable-nvmpi --enable-cuda --enable-nvv4l2dec --enable-libv4l2 --enable-shared --extra-libs='-L/usr/lib/aarch64-linux-gnu/tegra -lnvbuf_utils' --extra-cflags='-I /usr/src/jetson_multimedia_api/include/'
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'canvas-frames2.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.16.100
  Duration: 00:00:09.27, start: 0.000000, bitrate: 6405 kb/s
  Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 2000x1000, 6401 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
File 'canvas-frames2_testscale.mp4' already exists. Overwrite? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[AVFilterGraph @ 0x559b786830] No such filter: 'scale_cuda'
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

Maybe I didn't enable it, but seeing as -hwaccel cuda fails to find the lib libnvcuvid.so.1 I guess that cuda is tied to a lot of nvidia libs that would need to be ported first.

@nyanmisaka
Copy link
Member

nyanmisaka commented Apr 14, 2022

https://github.com/FFmpeg/nv-codec-headers/blob/50d5add953977a2050a7b7e569b0ff4df1a1ce3e/include/ffnvcodec/dynlink_loader.h#L49-L61
libnvcuvid is the runtime for NVDEC/CUVID but cuda filters require cuda-llvm and libcuda.

    --enable-ffnvcodec \ <= minimal nvidia headers
    --enable-cuda \ <= cuda hwcontext
    --enable-cuda-llvm \ <= cuda filters
    --enable-cuvid \ <= cuvid decoder
    --enable-nvdec \ <= nvdec (another impl of cuvid)
    --enable-nvenc \ <= nvenc

Interop between nvidia v4l2 and cuda can be done via opengl<->cuda interoperability, which requires extra lines in ffmpeg.

Thus memory copy(hwupload/hwdownload filters) cannot be avoided for the time being.

@pjueon
Copy link

pjueon commented Sep 15, 2022

@LinusCDE @mattangus

Hi, guys. Can you help me to configure the Nvidia container runtime?
I was using this docker-compose.yml file and it worked perfectly.

version: "2"

services:
  jellyfin:
    # build:
    #   context: ./jellyfin_latest
    #   dockerfile: Dockerfile.arm64-jetson 
    image: mattangus/jellyfin-jetson
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              capabilities: [gpu]
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Seoul
      - NVIDIA_DRIVER_CAPABILITIES=all
      - NVIDIA_VISIBLE_DEVICES=all
    # Non linuserver image
      - JELLYFIN_DATA_DIR=/config/data
      - JELLYFIN_CONFIG_DIR=/config
      - JELLYFIN_LOG_DIR=/config/log
      - JELLYFIN_CACHE_DIR=/config/cache
    #entrypoint: [ "/config/entrypoint.sh" ]
    ports:
      - 8096:8096
      - 8920:8920 #optional
      
    volumes:
      - ./config:/config
      - /media/usb:/data
    restart: unless-stopped

But today I got this error when I tried to run the container:

ERROR: for 539cc60a6932_jellyfin_jellyfin_1  Cannot start service jellyfin: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'csv'
invoking the NVIDIA Container Runtime Hook directly (e.g. specifying the docker --gpus flag) is not supported. Please use the NVIDIA Container Runtime instead.: unknown

ERROR: for jellyfin  Cannot start service jellyfin: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: Running hook #0:: error running hook: exit status 1, stdout: , stderr: Auto-detected mode as 'csv'
invoking the NVIDIA Container Runtime Hook directly (e.g. specifying the docker --gpus flag) is not supported. Please use the NVIDIA Container Runtime instead.: unknown
ERROR: Encountered errors while bringing up the project.

I realized that if I comment out the deploy part of the docker-compose.yml file, the container runs.

    # deploy:
    #   resources:
    #     reservations:
    #       devices:
    #         - driver: nvidia
    #           capabilities: [gpu]

But if I do this, it looks like I can only directly play the videos and transcoding is not working.

I think this happened probably because I updated docker and other related packages.
(I regularly execute sudo apt-get update && sudo apt-get upgrade)

Could you give any advice for me to fix this?

@pjueon
Copy link

pjueon commented Sep 26, 2022

Ok, I got the solution for my issue - use runtime: nvidia.

version: "2"

services:
  jellyfin:
    image: mattangus/jellyfin-jetson
    runtime: nvidia

    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Seoul
      - NVIDIA_DRIVER_CAPABILITIES=all
      - NVIDIA_VISIBLE_DEVICES=all
    # Non linuserver image
      - JELLYFIN_DATA_DIR=/config/data
      - JELLYFIN_CONFIG_DIR=/config
      - JELLYFIN_LOG_DIR=/config/log
      - JELLYFIN_CACHE_DIR=/config/cache
    #entrypoint: [ "/config/entrypoint.sh" ]
    ports:
      - 8096:8096
      - 8920:8920 #optional
      
    volumes:
      - ./config:/config
      - /media/usb:/data
    restart: unless-stopped

@YikeStone
Copy link

YikeStone commented Sep 29, 2022

@LinusCDE @mattangus in the ffmpeg-jetson-wrapper script line 66:

video_codec=$($SHELLDIR/ffprobe -i "$arg" 2>&1 | sed -nE 's/^\s*Stream .* Video: ([[:alnum:]]*).*$/\1/p')

should be changed to:
video_codec=$($SHELLDIR/ffprobe -i "$arg" 2>&1 | sed -nE 's/^\s*Stream .* Video: ([[:alnum:]]*).*\(default\)$/\1/p')

When multiple video streams are present in a media file, the original one is extracting formats for all the streams present and is not creating a valid argument value and hence some media files cant be played. The change that I am proposing is extracting only the default video stream format.

@cschinis
Copy link

cschinis commented Jan 6, 2023

So I'm trying to figure if I got this right. Is the HW accelearation meant to be CPU or GPU acceleration? I get NVEC HW encoding working (no NVDEC). and the CPUs seem to be at 100% whilst the GPU barely moves. The screenshots I see from you also seem to behave the same. Are we not trying to get GPU HW support rather than CPU on the Jetsons?

@LinusCDE
Copy link

LinusCDE commented Jan 6, 2023

Pretty sure it would be classified as "GPU Acceleration". But since the de- and encoders seem to be separate hw it should not show as "GPU Load". Just NVEnc and NVDec being active.

Edit: It would probably just "HW Acceleration". GPU is surely not involved here. CPU might still have some load for managing/submitting to the NVEnc/Dec hw.

@cschinis
Copy link

cschinis commented Jan 6, 2023

Okay great thanks.

@masip85
Copy link

masip85 commented Apr 28, 2023

What's the state of this issue? Latests jetson orin, have low power performance and av1 encoding decoding capabilities. So, it could be interesting jellyfin could use nvec gpu performance for this.

@LinusCDE
Copy link

It works, but the implementation is still pretty hacky at this stage (fails at some odd resolutions for example) and integrating ffmpeg might have some unforseen dependency requirements to a specific jetson release.

Also afaik the Jetson-Ffmpeg does also not build most codecs. So some Video formats may not be able to play at all then rn.

@pjueon
Copy link

pjueon commented Sep 4, 2023

With @mattangus's docker image, can't play any video if I update the jellyfin media player to 1.9.0.
Downgrading the player to 1.8.1, I can play the videos.

related to:
jellyfin/jellyfin-media-player#401
jellyfin/jellyfin-media-player#417

@Bond-009
Copy link
Member

Closing this as we currently have no intention of having an official docker image for jetson.
Further discussion can happen on GH discussion or the forum

@Bond-009 Bond-009 closed this Sep 11, 2023
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.