mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 05:43:54 +03:00
Support for stream copy of H264 streams in AVI #4085
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gaudat on GitHub (Aug 6, 2022).
Continuing from #8164 where it is observed the H264 streams in AVI containers are always transcoded.
@cvium mentioned H264 is not supposed to go in AVI containers and the correct codec is be Xvid (Appears in Web UI as MPEG4).
Command to create the AVI file:
ffmpeg -re -f lavfi -i "smptehdbars=rate=30:size=1920x1080" -f lavfi -i "sine=frequency=1000:sample_rate=48000" -to 10 -c:v h264 -profile:v baseline -pix_fmt yuv420p -preset ultrafast -tune zerolatency -crf 28 -c:a mp3 testvid.aviMedia Info of the file
Logs
FFmpeg Logs
TBDStats for Nerds Screenshots
TBDServer System (please complete the following information):
Client System (please complete the following information):
@gaudat commented on GitHub (Aug 6, 2022):
https://github.com/jellyfin/jellyfin/blob/master/MediaBrowser.Controller/MediaEncoding/EncodingHelper.cs#L1877
Looks like Stream Copy of H264 in AVI is specifically excluded here. That exclusion is here since the initial commit of our encestor "Emby.Common". Maybe really old versions of ffmpeg did not support it?
The comment
// see Coach S01E01 - Kelly and the Professor(0).aviis worth looking into.@gaudat commented on GitHub (Aug 6, 2022):
Hold on, why ffprobe returns "is_avc" == false on the file? I thought H264 and AVC are the same thing.
https://github.com/jellyfin/jellyfin/issues/8164#issuecomment-1193150478
I found a SO question on this. Link
Then mentioned the flag
-flags +global_header. Maybe we can add it to our ffprobe invocation.Digging in the ffmpeg source code reveals there 2 H264 codecs, "avc1" and "h264". From a discussion on the difference between two Link, "Micheal Espinola" says:
Another discussion Link says:
So we can deduce that stream copy of H264 streams on current Jellyfin only works on MP4 and MKV (both observed) but not AVI (observed) or TS.
"Alessandro Angeli" saying there is nothing special about H264 in AVI: Link
@gaudat commented on GitHub (Aug 6, 2022):
Found the source.
https://emby.media/community/index.php?/topic/54683-emby-having-problems-with-avi-files/
From Luke:
And 4 years later someone starts complaining about it haha
From Waldonnis:
@gaudat commented on GitHub (Aug 6, 2022):
I commented out the H264 in AVI case and tested it. Everything works for all 3 files that I have in this format. Playback is smooth. Seeking works. CPU usage is low.
If fact it loads even faster than direct playing files. I'm now inclined to disable direct play and use remux for everything.
@jellyfin-bot commented on GitHub (Dec 5, 2022):
This issue has gone 120 days without comment. To avoid abandoned issues, it will be closed in 21 days if there are no new comments.
If you're the original submitter of this issue, please comment confirming if this issue still affects you in the latest release or master branch, or close the issue if it has been fixed. If you're another user also affected by this bug, please comment confirming so. Either action will remove the stale label.
This bot exists to prevent issues from becoming stale and forgotten. Jellyfin is always moving forward, and bugs are often fixed as side effects of other changes. We therefore ask that bug report authors remain vigilant about their issues to ensure they are closed if fixed, or re-confirmed - perhaps with fresh logs or reproduction examples - regularly. If you have any questions you can reach us on Matrix or Social Media.