Repository navigation
Add 3D test videos with a test that runs FFmpeg and MediaInfo on them, and fix what they found - #6400
Merged
SubJunk merged 4 commits intoOct 16, 2026
Conversation
The frame packing check of UniversalMediaServer#6389 names a right eye first video up to 1920 pixels wide "half side by side (right eye first)" and one up to 1080 pixels high "half top-bottom (right eye first)", but get3DLayout() had no mode for them and multiViewIsAnaglyph() took them for anaglyph. Such a video was not converted and not signalled, and for an H.265 video with Output3DFormat set, StoreItem called toString() on the missing mode. Map them to SBS2R and AB2R, like their left eye first twins, and draw 3D subtitles for them too. Assisted-by: Claude Opus 5.5 via Claude Code
FramePackingParser asked UmsConfiguration.getFFmpegPath() for FFmpeg, which is null on Linux when there is no FFmpeg on the PATH and UMS uses the one it bundles: the default type of that program info goes back to the installed one, which has no path. So the check of UniversalMediaServer#6389 never ran there, and it did not follow the FFmpeg the user picked either. Ask the FFmpeg engine for its executable, as FFmpegParser does, and as FFMpegVideo already does when it writes the SEI. Assisted-by: Claude Opus 5.5 via Claude Code
showinfo prints the Stereo 3D side data three ways: "stereoscopic information: type - side by side (inverted)" up to FFmpeg 5.1, "Stereo 3D: type - side by side (inverted)" in 6.0 to 7.0, and "Stereo 3D: type - side by side (inverted), view - packed, primary_eye - none" since 7.1. The check of UniversalMediaServer#6389 read only the last, so with the FFmpeg of Ubuntu 22.04 (4.4) and 24.04 (6.1) or Debian 12 (5.1), which UMS runs on Linux when it is on the PATH, no file was found to be 3D. Read all three. The view is still checked when FFmpeg prints it. Assisted-by: Claude Opus 5.5 via Claude Code
…ir layout Eighteen small videos made with FFmpeg from lavfi colour sources, LEFT and RIGHT written on each eye, five frames at 25 fps (eight at 50 fps, one eye per frame, for temporal interleaving), 112 KB in all. The frame packing arrangement SEI (H.264 D.2.26, H.265 D.3.16): side by side and top and bottom, left and right eye first, half and full size, in H.264 and H.265, in MP4 and MPEG-TS. The other arrangements of H.264 Table D-8 that x264 writes (checkerboard, column and row interleaving, temporal interleaving, 2D) and the temporal interleaving of H.265 Table D.8, which have no 3D mode in UMS and must stay 2D. And Matroska's StereoMode without the SEI, side by side and top and bottom, both eye orders. FramePackingParserTest parses them like any file, so MediaInfo reads StereoMode and FFmpeg's showinfo the SEI, and checks the layout and the 3D mode. FramePackingFilterTest copies the Matroska videos to MPEG-TS with the bitstream filter UMS adds, and checks that the copy is found to be 3D from the SEI alone; it runs when FFmpeg has the frame_packing option. Assisted-by: Claude Opus 5.5 via Claude Code
SubJunk
approved these changes
Oct 16, 2026
Member
|
Cool, nice one! |
Contributor
Author
|
Thank you for merging, SubJunk. One offer, with no strings attached. |
Member
|
@danielcamposramos thanks for your offer. I have too much to do already so I won't take on more, and I really appreciate your contributions and collaboration :) |
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thank you again for merging #6389, @SubJunk, and for the idea of checking it with real files.
This adds 18 small 3D videos to
src/test/resources/net/pms/parsersand tests that run FFmpeg and MediaInfo on them.On their first run they found three gaps in the check of #6389, and the first three commits fix them.
The videos, 112,136 bytes in all (2,966 to 30,029 bytes each):
UMS has no 3D mode for these, so they must stay 2D.
x264 also writes the tile format (type 7), but FFmpeg does not read it, so it is left out.
They are made with FFmpeg from lavfi colour sources, one colour per eye with LEFT or RIGHT written on it, five frames at 25 fps (eight at 50 fps, one eye per frame, for temporal interleaving), so there is no third party content in them.
The names keep clear of the file name detection (no SBS, OU or TB between dots or spaces), so a layout can only come from the stream or the container.
Eleven of them can be made with stock FFmpeg: I made them again with the n8.1.3 build that the testing profile downloads, and they give the same layouts.
The other seven carry a right eye first SEI or an H.265 SEI, which x264 and x265 cannot write, so they were made with the
frame_packingoption ofh264_metadataandhevc_metadatafrom our FFmpeg patch series.All 18 were made with FFmpeg 9.0.2 and that series.
Run again, the script gives the same bytes for the MP4 and MPEG-TS videos and the same video packets for the Matroska ones.
The tests:
FramePackingParserTest.testFilesparses each video withMediaInfoParser.parse, the way UMS does, and checksgetMultiViewLayout()andget3DLayout().MediaInfo answers for the Matroska videos and FFmpeg's
showinfofor the SEI ones.Without FFmpeg it is skipped, like
FFmpegParserTest.FramePackingFilterTest.copyKeepsTheLayoutOfTheContainercopies the four Matroska videos to MPEG-TS with the-bsf:vvalue thatFFMpegVideoadds on a copy, and checks that UMS finds the layout in the copy, which only has the SEI.It runs when FFmpeg has the
frame_packingoption, so for now it returns early in CI.Once the option is in FFmpeg, a change to its names fails this test before it breaks a copy.
FramePackingParserTest.olderFFmpegOutputchecks the Stereo 3D lines of FFmpeg before 7.1, taken from real runs.What the videos found:
UmsConfiguration.getFFmpegPath()is null.When the configuration loads, the default type of the FFmpeg program info goes back to installed, and only the bundled one has a path.
So the check of Write the frame packing SEI on every path that outputs 3D video, and find it in files that only signal 3D in the stream #6389 never ran on Linux with the bundled FFmpeg, and
FFmpegVideoTestworks around the same null with a fixed runner path.FramePackingParsernow asks the FFmpeg engine for its executable, asFFmpegParserdoes.showinfoprints the Stereo 3D side data in three ways:stereoscopic information: type - side by side (inverted)up to FFmpeg 5.1,Stereo 3D: type - side by side (inverted)from 6.0 to 7.0, andStereo 3D: type - side by side (inverted), view - packed, primary_eye - nonesince 7.1.The check read only the last one, so with the FFmpeg of Ubuntu 22.04 (4.4), Debian 12 (5.1) or Ubuntu 24.04 (6.1) on the PATH nothing was found.
It reads all three now.
get3DLayout()had no mode for them, somultiViewIsAnaglyph()took them for anaglyph.They map to
SBS2RandAB2Rnow, and get 3D subtitles like their left eye first twins.How it was checked, in containers with the sources at the runner's path:
FramePackingParserTestandFramePackingFilterTestpass with FFmpeg 4.4.2 (Ubuntu 22.04), 6.1.1 (Ubuntu 24.04), the bundled n8.1.3 on Ubuntu 22.04 and 24.04, and 9.0.2 with theframe_packingpatches on Debian, where the copy test runs too.With the bundled FFmpeg it stops at the first SEI video, which has no layout.
With FFmpeg 9.0.2 on the PATH it stops at the first half right eye first video, which has its layout but no 3D mode.
With the first two commits and FFmpeg 6.1 on the PATH it stops at the first SEI video again.
With
type:in place oftype -in the pattern, as if FFmpeg changed its output,testFilesstops at the first SEI video.With the eyes swapped for
SBSLingetFramePackingFilterOptions, the copy test with FFmpeg 9.0.2 gets "half side by side (right eye first)" for the left eye first video.FFmpegParserTestfails with FFmpeg 4.4 and 6.1 on main too (the format profile of the FLV video), which is not about 3D.The script that made the videos
This text and the code were written with Claude (Anthropic) and checked by running them. I reviewed and submit it.