Ok, it appears to me that we have a hit a road block in terms of what I can do to extract the Luma channel from the v210 encoded sequences.
Do you recommend any other tools I could use? Maybe VirtualDub or AviSynth or any other?
I have two goals in mind:
1. Extract Luma channel from the v210 sequences
2. Extract 10/16 bit video planes (RGB or YCbCr) and export as image sequences. Possibly combine them back to make another v210 encoded sequence.
Although ffmpeg exploration has not completely solved the issue with well understood results, but it has been a learning experience.
I appreciate it! Thanks again!
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 31 to 48 of 48
Thread
-
-
vdub does accept v210 in 10bit, but it can only process in 8bit . Same with avisynth, which is 8bit as well (except avisynth can use a stacked 16 bit format) . But you probably don't want any of those
It should be possible with vapoursynth with a LUT, which can work in higher bit depths natively, you'd have to ask around maybe at doom9 forum
You need a Y10 format, 10bit in LSB of 16bit, which ffmpeg doesn't have
Ideally , a 1:1 mapping of values in 10bit RGB is what you want for a destination format. So 0-1023 values in Y' translate to 0-1023 values in R,G,B . The only RGB image format that I know of that can do that is a full range dpx/cineon variant . ffmpeg can't do it, and I doubt matlab can import 10bit full range dpx properly
Maybe imagemagick can do some processing here? I haven't used it too much, but it might be another option -
Thanks for a response. I will check out vapoursynth. I have not had much luck exploring it so far to figure out how to use it. There are several variants of this open source tool. I need to dig in further.
Do you think v210 AVI for 10-bit image export can be handled by FCP X or Premiere Pro? That may be an option although there is no definite answer I can find from my searches, before investing in a license.
I have both Mac and Windows machines, so AVIs should be ok to handle.
I would really appreciate any help! Thanks again. -
-
I guess we have already explored the pathway of 16-bit RGB export from V210 (4:2:2 10-bit) via ffmpeg, although it was clamping the input signal levels.
I am happy with a simple 10-bit Luma channel export from FCP or Premier Pro, if that is packed in a 16-bit word (or stretched), that is fine too. Alternatively, if I can do the same as I did with ffmpeg and do a round trip from v210 <-> 16 bit image sequences, that would also be useful.
Thanks again for your valuable inputs! I appreciate it. -
I think that was from the filter, extractplanes. I don't think the full YUV channels are clamped with the "regular" conversion
It should be possible going one way to a 16bit TIFF. Recombining it is another story - I don't know if it's possible with those programs. (ie. coming back to "map" the RGB TIFF after manipulating in matlab to to the Y' channel only of v210 +/- "copying" the U, V channels of the original v210) -
Ok, I am trying to relate this to your comparison using MD5 and SSIM when some test sequences were ending up being 'different'. I recall we were still using the extractplanes filter at that point of time. Would there be another way (that could be used), without using extractplanes and exporting the 10-bits individual luma and chroma channels? Sorry, I am not really sure what you refer to when you say 'regular' conversion.
Thank you! -
The "regular" conversion is using all Y,U,V channels and converting that to R,G,B - ie. a "typical" conversion. Not Y (only) to RGB
There seems to be something for that extractplanes filter that messes it up when it's done at >8bit depth
I looked at the filter list and I can't find anything else that might work for what you want to do. Remember earlier I said many of the filters only work at 8bit ?
https://www.ffmpeg.org/ffmpeg-filters.html
A LUT should work to make it greyscale, but I think ffmpeg only works with this filter at 8bit
https://www.ffmpeg.org/ffmpeg-filters.html#lut_002c-lutrgb_002c-lutyuv
lutyuv="u=128:v=128"
In 10bit I think it should be lutyuv="u=512:v=512" , but results are messed upLast edited by poisondeathray; 4th Sep 2014 at 15:42.
-
This seems to work almost ok in terms of levels, for png and tiff. But my gradient is truncated to 0-1019 for some reason...
Code:ffmpeg -i input.avi -pix_fmt gray16be output.png ffmpeg -i input.avi -pix_fmt gray16le output.tiff
Last edited by poisondeathray; 4th Sep 2014 at 16:26.
-
Thank you for the explanation. I will dig in a little more as per your suggestions and try these out.
I also realized that I have *.mov files in the mix. AJA MOV files which are 10-bit uncompressed v210.
I only have the option to capture in this format given the software application from AJA Systems. I also have AVI files with the same codec. I guess the container is different.
Would the same commands work with ffmpeg with *.mov files to yield similar expected results?
Thanks again.
-
Yes, same thing. v210 is uncompressed 10bit 422 video, regardless of how it's "packaged"
AVI and MOV are just "containers". You can swap between them without any loss with v210. It's like taking a "shoe" out of "box" and putting that same "shoe" into another "box". Eitherway you have the same ol shoe -
-
For example, if you wanted to re-wrap the MOV to AVI
Code:ffmpeg -i input.mov -c:v copy -c:a copy output.avi
Code:for %a in ("*.mov") do ffmpeg -i "%a" -c:v -c:a copy "%~na.avi"
-
Thanks a lot! I did finally get a chance to try this out.
One problem I run into. My AVI file is 100fps when source file is 50fps (*.MOV). I tried the first method (file by file conversion). Same is true for 59.94 fps, turns out to be close to 120 fps in AVI. (Using MediaInfo to check all this).
EDIT: Should I use the '-r 50' or '-r 59.94' option?
Also, I think I might be missing some arguments from the second way to convert all *.mov files to *.avi files. What does %a %~na mean, maybe this is basic thing that I am not familiar with. I am familiar with for loops of course in several languages. Also should it be
Code:for %a in ("*.mov") do ffmpeg -i "%a" -c:v copy -c:a copy "%~na.avi"
Last edited by lotus5; 8th Sep 2014 at 20:28.
-
That means ffmpeg "thinks" the framerate is double. You could use the -r option, but I would rule out other problems with the source video first
What does ffmpeg -i input.mov say in the console ?
The "a" is just a variable, and n is for name. See any dos reference
eg
http://www.robvanderwoude.com/ntfor.php
When using from a batch script you need double "%%", from the commandline it's a single "%"
And yes, I was missing a "copy" in that batch command -
Not sure as i did not read all messages but IMHO you should use same format to avoid processing - i assume that in Matlab each picture (raw video) can be accessed as normal unified (same size) data structure and it should be not a problem to access each plane and later save result to similar data structure that can be imported to video file.
-
Ok, thanks a lot. This is what I get from the console. I am not sure which section you may be wanting to look at. It does say 59.94 fps.
I greatly appreciate it! Thanks again!
Code:ffmpeg version 2.3.2 Copyright (c) 2000-2014 the FFmpeg developers built on Aug 14 2014 07:21:22 with Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) configuration: --prefix=/usr/local/Cellar/ffmpeg/2.3.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid libavutil 52. 92.100 / 52. 92.100 libavcodec 55. 69.100 / 55. 69.100 libavformat 55. 48.100 / 55. 48.100 libavdevice 55. 13.102 / 55. 13.102 libavfilter 4. 11.100 / 4. 11.100 libavresample 1. 3. 0 / 1. 3. 0 libswscale 2. 6.100 / 2. 6.100 libswresample 0. 19.100 / 0. 19.100 libpostproc 52. 3.100 / 52. 3.100 Guessed Channel Layout for Input Stream #0.2 : stereo Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Desktop/xxx VQM/xxx Sequences/1080p59.94/xxx_1080p5994.mov': Metadata: creation_time : 2014-09-08 19:00:36 Duration: 00:00:15.53, start: 0.000000, bitrate: N/A Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, 1920x1080, -1643410 kb/s, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 60k tbn, 60k tbc (default) Metadata: creation_time : 2014-09-08 19:00:36 handler_name : Apple Alias Data Handler encoder : 10 bit Uncompressed timecode : 00:00:00:00 Stream #0:1(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default) Metadata: creation_time : 2014-09-08 19:00:36 handler_name : Apple Alias Data Handler timecode : 00:00:00:00 Stream #0:2(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s (default) Metadata: creation_time : 2014-09-08 19:00:36 handler_name : Apple Alias Data Handler Output #0, avi, to 'Desktop/xxx VQM/xxx Sequences/1080p59.94/xxx_1080p5994.avi': Metadata: ISFT : Lavf55.48.100 Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, -1643410 kb/s, 59.94 fps, 119.88 tbn, 119.88 tbc (default) Metadata: creation_time : 2014-09-08 19:00:36 handler_name : Apple Alias Data Handler encoder : 10 bit Uncompressed timecode : 00:00:00:00 Stream #0:1(eng): Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, 1536 kb/s (default) Metadata: creation_time : 2014-09-08 19:00:36 handler_name : Apple Alias Data Handler Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #0:2 -> #0:1 (copy) Press [q] to stop, [?] for help frame= 384 fps=7.9 q=-1.0 size= 2047818kB time=00:00:06.39 bitrate=2622002.8kbits/s
Last edited by lotus5; 9th Sep 2014 at 12:15.
-
Are you sure mediainfo says 119.88? The timebase for the output is 119.88, but the FPS is 59.94 . You could use -r to force the FPS, but you shouldn't have to
Code:Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, 1920x1080, -1643410 kb/s, SAR 1:1 DAR 16:9, 59.94 fps, 59.94 tbr, 60k tbn, 60k tbc (default) Stream #0:0(eng): Video: v210 (v210 / 0x30313276), yuv422p10le, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, -1643410 kb/s, 59.94 fps, 119.88 tbn, 119.88 tbc (default)