Old 08-30-2020, 03:04 PM   #1
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 50
Default Export frame as png or jpg

Hi, one very small inconvenience I've found from editing video in Reaper, is that you can't export single frames from a video as png's or jpg's. This means if you want to make a custom thumbnail, you have to do with some other program. You can export an animated gif that's only one frame long, but that format doesn't have very good color resolution.
Not a big problem, but I was thinking, I know you can communicate between video processor and reascripts using gmem[], and the reascript api has reaper.JS_LICE_WritePNG. So I'd imagine there should be a way to do a reascript that would export the current frame from a video processor as a png.

Does anyone know if this has already been done, or if there are problems I'd run into if I tried to make it?
Ben Osterhouse is offline   Reply With Quote
Old 08-30-2020, 03:27 PM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,649
Default

As a workaround for the moment:
If you use my Ultraschall-API, you can use this code to get screenshots.

But: they are the size of the video-window. So, the bigger the video window, the bigger the screenshot.
And the video-window must be fully visible, not behind other windows or they will be captured as well. And it works only on Windows yet.

Code:
dofile(reaper.GetResourcePath().."/UserPlugins/ultraschall_api.lua")

hwnd = ultraschall.GetVideoHWND()
retval, left, top, right, bottom = reaper.JS_Window_GetClientRect(hwnd)
ultraschall.CaptureScreenAreaAsPNG("c:\\tempvideo2.png", left, top, right-left, bottom-top)
The idea with capturing via gmem could work. I look into it at some point.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 08-30-2020, 04:47 PM   #3
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 50
Default

Thanks for sending this script --I'll try that out.
So, you can just capture parts of the screen if you want? Cool! I wonder if you could do screen capture video this way?

Before I started using OBS I did Licecap for screen captures, but it comes out looking a little weird, I think because it doesn't capture the full color resolution, even when you're saving as lcf instead of gif. Maybe there were some settings I messed up in the render.
I'll have to see if this ends up looking better than licecap.
Ben Osterhouse is offline   Reply With Quote
Old 08-30-2020, 06:13 PM   #4
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: Apr 2020
Location: Leipzig
Posts: 2,649
Default

It works only for single pictures. Gifs, like LiceCap or many frames per second are simply not possible, imho. Too slow for that.

But I haven't tried.


Just tested, it even works, when you have video in fullscreen.

And yes, screencapture is possible as well, though only, when you have no contextmenu opened, otherwise shortcuts to run the screenshot-scripts simply don't work.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper
Bugreports&Docs notes please do here:https://github.com/Ultraschall/ultra...-reaper/issues - Donate, if you wish
Meo-Ada Mespotine is online now   Reply With Quote
Old 08-30-2020, 10:35 PM   #5
Ben Osterhouse
Human being with feelings
 
Join Date: Jan 2019
Posts: 50
Default

Neat! Thanks for checking that. I was thinking that could be interesting to make a built-in screen capture script. I suppose it would be a little bit unnecessary, since it's really not that hard to just find a program to do that :P
I saw ReaCoMa: https://forum.cockos.com/showthread.php?t=239824
and X-Raym's script using Aubio: https://github.com/X-Raym/aubio
And both of these make it super simple to have external commandline programs do stuff for you, and then have it be reflected right back in the reaper project.
Maybe I'll do something like that with ffmpeg sometime.
Just a script that streamlines the process in this thread: https://forum.cockos.com/showpost.ph...6&postcount=27
Ben Osterhouse is offline   Reply With Quote
Old 08-31-2020, 04:49 PM   #6
superblonde.org
Human being with feelings
 
Join Date: Jul 2019
Posts: 1,015
Default

I would also like this feature. "Render -> Frame -> tiff / png / jpg / ..."

Make note that ffmpeg can do it very easily... Reaper uses ffmpeg for many other things.. so..... ... ....
superblonde.org is offline   Reply With Quote
Old 09-21-2021, 03:50 PM   #7
rayonbase
Human being with feelings
 
rayonbase's Avatar
 
Join Date: Sep 2021
Location: Minnesota, USA
Posts: 2
Default Simple way desired to export single JPG when editing video

**I have the same question as the #1 post in this thread: Is there a way in Reaper to export a single frame of a video to JPG (or PNG). In particular, I would like an exact copy of the frame, in native resolution and same appearance and colors.
Today I use one of two options a) Render to an external file (e.g. .MOV) and create a snapshot of the frame desired with an external program (e.g. VLC), or b) Narrow the time selection in Reaper to the desired frame, Render to Video(GIF) format, then convert the GIF to JPG with an external program (e.g. Paint).
Option (b) has a drawback that the appearance of the resultant JPG is solarized, that is, the colors aren't the same as the original, apparently due to truncation of the color values of each pixel (see attached JPG).
** Does anyone know of a Reaper script or plug-in that would simplify JPG frame exporting from a video project?
Attached Images
File Type: jpg Video_Draft9a.jpg (44.5 KB, 25 views)
rayonbase is offline   Reply With Quote
Old 09-22-2021, 05:36 AM   #8
juliansader
Human being with feelings
 
Join Date: Jul 2009
Posts: 3,600
Default

If you need a screenshot of the video with all video FX applied, without rendering, then the only way that I know of is to take a screenshot of the video window. You can use Mespotine's script, or your computer's native screenshot tool.

If you want to extract a frame from a video item, ignoring FX, then ffmpeg can do so. I do not know of a script that is specialized to do so, but the script "Extract thumbnails of video items to empty, MIDI or video processor items" can be used to extract frames at the position of MIDI/empty items.
juliansader is offline   Reply With Quote
Old 09-22-2021, 08:35 AM   #9
rayonbase
Human being with feelings
 
rayonbase's Avatar
 
Join Date: Sep 2021
Location: Minnesota, USA
Posts: 2
Default Thanks for the reply!

OK, well this confirms that I can/should use the methods I am currently using. Thanks!
rayonbase is offline   Reply With Quote
Old 09-25-2021, 07:55 PM   #10
Tod
Human being with feelings
 
Tod's Avatar
 
Join Date: Jan 2010
Location: Just outside of Glacier National Park
Posts: 13,519
Default

I use this for taking screen shots, you can select the area you want in the screenshot, hit Ctrl+C and copy it.

https://app.prntscr.com/en/index.html
Tod is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.