Log in

View Full Version : Cutting ProRes Footage (Direct Stream Copy)


easy2Bcheesy
31st October 2016, 13:17
Hi there,

For years I've been capturing into the AVI container and then using VirtualDub and Direct Stream Copy to cut out the exact footage I need - to the frame.

However, workflow is moving to MOV and ProRes, and I'm wondering if there is any tool out there similar to VirtualDub that will allow me to import a ProRes MOV, select a start and end frame and export it without the need to re-encode? Maybe there's an option in Adobe Premiere to do it? Or maybe it's simply not possible if it's not a keyframe codec?

Advice much appreciated!

shekh
31st October 2016, 13:43
Should work with my version, see this info https://sourceforge.net/p/vdfiltermod/wiki/direct_copy/

easy2Bcheesy
1st November 2016, 14:46
Well this is pretty awesome because it works beautifully and even stuffs the data into an AVI container, which would be very helpful for compatibility with other tools we use.

However, I need a VFW/DirectShow decoder for the ACPN fourcc. I've tried installing ffdshow but no dice there. I'm sure I've run ProRes from within an AVI before - I dimly recall capturing it with MediaLooks DirectTake.

Are you aware of a decoder that could help here?

shekh
1st November 2016, 15:43
Now I tested something and found this:
acpn is for prores-SD and is implemented in ffmpeg, but
1) for some reason does not work with my input driver (will see, I expect some tiny fixable problem) Btw it is unclear what works for you
2) since ffdshow-tryouts depends on ffmpeg I expected to see prores decoder supported, but nope. No idea.

easy2Bcheesy
1st November 2016, 15:45
Does your input driver only work for VirtualDub or would it work for other AVI tools?

shekh
1st November 2016, 15:51
No, it is only for VD.

Few days ago I tried if I could recompile ffdshow-tryouts and abandoned it. More complicated than I hoped.

poisondeathray
1st November 2016, 16:24
W

However, I need a VFW/DirectShow decoder for the ACPN fourcc. I've tried installing ffdshow but no dice there. I'm sure I've run ProRes from within an AVI before - I dimly recall capturing it with MediaLooks DirectTake.

Are you aware of a decoder that could help here?

lav filters is directshow and can decode all prores varieties

I suspect prores in AVI would be unstable . It can be decoded/decompressed into a "fake" avi with avfs.

any ffmpeg based tool should be able to streamcopy/cut prores with frame accuracy since it's I-frame . An example of a GUI would be xmediarecode . QTPro can do this too on windows or mac . And most editors on Mac can smart render prores (FCPX, Premiere)

shekh
1st November 2016, 18:59
I suspect prores in AVI would be unstable

Does it have some specific reason to be unstable? (curious)

poisondeathray
1st November 2016, 19:22
Does it have some specific reason to be unstable? (curious)



The reason is the big bad "Apple".

Prores in a non Apple standard container like AVI will not be accepted by certified programs. "AVI" is a "Windows" native format. (And Apple can't "charge" for it so they won't support it). It might be "acceptable" in programs like ffmpeg/ffplay or derivatives, but programs like commercial NLE's, grading and compositing programs won't accept it.

Prores has a bunch of prores specific metadata and tags in the MOV container that does not have a counterpart in AVI . Some programs (e.g. resolve) look for that. Without them you get levels shifts, other problems like black screen or glitches that aren't there when decoded with ffmpeg. It's definitely Apple being protective (there is a fee for Prores certification) . Despite actually yielding higher quality at a given bitrate, the ffmpeg/ffmbc prores derivative can be buggy in some programs

shekh
1st November 2016, 19:50
thanks

easy2Bcheesy
1st November 2016, 23:08
lav filters is directshow and can decode all prores varieties

I suspect prores in AVI would be unstable . It can be decoded/decompressed into a "fake" avi with avfs.

any ffmpeg based tool should be able to streamcopy/cut prores with frame accuracy since it's I-frame . An example of a GUI would be xmediarecode . QTPro can do this too on windows or mac . And most editors on Mac can smart render prores (FCPX, Premiere)

I couldn't get lav filters to work earlier, I'll give it another try tomorrow.

One of the my requirements for a Direct Stream Copy edit is the ability to select the precise number of frames - 1000, 2000 etc. This is really easy in Vdub - start and end buttons, scroll wheel to move frame by frame and on-screen indication of how many frames are selected. Am happy to move to MOV, but is there any tool in Windows that has this functionality?

poisondeathray
1st November 2016, 23:39
I couldn't get lav filters to work earlier, I'll give it another try tomorrow.


It's just a directshow decoder. It enables you to decode prores in directshow , or programs that use directshow (e.g. mpchc, graphstudio) . By itself, it won't stream copy or edit.


One of the my requirements for a Direct Stream Copy edit is the ability to select the precise number of frames - 1000, 2000 etc. This is really easy in Vdub - start and end buttons, scroll wheel to move frame by frame and on-screen indication of how many frames are selected. Am happy to move to MOV, but is there any tool in Windows that has this functionality?


If you're using prores, it's really only MOV, or perhaps MXF. You're better off using something else if you want to keep using AVI

What is the background info and scenario ? If you're not using any of those certified apps in the workflow, maybe the "AVI" variant is suitable for your purposes? If you hand off, or other people or setups are involved - My recommendation is to avoid all the headaches - you don't want to be wasting hours debugging why so and so doesn't work properly on a particular setup

quicktime pro - There is a visual display and GUI. You move the playhead slider, mark in / out points with "I" , "O" keys . You can toggle the display by time, timecode, or by frames. But it's no longer officially supported on Windows and depreciated, and not free. But it's the most stable , "gold standard" for steam copy prores on windows.

xmedia recode - it's a free GUI based on ffmpeg. There is a preview but only based on time. (i don't think you can't toggle frame count, so if you need "x" number of frames, you'd have to do more mental math)

shekh
2nd November 2016, 13:16
If cutting to AVI has no side effects for you like poisondeathray warned, you can also convert these AVI to MOV with ffmpeg or xmedia recode.

1) for some reason does not work with my input driver (will see, I expect some tiny fixable problem)


This was wrong alert, the only problem I see the plugin is skipping auto high priority for prores in avi, but I still can open it with "open" dialog.

smok3
2nd November 2016, 14:09
Some Linux/OSX notes (http://brontosaurusrex.github.io/2014/10/cut-parts-of-video-on-linux-mpv-player-ffmpeg-2014/) on the subject.

easy2Bcheesy
2nd November 2016, 16:23
Yeah the programs I use require VFW codecs by the looks of things, so LAV doesn't help much. And LAV is maxing out an overclocked 5960X when playing 4K 60Hz footage on DirectShow-capable tools (ie Media Player Classic).

In Premiere, CPU usage is at around 50% and actually an overclocked i7 3770K is playing 4K60 clips on the timeline straight off a USB SSD with no problem whatsoever, so the decoder there is first class.

I gave Quicktime a whirl - the problem there is that I can't seem to move frame by frame in the way I can with VirtualDub. Same with XMedia Recode.

I can try DNxHD as an alternative - that has pretty robust AVI support doesn't it? Got to stress though - AVI isn't a must, it would just be convenient. Just a Direct Stream Copy tool that produces files that work will do me!

poisondeathray
2nd November 2016, 16:32
I gave Quicktime a whirl - the problem there is that I can't seem to move frame by frame in the way I can with VirtualDub. Same with XMedia Recode.


arrow keys for QT

I don't think xmediarecode has a keyboard shortcut, you push the frame advance button in the GUI




I can try DNxHD as an alternative - that has pretty robust AVI support doesn't it? Got to stress though - AVI isn't a must, it would just be convenient. Just a Direct Stream Copy tool that produces files that work will do me!

DNxHD is mxf or mov only

But windows and mac version of PP can smart render DNxHD (only mac version can smart render ProRes)

SeeMoreDigital
2nd November 2016, 19:35
Hi easy2Bcheesy,

Out of interest... Have you tried re-muxing your 'pro-res.mov' contained files into the .mkv container before opening them with VirtualDub?


Cheers

easy2Bcheesy
2nd November 2016, 22:58
Hi easy2Bcheesy,

Out of interest... Have you tried re-muxing your 'pro-res.mov' contained files into the .mkv container before opening them with VirtualDub?


Cheers

No, what's your thinking here?

poisondeathray
2nd November 2016, 23:52
If AVI support was important, I would also consider cineform . It would be the windows "AVI" equivalent of prores , dnxhd , in terms of intermediate, near lossless editing codecs

It wasn't clear where this was going to be used (e.g. was prores/dnxhd from a camera recorder etc... because hardware cineform recorders are much more expensive)

easy2Bcheesy
3rd November 2016, 00:25
Yeah I'm using a hardware camera recorder (Shogun Inferno) that supports ProRes and DNxHD. CineForm would be my codec of choice though previously, I've noted that the DirectShow CFHD encoder uses both I and P frames, so it's not good for the frame accurate cuts I need, while the VFW codec lacks functionality and speed. But still, CFHD isn't an option with the Shogun.

While AVI is nice, it's not essential. I just need a tool where I can drag and drop a MOV, select a range of frames with precision knowing exactly how many are selected, then save out the contents without re-encoding. Maybe I should just use shekh's vdub, then knock up a simple ffmpeg drag and drop tool for muxing back into MOV.

easy2Bcheesy
5th November 2016, 15:47
MXF files seem to be even more horrible to deal with than ProRes MOVs.

Sort of dumbstruck that a simple task like this can't be easily handled.

So it looks like using Shekh's VirtualDub and remuxing with FFMPEG is the only way forward?

dipje
5th November 2016, 17:55
In Premiere and such, isn't it called 'smart rendering' when it detects nothing changed to the frame so it could just copy input to output untouched? I think Prores is 'keyframe only' so should be OK.

What I don't get, what's up with the AVI container? If I use VirtualDubFilterMod or whatever it's called (a recent build with the directstream-copy support) I can just open the Prores .mov, set start- and endframes, take direct-stream copy in audio and video, then go to File ->Export -> Stream-copy. It asks the filename for the target _.MOV_ file, and in a second I have a .mov with just the frames I selected. Isn't that just what you want?

Those Prores .mov files play back fine in a recent MPC-HC here (people still use ffdshow since LAVfilters are around?), and MPC-HC has LAVFilters built-in so need to install codecs for Prores playback anyway.
The only Prores support that might show issues in certain builds (but seem to work fine in recent ffmpeg / ffprobe commandlines) is the Prores 4444 XQ variant. Those have a AP4X vtag (if I'm not mistaken) which is not recognized by LAVfilters / MPC-HC. But using a hexeditor to change the last occurrence of 'ap4x' to 'ap4h' gives it the vtag of Prores 4444 and it plays back fine in MPC-HC / LAVFilters, and in all those cases the files open fine in After Effects (so I guess Premiere as well?). The only difference between 4444XQ and 4444 is the bitrate limits during encoding, nothing else, same codec.


After some testing:
I did notice a weird thing now in testing this. I have a Prores 4444 (AP4H) source file, I open it in VDFilterMod, set start + end and set directstream copy, use the file->export->stream copy to save another .mov. That .mov is done in under a second so it can't be re-encoding, but the new file has a vtag of APCH (Prores 422 HQ) ?! The bitrate is still the same so it did stream-copy the video data, it just writes the wrong codec-information :(.
Also, when opening the in After Effects, the video works _sort of_. It seems the timecode information is still copied over, so if I copied from 00:10s to 00:30s in a separate file, that separate file now has 10s of blackness and then the video starts from the point which I selected. Not really what you want I guess.

How did you even manage to get Prores in AVI, because if I try to use the regular File -> Save As (AVI) VDFilterMod gives me an error that Prores is incompatible with AVI and doesn't start.

Follow up:
I myself took a newer update from VDFilterMod and now I can save the stream-copy thing directly to .AVI (which plays back fine in MPC-HC here btw!). I indeed need to remux that to .mov with ffmpeg (-i <file> -vcodec copy -acodec copy -f mov -y <output file>, it's quite simple :)).

The File->Export->Stream-copy thing still has the same issues as before. It does save a .MOV, but somehow writes a Prores 422 header while I didn't start with that. And the timecode is still in there.
If I remux that output-MOV file with ffmpeg and saying -timecode 00:00:00 the video starts at the _second frame_ (so I still get a single black frame in front) instead of like 10 seconds of black if I cut there.
So that's not perfect at all. Save-as-AVI and then remux to .MOV actually gave me the best end-result (no black frames in front, correct Prores header-types, etc..). But you might have lost some metadata of the original .mov, but I don't know if that's interesting to you or not.

The only thing I noticed (I have miraizon Prores codecs installed in windows) is that the Prores-in-AVI file opens fine in After Effects, even showing 'trillion of colours' so it recognizes the 10bit part. So I don't even have to remux to .mov in this case, .avi works fine for me. I don't know if this is the same with the (sort of new) native Prores decoders built-in into After Effects (and I don't know how Premiere / Media Encoder respond to this, their media-engines are not 100% the same)

I also did the File->Export->Stream-copy test with a DNXHD-444 file in .MOV but it basically does the same thing. I end up with a .MOV file that plays back fine (and does appear as the correct codec this time) but opening it in After Effects shows the video starting with a lot of black in front (the part I cut out), but the audio starting from the start, so they're out of sync.

TL;DR -> VDFilterMod stream-copy with 'save as avi' and then remux to .mov (if you need to) seems the best bet, and both the .avi as the .mov play back fine in MPC-HC here.

shekh
5th November 2016, 19:33
I also noticed issue with timing (Export->Stream Copy)
And I also can see the issue with ap4h->apch change.
Both issues are not big deal, will update soon.

Blue_MiSfit
5th November 2016, 23:25
QuickTime Pro will let you losslessly cut ProRes files.

ffmpeg can do this too, just do something like this:

<cut from 1 minute to 2 minutes>
ffmpeg -ss 60 -i input.mov -t 60 -c copy output.mov

shekh
7th November 2016, 11:58
I also noticed issue with timing (Export->Stream Copy)
And I also can see the issue with ap4h->apch change.
Both issues are not big deal, will update soon.

Fixed this and something else, so "Export->Stream Copy" should be more useful now.

dipje
8th November 2016, 02:35
While ffmpeg can accurately cut these days, I thought the poster wanted something of a quick and easy GUI for this. Finding out times and putting them in the command line is a bit cumbersome.

If vdfiltermod has improved streamcopy now it might be a winner :). Will try soon .

shekh
8th November 2016, 13:04
Yes I made it to get rid of command line -c copy.
Unfortunately the behavior of "Stream Copy" is not exactly as "ffmpeg -c copy" because ffmpeg.exe has some obscure "business logic" on top of FFMPEG API which is not exposed.
So trial and error way is expected to continue

Reel.Deel
9th November 2016, 14:36
Has anyone tried LosslessCut: https://github.com/mifi/lossless-cut

StainlessS
10th November 2016, 01:48
Has anyone tried LosslessCut: https://github.com/mifi/lossless-cut

Well it certainly dont work on XP32.

manolito
10th November 2016, 04:23
Well it certainly dont work on XP32.

That was the first thing I noticed, too...:devil:

I then downloaded the current 64-bit version and ran it under Win7 64-bit. This is what I found:

The input format support is limited. A Youtube FLV file was not recognized, I had to repack it to MP4 or MKV. I also tried two ProRes sample files unsuccessfully.

Otherwise the software is straightforward, very fast and easy to use. It does have some limitations, so it can only cut at key frames. It also can only export one chunk at a time. If you need to edit out commercials you need to export the parts you want to keep one by one, then you must join these parts later using a software like mkvmerge.


Cheers
manolito

Reel.Deel
10th November 2016, 04:35
Well it certainly dont work on XP32.

No surprise there, there's a witch-hunt out for XP users. :p

The input format support is limited.

The project is fairly new, hopefully it'll get better with time.