Real-time Editing w/ Premiere Pro CS4 and Vegas

Real-time Editing w/ Premiere Pro CS4 and Vegas

Postby jcs on 26 Jun 2009 02:56

Real-time Editing with Premiere Pro CS4.1, Vegas, and other NLE's which can read MP4 files

[Note: real-time editing is only possible with sufficiently fast PCs. Current MP4 decompressors can be unstable. See an alternate method, including full-resolution real-time editing here: viewtopic.php?f=29&t=3871).

1. Install FFMpeg. You can get the latest build here: http://tripp.arrozcru.org/
2. Copy the code below into .bat (batch) files. Edit the scripts to point to your ffmpeg.exe. Change the "threads" count to match the number of cores on your computer.
3. Make a directory called MOV in the same dir as the .bat file(s) and copy all MOV files there.
4. Run the mf.bat batch file (and proxy version(s), if needed).
5. Import the "Full" dir into Premiere. You may need to tell PPro to use a 1.0 aspect ratio for each MP4 (IIRC, you can select them all and do this just once).
6. Create a 960x540 timeline, and do your edits there. Make sure "Scale to Frame Size" is selected for all clips.
7. Create a 1920x1080 timeline and copy paste your final edit there. Right-click on all clips and make sure Scale to Frame Size is selected (should fix any coordinate issues; should fix any title issues).

You should be able to have smooth editing in a 960x540 timeline, sometimes even in a 1920x1080 timeline (not full speed, but usable most of the time). The script below will give you 512kbps AAC audio as part of the new MP4 file (with unchanged video footage) as well as the original unchanged audio in separate wave files (in the WAV dir, see script below).

Full res video (not transcoded. Note that the "threads" argument probably doesn't improve performance in this case as the video is not transcoded. I left it enabled in case the AAC compressor is multithreaded):

Edit: here's a link to the script files: https://cid-a218911273df094b.skydrive.l ... cripts.zip

Make Full

mf.bat
Code: Select all
set ffmpeg="c:\ffmpeg\ffmpeg.exe"
if not exist Full\nul mkdir Full
for %%I in (MOV\*.MOV) do if not exist "Full\%%~nI.mp4" %ffmpeg% -y -i "%%I" -vcodec copy -aspect 16:9 -acodec libfaac -ab 512k -threads 4 "Full\%%~nI.mp4"
if not exist WAV\nul mkdir WAV
for %%I in (MOV\*.MOV) do if not exist "WAV\%%~nI.wav" %ffmpeg% -y -i "%%I" -vn -acodec copy "WAV\%%~nI.wav"


If full res video won't play back fast enough, try a smaller proxy. You can change the directory when ready to render final and reopen the project (using the full res MP4s).

Make Proxy

mp.bat
Code: Select all
set ffmpeg="c:\ffmpeg\ffmpeg.exe"
if not exist Proxy\nul mkdir Proxy
for %%I in (MOV\*.MOV) do if not exist "Proxy\%%~nI.mp4" %ffmpeg% -y -i "%%I" -vcodec libx264 -s 960x540 -aspect 16:9 -b 4000k -acodec libfaac -ab 160k -threads 4 "Proxy\%%~nI.mp4"


On my 2006 4x3GHz MacPro with ATI X1900, editing is fast enough/usable in a 960x540 timeline with the full-res MP4s. If working with After Effects, using 640x360 proxies makes sense (real-time performance in AE is possible!):

Make Proxy Low

mplow.bat
Code: Select all
set ffmpeg="c:\ffmpeg\ffmpeg.exe"
if not exist ProxyLow\nul mkdir ProxyLow
for %%I in (MOV\*.MOV) do if not exist "ProxyLow\%%~nI.mp4" %ffmpeg% -y -i "%%I" -vcodec libx264 -s 640x360 -aspect 16:9 -b 2000k -acodec libfaac -ab 128k -threads 4 "ProxyLow\%%~nI.mp4"


Process All

process.bat
Code: Select all
call mf.bat
call mp.bat
call mplow.bat


If using only one proxy size, delete the appropriate line from process.bat.

Switch between Full and Proxy (change as needed if using ProxyLow)

switchEdit.bat
Code: Select all
ren Proxy _Proxy
ren Full Proxy
ren _Proxy Full
dir Full
pause


To use switchEdit: quit PPro and run switchEdit.bat. Restart PPro and reload your project. In this way you can quickly switch between Full and Proxy editing.
Last edited by jcs on 13 Jul 2009 06:17, edited 6 times in total.
User avatar
Posts: 364
Joined: Apr 2009
Location: Beverly Hills, CA
jcs
Defeats Red
Defeats Red

Re: Here's how to get Real-time Editing with Premiere Pro CS4

Postby mcgeedigital on 26 Jun 2009 03:05

Jeebus that's a lot of unnecessary hoops to jump through. Ugh.
User avatar
Posts: 167
Joined: Jun 2009
Location: Alexandria, VA
mcgeedigital
Executive Member
Executive Member

Re: Here's how to get Real-time Editing with Premiere Pro CS4

Postby jcs on 26 Jun 2009 03:25

mcgeedigital wrote:Jeebus that's a lot of unnecessary hoops to jump through. Ugh.


It's much faster (especially if not using proxies) than transcoding to another format, and preserves 100% quality. Is there a better way? On the OS X side in FCP, I can edit the 5D MOVs without transcoding (but transitions/effects must be rendered). I paid for Neoscene: transcoding is slower, it forces 29.97 for 5D footage (I need to work in 30p), and creates much larger files. I do use Neoscene for 60i=>24p for Canon HF11 footage (AVCHD).

To make simpler, here's a zip of the script files: https://cid-a218911273df094b.skydrive.l ... cripts.zip
User avatar
Posts: 364
Joined: Apr 2009
Location: Beverly Hills, CA
jcs
Defeats Red
Defeats Red

Re: Here's how to get Real-time Editing with Premiere Pro CS4

Postby Tom Frisch on 26 Jun 2009 06:00

Can you explain what that script is doing? Are you re-encoding to smaller resolution mp4 files?

-Tom
User avatar
Posts: 56
Joined: Mar 2009
Tom Frisch
Pro Member
Pro Member

Re: Here's how to get Real-time Editing with Premiere Pro CS4

Postby jcs on 26 Jun 2009 08:10

Tom Frisch wrote:Can you explain what that script is doing? Are you re-encoding to smaller resolution mp4 files?


mf.bat rewraps the H.264 video (no resolution change nor recompression) and encodes the audio as AAC (required for the MP4 container). This allows PPro to use a faster H.264 decoder.
The other two scripts create lower resolution proxies, which can easily be switched with the full resolution video (without renaming files: only renaming a directory and reloading the PPro project).
The original, uncompressed audio is also saved as WAV files.

The scripts operate on all files in the MOV directory: run the script once and all the files are converted. New MOV files can be added to the MOV directory and the script can be run again, only converting the new files. Very fast and easy to use in practice.
User avatar
Posts: 364
Joined: Apr 2009
Location: Beverly Hills, CA
jcs
Defeats Red
Defeats Red

Re: Here's how to get Real-time Editing with Premiere Pro CS4

Postby Formosa on 27 Jun 2009 01:19

Hi JCS

Thankyou so much for providing such a good script for trancoding the mov file to mp4.

After some hastle, I finally managed to made the script works,I am not faminlar with scripting, just following your instruction and it works. :cheers:

I haven't tried the mp and mplow script yet, but now I got a trancoded MP4 file whcih can be played smooth in PowerDVD9, with sound! :dance:

I haven't played deeply the MP4 file in PPro CS4.0. My version is still 4.0. but the program reported the trancoded file as 1920 x 1088. and the file appeared compreseed horizontally and not play smoothly in PPro as well. (my machine is a cenntrino2 P8600 2.4G notebook)

Is 1920 x 1088 a normal figure for the transcoded file?

What is the number of thread my CPU offer? I now set the number of thread to 2 in the scripting

Thanks for your help.

Regards

Formosa
User avatar
Posts: 11
Joined: Jun 2009
Formosa
New Member
New Member

Re: Here's how to get Real-time Editing with Premiere Pro CS4

Postby jcs on 27 Jun 2009 04:04

Formosa wrote:I haven't played deeply the MP4 file in PPro CS4.0. My version is still 4.0. but the program reported the trancoded file as 1920 x 1088. and the file appeared compreseed horizontally and not play smoothly in PPro as well. (my machine is a cenntrino2 P8600 2.4G notebook)

Is 1920 x 1088 a normal figure for the transcoded file?

What is the number of thread my CPU offer? I now set the number of thread to 2 in the scripting


Hi Formosa- glad to hear it worked well for you :cheers:
It sounds like your machine is dual core, so setting threads to 2 is good.
To fix the size issue of the "Full" MP4 files (non-transcoded video, just re-wrapped into an MP4 container), right click on the files in PPro and manually set ("Interpret") the Aspect Ratio to 1.0. Don't worry about the 1920x1088 reported by PPro (appears to be a bug): it is actually 1920x1080.
The proxies won't have the aspect ratio or incorrectly reported size issue.

If it won't play smoothly in a 1920x1080@30p timeline (sequence), try a 960x540 timeline (with the "Full" MP4 files). If that won't play smoothly, use the 960x540 proxy MP4 files (remember it's easy to switch to the full version for final rendering).
User avatar
Posts: 364
Joined: Apr 2009
Location: Beverly Hills, CA
jcs
Defeats Red
Defeats Red

Re: Here's how to get Real-time Editing with Premiere Pro CS4

Postby Formosa on 27 Jun 2009 04:36

jcs wrote:
Hi Formosa- glad to hear it worked well for you :cheers:
It sounds like your machine is dual core, so setting threads to 2 is good.
To fix the size issue of the "Full" MP4 files (non-transcoded video, just re-wrapped into an MP4 container), right click on the files in PPro and manually set ("Interpret") the Aspect Ratio to 1.0. Don't worry about the 1920x1088 reported by PPro (appears to be a bug): it is actually 1920x1080.
The proxies won't have the aspect ratio or incorrectly reported size issue.

If it won't play smoothly in a 1920x1080@30p timeline (sequence), try a 960x540 timeline (with the "Full" MP4 files). If that won't play smoothly, use the 960x540 proxy MP4 files (remember it's easy to switch to the full version for final rendering).


Hi JCS.

Thanks for your quick reponse. I am just a begineer of using the PPro, I need to study further.

I restarted the PPro, this thime I create a new sequence by using a 720P @ 30fps, is that what you meant "timeline"? am my procedure correct?

I interpreted the file and now the aspect issue fixed, thanks, it play a little bit faster, but far far from smooth, perhaps it is because my machine not fast enough.

There is another thread discussing the 5DII video codec, also mentioned 1920 x 1088, don't know if there is any corelation: viewtopic.php?f=14&t=3526

Regards

Formosa
User avatar
Posts: 11
Joined: Jun 2009
Formosa
New Member
New Member

Re: Here's how to get Real-time Editing with Premiere Pro CS4

Postby jcs on 27 Jun 2009 07:35

Formosa wrote:I restarted the PPro, this thime I create a new sequence by using a 720P @ 30fps, is that what you meant "timeline"? am my procedure correct?


Try creating a 960x540@30p sequence ("Desktop Editing Mode") instead of 720p. Also, give the mp.bat script a try and import the new "Proxy" dir into PPro . Place clips from the Proxy dir into the 960x540 sequence. If you can run acceptably smooth with those settings, you can use the switchEdit.bat script as outlined above to switch between Full and Proxy.

If mp.bat (960x540 Proxy files) is not fast enough, try mplow.bat (640x360 Proxy files). 640x360 is probably good enough for editing on a laptop (at least to get most of the editing done). You can always switch up to 960x540 for more detailed work, then finally 1920x1080 (Full) for final render.

Re: 1920x1088 for the "Full" MP4s: not possible- the video has not been transcoded. It's still 1920x1080, the same way the pixel aspect ratio is really 1.0. Open one of the MP4's in QuickTime and look at the Movie Inspector: it shows 1920x1080. 1920x1088 displayed in PPro is a bug: you can ignore it.
User avatar
Posts: 364
Joined: Apr 2009
Location: Beverly Hills, CA
jcs
Defeats Red
Defeats Red

Re: Here's how to get Real-time Editing with Premiere Pro CS4

Postby Formosa on 29 Jun 2009 00:58

[quote="jcs"]

Try creating a 960x540@30p sequence ("Desktop Editing Mode") instead of 720p. Also, give the mp.bat script a try and import the new "Proxy" dir into PPro . Place clips from the Proxy dir into the 960x540 sequence. If you can run acceptably smooth with those settings, you can use the switchEdit.bat script as outlined above to switch between Full and Proxy.
[quote]

Thanks, done more research, bought a book to read, but the book never talk about proxy editing, shame. Now I set a project using desktop editing mode, I am now using 640x360, it works smoothly.

I rewrapped using your script a few clips, but don't know why, 1 clip recognized by PPro as 16:9 and other are not, those not recognized as 16:9 need to set manually. need to do some test. If there is a way to avoid setting the proxy aspect ratio manually through the script that will be perfect.

Also tried switching between proxy and the full clips within PPro, it works and it is very convenient. But I need some more exercise to learn more.

Now I am up to exporting the finished sequence. which is the best set up for the best image quality as close as to the original MP4?

Do PPro have some sort of "smart rendering" like some other editing software? I mean a function which only render those editing portion of the clip and direct copy those un-edited portion, which maintain the original quality and increase the rendering speed.

Regards

Formosa
User avatar
Posts: 11
Joined: Jun 2009
Formosa
New Member
New Member

Next

Return to Editing on a Pc

Who is online

Users browsing this forum: No registered users and 2 guests

cinema5d.com - The forum for dslr filmmakers - Canon 5D mark II questions and answers - This is the 5Dmk2 community - cinema 5D - The 5DmkII resource - 5D2