Opened 7 months ago

Last modified 6 months ago

#10617 new defect

Smacker's "height interlaced" flag not respected

Reported by: Iritscen Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: elenril Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

For Smacker videos that were saved at "half-height" (every other row omitted), a flag should generally be present in the file telling the player to interlace black rows of pixels with the video to restore it to its full height. As it is now, playing (or transcoding with ffmpeg) a video that was encoded this way simply renders the existing rows of pixels and the video appears vertically smushed as a result.

How to reproduce:

% ffplay some_interlaced_video.smk
ffplay version 4.4.4 Copyright (c) 2003-2023 the FFmpeg developers
  built with Apple clang version 15.0.0 (clang-1500.0.40.1)

See attached screenshot of resulting frame of video from a cutscene for Myth: The Fallen Lords.

Also see screenshot of RAD's Smacker Player. Note that it lets you play a video "as compressed" in order to respect how it was encoded to be played, or force interlacing (every other row black) or doubling (existing rows scaled vertically 2x). Presumably there's a flag for each of these choices, interlaced and doubled, in the Smacker video format, because when double-clicking a .smk, the Smacker Player automatically renders these "half-height" videos with interlacing. Will attach a sample video as well.

Attachments (3)

01cr still.jpg (108.3 KB ) - added by Iritscen 7 months ago.
Still frame from Smacker video meant to have interlacing
Smacker encoder.png (70.1 KB ) - added by Iritscen 7 months ago.
Screenshot of RAD's official Smacker Player
01cr correct.png (249.6 KB ) - added by Iritscen 7 months ago.
When viewed or correctly converted with RAD's own tools, this is how the video should look.

Download all attachments as: .zip

Change History (9)

by Iritscen, 7 months ago

Attachment: 01cr still.jpg added

Still frame from Smacker video meant to have interlacing

by Iritscen, 7 months ago

Attachment: Smacker encoder.png added

Screenshot of RAD's official Smacker Player

comment:1 by Iritscen, 7 months ago

Just wanted to note that the sample video had to be uploaded through the VideoLAN uploader because it was over 2.5MB. It's titled 01cr.smk.

comment:2 by elenril, 7 months ago

There are indeed two flags mentioned at https://wiki.multimedia.cx/index.php/Smacker, that are currently ignored by the demuxer. It would be easy to have the demuxer export a pixel aspect ratio of 1/2 when either of them is set, but I'm wondering if that is actually the correct value, since

  • your video is coded as 640x192
  • doubling the height would make it 640x384
  • what I would actually expect is 640x480, so multiplying the height by 2.5

Do you have a screenshot of what the displayed picture is supposed to look like? Or its playback dimensions at least.

comment:3 by Iritscen, 7 months ago

The video is indeed supposed to play at 640x384. There were only two options in Smacker AFAIK: encode all rows of the video, or encode every other row and play it back at 2x height with interlacing. Indeed, I should have included an example of how it looks when played correctly. I'll attach a still from a conversion I made using RAD's tools. (Btw, the current RAD Video Tools do not always handle the old videos correctly, so I had to use a version of the old Smacker Tools from 1999.)

by Iritscen, 7 months ago

Attachment: 01cr correct.png added

When viewed or correctly converted with RAD's own tools, this is how the video should look.

comment:4 by elenril, 7 months ago

Cc: elenril added

Reproducing the black lines would be quite nontrivial, but just fixing the display aspect ratio should be implemented in http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2023-October/316215.html

comment:5 by Iritscen, 7 months ago

Glad to see that you didn't miss the doubling flag. I forgot to mention the doubling option in my last comment because my original focus was on getting these specific movies to be interlaced, as that's how they were shown in-game. I assume that each of Myth's .smk files has a flag asking for interlacing but I didn't look for it. Obviously though, many users of ffmpeg/ffplay would probably prefer to play a movie like this with the height-doubled option if they can force it, just as the Smacker Player allowed the user to play the movie "As compressed" (i.e. respect the existing interlacing or doubling flag) or to force interlacing or height doubling on it (as seen in my screenshot of the Player).

comment:6 by elenril, 6 months ago

Patch pushed as ad3df6bf35825fe94a673e2be515067acd61769c, it should be played with the correct aspect ratio now.

As I said above, exporting the black lines information would require more work than I'm willing to invest into this (probably adding a new side data type). Patches welcome though.

Note: See TracTickets for help on using tickets.