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

Add Display Recording and Audio Dumping to Desktop #8945

Merged
merged 9 commits into from
Sep 4, 2016

Conversation

RisingFog
Copy link
Contributor

@RisingFog RisingFog commented Sep 1, 2016

This is a work in progress port of Dolphin's frame dumping utility for PPSSPP.

Here is a current TODO list of what is left to be done:

  • Fix incorrect video output
  • Create menu options (Win32 at least)
  • Add OSD messages (not currently required)
  • Fix minor issues with video dumping (crashing on resolution changes)
  • Add audio dumping

I will be writing audio dumping separate to this PR.

@RisingFog RisingFog force-pushed the frame_dump branch 2 times, most recently from 5c7cc40 to 9435f9a Compare September 2, 2016 02:00
@RisingFog RisingFog changed the title [WIP] Add Frame Dumping to Desktop Add Frame Dumping to Desktop Sep 2, 2016
@xnamkcor
Copy link

xnamkcor commented Sep 2, 2016

Is this based on Dolphin's 1 frame dump, or did Dolphin get a sequential frame dump?

@RisingFog
Copy link
Contributor Author

RisingFog commented Sep 2, 2016

@xnamkcor I added splitting video files (for resolution changes) to Dolphin post 5.0, so it's essentially a port of what is currently had in Dolphin.

@xnamkcor
Copy link

xnamkcor commented Sep 2, 2016

@RisingFrog. I downloaded the latest automatic build as of my comment 3 hours ago and I saw no video recording options. Is this a feature that is not yet added to the builds to be automatically built? Was video recording already an option in the automatic builds? Or did you add the resolution change handling before the video recording was added?

@RisingFog
Copy link
Contributor Author

@xnamkcor for PPSSPP or Dolphin? For Dolphin, you have to enable Frame and Audio dumps from the Movie menu, then it will dump the files to either a default location, or a location of your choice set in the settings.

PPSSPP only has the frame dump option in the movie menu with the option for lossless (FFV1). It's not officially built into PPSSPP yet, you'll need to compile it yourself until it's merged.

@xnamkcor
Copy link

xnamkcor commented Sep 2, 2016

@RisingFog Ok. I'll wait until it's merged. I thought I recalled something weird about Dolphin's frame dump. After looking, it seems like it asks which codec to use and "Full Frames(Uncompressed)" is an option now. I may not have checked since before 5.x. If the same is planned for PPSSPP, I'm happy.

@@ -593,6 +593,8 @@ std::string GetSysDirectory(PSPDirectories directoryType) {
return g_Config.appCacheDirectory;
}
return g_Config.memStickDirectory + "PSP/SYSTEM/CACHE/";
case DIRECTORY_VIDEO_DUMP:
return g_Config.memStickDirectory + "PSP/FRAMEDUMP/";
Copy link
Collaborator

@unknownbrackets unknownbrackets Sep 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess PSP/VIDEO/ is probably a more PSP-ish place to put this?

I think that's where Dissidia puts AVI exports (it natively supports it inside the game.)

-[Unknown]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't too sure where to place the dumps, but I guess placing them into VIDEO is fine.

@unknownbrackets
Copy link
Collaborator

IMHO, I feel like a top level "Movie" option isn't ideal because:

  • Movie might be misunderstood to be related to UMD Video, which we don't support.
  • Movie might be misunderstood to mean in-game videos.
  • Movie probably isn't going to have lots more options?

Maybe "TAS" or "Record" is more appropriate? I assume that there could be other options related to that which won't necessarily be Movie related, so it might be a better general category for menu options.

-[Unknown]

BEGIN
MENUITEM "Dump Frames", ID_MOVIE_DUMPFRAMES
MENUITEM "Lossless Codec (FFV1)", ID_MOVIE_USEFFV1
MENUITEM "Dump Audio", ID_MOVIE_DUMPAUDIO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this file we use spaces. Sorry, this isn't in the editorconfig yet, should add...

-[Unknown]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

#endif

NOTICE_LOG(G3D, "Opening file %s for dumping", s_format_context->filename);
if (avio_open(&s_format_context->pb, s_format_context->filename, AVIO_FLAG_WRITE) < 0 || avformat_write_header(s_format_context, nullptr))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this take filenames in utf-8 or MBCS on Windows? According to this it's utf-8 so we should be good (all our file functions live in utf-8 land), but just noting in case.

-[Unknown]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure it's utf-8

@RisingFog
Copy link
Contributor Author

@unknownbrackets I don't really agree with renaming Movie to TAS/Record, it's pretty standard these days for emulators to label their TAS tools within a Movie menu of some kind.

@RisingFog RisingFog changed the title Add Frame Dumping to Desktop Add Display Recording and Audio Dumping to Desktop Sep 3, 2016
@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Sep 3, 2016

Hmm... I checked a few emulators, none had Movie as top-level a menu:

  • higan
  • pcsx2
  • citra
  • rpcs3
  • xebra
  • nestopia
  • snes9x
  • jpcsp
  • no$psx / no$gba
  • vba-m
  • desmume

I saw "Record AVI" under File for some of them, but no top-level Movie. I'm not disagreeing that people who are into TAS might expect "Movie", but I think that your average user (which there are probably more of) will be confused by "Movie".

None of the emulators I could think of off the top of my head, with the single exception of Dolphin (I didn't check, just presuming) used Movie, so I assume it's not something regular users are used to. Maybe I'm completely out of touch.

@hrydgard what do you think?

-[Unknown]

@RisingFog
Copy link
Contributor Author

RisingFog commented Sep 4, 2016

@unknownbrackets Out of those emulators, only Desmume and Dolphin have TAS tools built within the emulator.

@xnamkcor
Copy link

xnamkcor commented Sep 4, 2016

@unknownbrackets Even among "rr" TAS builds of emulators, input and video "movies" are under File. I can't recall any emulators with Movie or similar names on the menu bar.

@RisingFog
Copy link
Contributor Author

At least with BizHawk, the Movie sub-menu is within File. I could move it into there perhaps.

@unknownbrackets
Copy link
Collaborator

I think it would mostly make sense under File, sure. I'm only really against "Movie" if it's at the top level.

-[Unknown]

@LunaMoo
Copy link
Collaborator

LunaMoo commented Sep 4, 2016

Why would any emulator even hide a feature like that under "movies" in the first place where "video recording" and many other terms completely avoid all confusion?:P
This term in english seems soo specific and well defined that even video players which primary use could as well be playing "movies" tend to avoid it and it certainly does not describe recording of gameplay.

@RisingFog
Copy link
Contributor Author

@LunaMoo it's going to eventually hold TAS related tools as well, not just for exporting audio/video.

@LunaMoo
Copy link
Collaborator

LunaMoo commented Sep 4, 2016

As far as I checked it means "tool assisted speedrun" nothing about "movies".

Recording gameplays does not make movies, just like recording theatre play wouldn't, to me it's just wrong word abused in the net because in some languages there might be no distinction between movies and other recordings.

To me if it would be a main menu in the future filled with "tas" features - it should be simply called "TAS" as [Unknown] proposed, and if it ends up a submenu under File just for video recording, why not call it just that ... "Video recording".

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Sep 4, 2016

I don't disagree, but whatever naming makes most sense to TAS enthusiasts is probably the best naming, I think. Maybe the rationale is that TAS is basically creating a "movie" of an ideal play of the game - at least, I think that's the goal of TAS, but I'm not sure. So in other words, "Trails in the Sky PSP, the Movie".

One way or another, I don't think the name in the menu / naming in general should be an obstacle to merging this functionality. We can always change it later. Maybe when there are "Step Frame", "Rewind Step", "Record Gameplay...", "Replay Gameplay...", "Replay Gameplay Until...", "Set Calendar Time...", "Convert Gameplay to AVI...", and whatever other options we will think another name makes sense.

-[Unknown]

@LunaMoo
Copy link
Collaborator

LunaMoo commented Sep 4, 2016

Agree it's not important, but find it weird that people interested in TAS would not recognize that "TAS" menu is for them;p.

When I think about PSP "movies" all my eyes see is that page someone requesting UMD-video support linked ~ filled with weird japanese porn.

@xnamkcor special edit to you - not even plan to reply to your "truths" since I already finished the discussion which I also never directed into you, just want to say I already saw in your request thread that you're a common troll who has to have last word ~ please refrain from showing off your racial culture in this place.

@xnamkcor
Copy link

xnamkcor commented Sep 4, 2016

@LunaMoo "Movie" is a term specific to TASs and is used in standard emulators with input/video recording and in TAS specific builds. I get that you want to be pedantic about the words used, but there is an existing nomenclature used pertaining to speedruns. Your unfamiliarity with a use of a word does not devalue its ability to be used in those situations.

@hrydgard
Copy link
Owner

hrydgard commented Sep 4, 2016

What I don't understand is why display and audio recording are considered TAS-related at all. They can be used perfectly fine even if you're not re-recording, frame stepping and things like that.

Will think a little about where I'd prefer these commands. Note that I'm not necessarily opposed to a new top level menu, but I agree that "movie" is a little strange, and will cause problems for translators.

@RisingFog
Copy link
Contributor Author

I just decided to move it to the File menu and rename it to record.

@unknownbrackets
Copy link
Collaborator

I'm gonna merge for now, we can always move it later. I don't think this is a very risky change for the upcoming release.

-[Unknown]

@unknownbrackets unknownbrackets merged commit b06359e into hrydgard:master Sep 4, 2016
@RisingFog RisingFog deleted the frame_dump branch September 4, 2016 23:51
av_init_packet(pkt);
pkt->data = nullptr;
pkt->size = 0;
if (s_stream->codec->coded_frame->pts != AV_NOPTS_VALUE)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like coded_frame is deprecated and wasn't reliable. Could we use s_stream->pts?

-[Unknown]

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.

5 participants