Old 07-30-2020, 07:33 AM   #1
serr
Human being with feelings
 
Join Date: Sep 2010
Posts: 9,206
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,708
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: Apr 2020
Location: Leipzig
Posts: 837
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, when contacting me, please. Thanks :) Not mentoring via PMs, sorry.
Ultraschall-API - 1200 ReaScript functions for Reaper - Reaper Internals - Developerdocs4Reaper - Donate, if you wish
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
Posts: 3,808
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 wish to donate for my scripts: please consider an organization like: animal shelter, doctors without borders, UNICEF, etc...
_Stevie_ is offline   Reply With Quote
Old Yesterday, 11:42 AM   #5
serr
Human being with feelings
 
Join Date: Sep 2010
Posts: 9,206
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 02:00 AM.


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