Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Q&A, Tips, Tricks and Howto

Reply
 
Thread Tools Display Modes
Old 07-30-2020, 07:33 AM   #1
serr
Human being with feelings
 
Join Date: Sep 2010
Posts: 12,557
Default Edit video on frame in Reaper export without re-encoding?

Is there a simple way to edit video on frame boundaries and spit out the still encoded video 1:1?

I’m aware of the lossless mkv render option. As I understand this, the video is being decoded back into raw rgb with that. That “raw” stream would be the result of the original encoding with the original compression factor. The end result of this is still encoded video data in raw format now (like an mp3 put in full wav format). And now you have to encode it again to trim down to data rates video players can use.

My workflow has been to do that first but then replace the video with the original encoded video using ffmpeg. That’s fine if there are no edits to the video and I’m just replacing the audio.

Is there a simple direct way to edit video on the frame boundaries and export with the original compression 1:1? If not Reaper, some video editing app? And one that doesn’t take a month to learn how to maybe do this but not really be sure actually and never get a clear answer?

Frames are the smallest chunks just like samples in audio, right?
But then there are “super frame” boundaries and THOSE are actually what you have to edit to if you want to keep everything 1:1? Is that right? That leads me to expect a simple editing workflow where you see those super frame boundary points highlight in some way.

Maybe I need to learn ffmpeg better?
I thought I would be able to spot sections of the original video back into the render file by frame point. Turns out you have to specify time in ffmpeg for that and it’s because of some bs around the super frame business. So, we’re getting into the weeds right away.

Is there just a simple black and white way to deal with this if you keep slices to frame boundaries?
I have frames of video. I want to take them from ‘here’ and put them over ‘there’.
serr is offline   Reply With Quote
Old 08-02-2020, 02:24 AM   #2
planetnine
Human being with feelings
 
planetnine's Avatar
 
Join Date: Oct 2007
Location: Lincoln, UK
Posts: 7,924
Default

I don’t think it’s that simple. Disclaimer: I am not an expert in lossy data compression

Lossy video CODECS don’t just compress each frame a la jpeg in sequence and string them together, they look at changes from frame to frame and use patterns there too, to compress its data (that’s why with really heavy video compression, you can see artefacts at scene change boundaries). This is needed to further reduce the size/bit rate enough for consumer transmission/use/storage.

I don’t think you can win here without, as you say, using lossless compression or uncompressed formats for your editing stages. The only (no further) lossless manipulation I know of is lossless jpeg rotation where the pattern algorithms must be applicable whichever way round the image is, or can be translated or manipulated in “pattern space” to result in no further decompression/compression losses.

Video compression is across frames, so even if you edit at frame boundaries and treat frames as distinct independent images, your video CODEC doesn’t. Sorry to be the bearer of bad news.


>
__________________
Nathan, Lincoln, UK. | Item Marker Tool. (happily retired) | Source Time Position Tool. | CD Track Marker Tool. | Timer Recording Tool. | dB marks on MCP faders FR.
planetnine is offline   Reply With Quote
Old 08-02-2020, 11:20 AM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

It could only be possible with lossless video in the first place.

As planetnine pointed out, the stored contents of frames are dependent on the contents of the frame(s) before, with just some reference-frames from time to time.

So if you changed one frame, you would influence the following ones and they would need to be reencoded.

Only lossless video has no such dependencies(if stored frame by frame individually) but because of that also huge sizes.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 08-02-2020, 12:11 PM   #4
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,054
Default

This is called direct stream copy and is possible with FFMPEG, but unfortunately not within Reaper. I requested that feature some time ago.

https://forum.cockos.com/showthread.php?t=207403
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 08-03-2020, 11:42 AM   #5
serr
Human being with feelings
 
Join Date: Sep 2010
Posts: 12,557
Default

Quote:
Originally Posted by planetnine View Post
I don’t think it’s that simple. Disclaimer: I am not an expert in lossy data compression

Lossy video CODECS don’t just compress each frame a la jpeg in sequence and string them together, they look at changes from frame to frame and use patterns there too, to compress its data (that’s why with really heavy video compression, you can see artefacts at scene change boundaries). This is needed to further reduce the size/bit rate enough for consumer transmission/use/storage.

I don’t think you can win here without, as you say, using lossless compression or uncompressed formats for your editing stages. The only (no further) lossless manipulation I know of is lossless jpeg rotation where the pattern algorithms must be applicable whichever way round the image is, or can be translated or manipulated in “pattern space” to result in no further decompression/compression losses.

Video compression is across frames, so even if you edit at frame boundaries and treat frames as distinct independent images, your video CODEC doesn’t. Sorry to be the bearer of bad news.


>
That makes sense.

Do you know if there are certain places you can get away with cutting? Or is there always a connection back to the very start of the file?

What I'm after is the ability to preserve original video quality 1:1 (for good or bad).

I have a project right now with 7 different files. They sync up to a performance. There are a couple 2 or 3 frame gaps and a couple few minute gaps to just leave black.

My workflow for video was always to paste the original video back into the final master file. Easy for a single file. I thought I'd just go by frame number here since I have it all sync'd. I suppose I'll have to play with ffmpeg giving it a time stamp and see what happens.
serr 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 01:30 AM.


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