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

ffmpeg dumper with "Capture OSD" creates the first segment with 0 frames in it #3552

Open
tommai78101 opened this issue Feb 6, 2023 · 8 comments
Labels
App: EmuHawk Relating to EmuHawk frontend Repro: Affects 2.9 dev Reproducible bug Should only be added to issues with a `Repro: Affects` label.

Comments

@tommai78101
Copy link
Contributor

tommai78101 commented Feb 6, 2023

Summary

As shown here in this GIF:

GIF

I'm attempting to record on-screen display (OSD) text shown from the RAM Watch window. When about to attempt recording, I noticed that the option to "enable Capture OSD" would enable both the "Capture OSD" and the "Capture Lua" option.

Morilli mentioned this looks wrong. And showed a screenshot of a code snippet suggesting it's wrong:

private void CaptureOSDMenuItem_Click(object sender, EventArgs e)
{
bool c = ((ToolStripMenuItem)sender).Checked;
Config.AviCaptureOsd = c;
if (c) // Logic to capture OSD w/o Lua does not currently exist, so disallow that.
Config.AviCaptureLua = true;
}

After enabling both options, an attempt to make a small test encoding was made, using the FFmpeg writer, with MP4 default configurations and flags.

It produced 2 movie files, which I named as "test", both of which cannot be played back on a Windows Media Player application. I have attached the 2 movie files here:

test.mp4:
https://user-images.githubusercontent.com/6444116/216873377-d56c7f54-90cf-4d8a-9b39-33bd39cf313a.mp4
test_1.mp4:
https://user-images.githubusercontent.com/6444116/216873378-50e1e34f-c329-457b-92ec-6240a7d79587.mp4

I used the game River City Ransom EX, with a simple RAM Watch properties file (.WCH file, compressed into a ZIP file)
test_ram_watch.zip

SHA-1: 64D0B723AE4EB3F3589B535FB935618F2769229F
CRC32: 8686436E

Thus far, only tested in Bizhawk 2.9 RC2.

Repro

  1. In Bizhawk 2.9 RC2, open EmuHawk.
  2. Open the game, and load it up using TAStudio.
  3. Open the RAM Watch window, and load the .WCH file into the RAM Watch.
  4. In the RAM Watch window, enable Settings -> Display Watches on Screen.
  5. In EmuHawk, begin recording a movie starting at frame 0.
  6. Begin recording with the default configurations for an MP4 file.
  7. Record a couple of frames.
  8. Stop the recording.
  9. EmuHawk should output 2 MP4 files, one of which is named with a _1 suffix.
  10. Attempt to open any one of the 2 files will result in not being able to play back the movie files.

Output

No known output exceptions nor error log messages.

Host env.

  • BizHawk 2.9 RC2; Win10 x64 Pro 21H2; Intel/NVIDIA (Only tested with the release candidate 2 version.)
@Morilli
Copy link
Collaborator

Morilli commented Feb 6, 2023

Did a quick test and I can confirm two files get created. The first one seems like an erroneously generated file because it doesn't seem to contain any data, while the second file contains the video as normal.

@tommai78101
Copy link
Contributor Author

@Morilli Were you able to play the second video normally? I couldn't get the second video to play, and instead, it would crash my Windows Media Player application on me.

@Morilli
Copy link
Collaborator

Morilli commented Feb 6, 2023

Yeah you probably need a better video player than windows' default for these video files; it should play fine in your browser though.

@tommai78101
Copy link
Contributor Author

@Morilli Now can confirm the second video can be played back on a newly installed VLC Media Player. It's a shame that the default Windows Media Player can't open the file anymore.

@YoshiRulz
Copy link
Member

YoshiRulz commented Feb 6, 2023

The code is correct, or at least it correctly implements the desired behaviour according to that comment. (UX needs work, as usual...)

@YoshiRulz YoshiRulz added App: EmuHawk Relating to EmuHawk frontend Reproducible bug Should only be added to issues with a `Repro: Affects` label. Repro: Affects 2.9 dev labels Feb 6, 2023
@vadosnaprimer
Copy link
Contributor

Creating a segment with 0 frames can't be correct. It's taking wrong values when initializing an ffmpeg recording, probably assumes OSD is not captured, and then actually sees that resolution is different and splits.

@nattthebear
Copy link
Contributor

It's not desired behavior, but it's also not grossly wrong. If you blindly stitch together all of the segments, it will work fine; if you ignore the empty segment, it will work fine.

@Morilli
Copy link
Collaborator

Morilli commented Feb 7, 2023

The code is correct, or at least it correctly implements the desired behaviour according to that comment. (UX needs work, as usual...)

How about something like one option saying Capture Lua and the other Capture Lua + OSD, and toggling either switches the other off? Sounds kinda intuitive in my head, and shouldn't be confusing to see.
Of course, these toggles could potentially just be options in the recording dialog itself...

@vadosnaprimer vadosnaprimer changed the title Enabling "Capture OSD" option will enable both "Capture OSD" and "Capture Lua". After recording, EmuHawk outputs 2 movie files, both of which cannot be played back. ffmpeg dumper with "Capture OSD" creates the first segment with 0 frames in it Oct 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
App: EmuHawk Relating to EmuHawk frontend Repro: Affects 2.9 dev Reproducible bug Should only be added to issues with a `Repro: Affects` label.
Projects
None yet
Development

No branches or pull requests

5 participants