Page 1 of 2

Red Camera Files

Posted: Tue Nov 10, 2020 4:49 am
by mgm21m
Hi all

I was wondering if FFAStrans can encode R3D files that's generated from Red Cinema Cameras

Thanks

Re: Red Camera Files

Posted: Tue Nov 10, 2020 12:03 pm
by ThomasM
Hi mgm21m,

you are asking
encode R3D files that's generated from Red Cinema Cameras
- do you mean DECODE?

as to my knowledge FFMPEG (the coder / decoder of FFAStrans) is able to decode some of the Red-formats but not the latest. Depending on your Camera-Model / used Red-format you can use any encoder-node in FFAStrans to decode the Material to another CoDec.

cheers,
tom

Re: Red Camera Files

Posted: Tue Nov 10, 2020 12:18 pm
by FranceBB
In terms of .r3d files, there's technically a way to index them, but it's not gonna be frame accurate.
Please note that .r3d are raw files with a proprietary codec made by RED specifically for NLE like AVID etc.
There isn't an open source indexer like LWLibav or FFMpegSource2 that can index them, however you can use a "workaround" with DirectShow.
DirectShowSource basically uses the built-in DirectShow of your OS (Windows) and opens it in Avisynth as frameserver.
It's literally just asking the Operative System to use whatever codec it has to decode the file and then "pipe" the output to Avisynth so that it can be used in the frameserver.
So, as long as you're gonna be able to decode those files in the Operative System, you're gonna be able to use DirectShowSource.
To decode them, you're gonna need to install the official RED Codec Package provided with your camera and then use an Avisynth Script to decode the files you pick with something like DirectShowSource("myredfile.r3d", audio=true) but:

A) It's gonna be limited to a small number of color spaces and 8bit only
B) It's not gonna be frame accurate, in the sense that it might drop frames every now and then due to DirectShow itself
C) You're gonna lose all the metadata and it won't apply any kind of LUT or anything to your file

I think it would be way better to link and transcode it using a NLE like AVID Media Composer, Davinci Resolve etc as that's the way the official codec is supposed to be used and you will be able to choose the settings and use all the benefit of that codec.
So, in a nutshell: yes, it can be done, no, it's not implemented by default for a reason: DirectShowSource and the fact that you would have to install a codec anyway.

Re: Red Camera Files

Posted: Tue Nov 10, 2020 12:54 pm
by Ghtais
Hi

Very interesting post !!
As I understand directShowSource could be used like the Quicktime ref Avisynth decoder for FFAStrans ?
When you said that it's not gonna be frame accurate does it mean with every kind of frame rate or only with drop frame rate like NTSC ?

Thank you

Re: Red Camera Files

Posted: Tue Nov 10, 2020 9:54 pm
by FranceBB
Ghtais wrote: Tue Nov 10, 2020 12:54 pm Hi

Very interesting post !!
As I understand directShowSource could be used like the Quicktime ref Avisynth decoder for FFAStrans ?
When you said that it's not gonna be frame accurate does it mean with every kind of frame rate or only with drop frame rate like NTSC ?

Thank you
Well, it relies on the decoder, so it relies on the codec installed and whatever decoder is using, so that's a thing.
The other thing is that DirectShowSource is known not to be frame accurate per se, in the sense that it might randomly skip frames as well.
A quick example would be to move through the script using AVSPmod and trying to focus on a few frames going back and forth several times: it's almost always the case that as you get back to where you were before, you're not gonna see the very same frame. This is because it relies on DirectShow which gets the input from the decoder installed with the codec, so you don't really have a proper indexer with an index file, but rather a "stream" produced on the fly on which Avisynth has no control.

You could easily test it yourself using Seek Tester for Avisynth and comparing things like LAV via DirectShowSource, LWLibavVideoSource via LSMASH.dll and FFMpegSource2 via ffms2.dll on a simple file like an H.264.

Unfortunately, when there are alternatives, it's always better to go with proper indexers like LWLibav, DGDecode, FFMpegSource2 etc, but sadly when there aren't any, like in this case, then all you're left with is DirectShow...

As a side note, my reply is more to say that it can be done, rather than to encourage anyone on doing it, 'cause, as I said, there are many issues with DirectShowSource, so I would really advice people to use it as a last resort and to rely on NLE in this case, especially 'cause things like Avid are the ones certified by RED itself. (and this is a rather uncommon statement from me, as I'm truly passionate in open source alternatives)...

p.s there's also this indexer in Avisynth, although it's outdated and is probably not going to work with modern RED Cameras... http://web.archive.org/web/201201240109 ... isynthr3d/

Re: Red Camera Files

Posted: Wed Nov 11, 2020 8:41 am
by Ghtais
ok, thank you :)

Re: Red Camera Files

Posted: Wed Nov 11, 2020 12:21 pm
by emcodem
Hmm i just had a look and didnt find any suitable directshow codecs from red itself. All other references to a possible directshow codec seem to be obsolete.

The only option i currently see to work with r3d files from ffastrans is to use the commandline tool that comes with their software: "REDCINE-X PRO 64-bit\REDline.exe"

At least this way there dont seem to be any drawbacks like not being able to use the HDR, lut and such...

Example for commandline processor (generates lowres copy/h264 version):

Code: Select all

cmd /C ""C:\Program Files\REDCINE-X PRO 64-bit\REDline.exe" --resizeX 1920 --resizeY 1080 --format 11 --QTcodec 2 -i "%s_source%" -o "%s_source%_lowres""

Re: Red Camera Files

Posted: Sat Nov 21, 2020 11:34 am
by mgm21m
Hello guys
sorry I didn't open the forum for couple of days and I didn't see the replies.

currently I'm using Adobe Media Encoder to convert the R3D files, but due the lack of web interface and using only one instance of converting, I want to use Ffastrans
I will try to use command line and I will tell you the result

Re: Red Camera Files

Posted: Sat Nov 21, 2020 12:23 pm
by mgm21m
Hello Again ,, I tested the commandline processor ,, It's working but it's really slow, media encoder is much faster, consumption of memory is huge also for no reason.
can I use the commandline Processor with adobe media Encoder, to submit the jobs to it?

Re: Red Camera Files

Posted: Sun Nov 22, 2020 10:31 pm
by emcodem
Yeah i am sorry but there is no known to me way to anyhow use Adobe Media Encoder programatically, not the codecs nor the engine itself. They just dont want this to be done currently. If they did, we would happily provide some processor for it, believe me.
Also Red does not allow their codecs to be shipped with ffmpeg which would be the best option for everyone, but they do provide their commandline tools so this is the way to go.

Basically above i just gave you some idea how to automate the tool from Red in ffastrans. As i dont know what exactly you want to output, i cannot tell you if the tool can do faster or not... But i can explain how i would go on if i was you:

Check out some options for the tool from red and try them on commandline (before automating it in ffastrans), or even better in the RED Cine-X GUI. First i would concentrate on finding an alternative to the format and codec setting that i provided as it uses windows quicktime player which is outdated anyway (and slohooow). E.g. if you can, go with a prores proxy format. Then i would concentrate on the scaling, e.g. use the setting 4 which means "fast" from Red's perspective.

Most obvious would be to try speeding up the red rendering and choose a fast resizer

Code: Select all

--res 4 --filter 0
, maybe the --enableGpuDecode option helps and also check to see if you find another codec thats faster and still fits your needs.

Note that if you use the format 11, then you have to use --QTcodec to choose the "codec", while when you use 201, then you have to use --PRcodec

Code: Select all

--format <int>        - output formats, DPX = 0, Tiff = 1, OpenEXR = 2, JPEG = 3, SGI = 4, QT wrappers=10, QT transcode=11, AVI=202, R3D Trim = 102, REDray=104, Apple ProRes=201, Avid DNX = 204, [default = DPX]
Some excerpt but sure not all interesting options.

Code: Select all


--res <int>           - Render resolution: full = 1, half high = 2, half normal = 3, qtr/fast = 4, eighth = 8 [default = 1]


--filter <int>        - filter using: [default = 5 (CatmulRom)]
                                 0 = Bilinear (fastest
                                 1 = Bell (smoother)
                                 2 = Lanczos3 (sharper)
                                 3 = Quadratic (smoother)
                                 4 = Cubic-bspline (smoother)
                                 5 = CatmulRom (sharper)
                                 6 = Mitchell (smoother)
                                 7 = Gauss (smoother)
                                 8 = WideGauss (smoothest)
                                 9 = Sinc (sharpest)
                                 10 = Keys (sharper)
                                 11 = Rocket (sharper)

QuickTime Transcode Settings:
--QTcodec <int>       - QT codec to output [default = ProRes HQ]
                                 0 = Apple ProRes 422 HQ
                                 1 = Apple ProRes 422
                                 2 = H264
                                 3 = MJpegA
                                 4 = MJpegB
                                 5 = ComponentVideo
                                 6 = H263
                                 7 = RawCodec
                                 8 = Pixlet
                                 9 = DVCPROHD720P
                                 10 = JPEG
                                 11 = Animation/RLE
                                 12 = Uncompressed 8-bit 4:2:2
                                 13 = Uncompressed 10-bit 4:2:2
                                 15 = Black Magic RGB 10bit
                                 17 = AJA Kona 10bit Log RGB
                                 18 = AJA Kona 10-bit RGB
                                 20 = AVID 1080P DNxHD 36 8-bit      (23.98, 24, 25)
                                 21 = AVID 1080P DNxHD 115/120 8-bit (23.98, 24, 25)
                                 22 = AVID 1080P DNxHD 175/185 8-bit (23.98, 24, 25)
                                 23 = AVID 1080P DNxHD 175/185 10-bit(23.98, 24, 25)
                                 24 = AVID  720P DNxHD 60/75 8-bit   (23.98, 25, 29.97)
                                 25 = AVID  720P DNxHD 90/110 8-bit  (23.98, 29.97)
                                 26 = AVID  720P DNxHD 90/110 10-bit (23.98, 29.97)
                                 27 = AVID  720P DNxHD 120/145 8-bit (50, 59.94)
                                 28 = AVID  720P DNxHD 185/220 8-bit (50, 59.94)
                                 29 = AVID  720P DNxHD 185/220 10-bit(50, 59.94)
                                 30 = Apple ProRes 4444
                                 31 = Apple ProRes 422 LT
                                 32 = Apple ProRes 422 Proxy

Apple ProRes Settings:
--PRcodec <int>       - ProRes Codec to output [default = ProRes 422HQ]
                                 0 = Apple ProRes 422 HQ
                                 1 = Apple ProRes 422
                                 2 = Apple ProRes 422 LT
                                 3 = Apple ProRes 422 Proxy
                                 4 = Apple ProRes 4444
                                 5 = Apple ProRes 4444 XQ