PDA

View Full Version : ITU 607/701, PC vs. TV Scale how to handle?


Selur
2nd January 2011, 10:39
How do you handle ITU 607 vs. 701 and PC vs. TV Scale during video conversions in linux?

Afaik there's no option in ffmpeg or mencoder to handle these 'problems'. Is the only way to use wine + avisynth + colormatrix or did I miss an option in ffmpeg/mencoder?
(iirc ffmpeg an mencoder both always output pc scale,..)

Cu Selur

Ps.: I'm more interested in the PC vs. TV Scale handling.

Yellow_
2nd January 2011, 15:04
AFAIK FFMPEG will just pass the levels through if you're staying YCC but if you are going to RGB you can handle all with FFMPEG's SWSCALE options except forcing luma.

The Full Range option is in SWSCALE but unused / disabled presently I think.

Can you explain further what your looking for? What you are using to determine what your levels are.

Selur
2nd January 2011, 15:18
So this means:
1. it's not possible with ffmpeg unless one patches the source and compiles ffmpeg manually?
and
2. most of the video conversions on linux systems do use wrong color informations?

Cu Selur

nm
2nd January 2011, 17:17
2. most of the video conversions on linux systems do use wrong color informations?

Usually a luma/color level change is not needed unless switching between RGB and YUV. So, as Yellow_ said, if you encode YUV video that has studio (TV) levels with MEncoder or FFmpeg, the output will have the same levels as the input. AFAK, swscale will only convert to full range if you change the colorspace to RGB.

Post a sample clip if you have problems with a particular video.

Selur
2nd January 2011, 17:31
Post a sample clip if you have problems with a particular video.
It's not a particular video more that I want to have the ability to specify if the output should be TV or PC scale,..
i.e. if I want to later merge CG (PC scale) and DV (TV scale) material it would be nice to be able to:
1. convert the tv scale samples so that they end up being pc scale
2. convert the pc scale samples so that they end up being tv scale

Usually a level/color matrix change is not needed unless switching between RGB and YUV.
What about bt601 and bt709?
i.e. http://www.x264bluray.com recommends to use:
--colorprim "bt709" --transfer "bt709" --colormatrix "bt709" for HD
and
--colorprim "smpte170m" --transfer "smpte170m" --colormatrix "smpte170m" for SD Material
so if your input doesn't have the required color format one has to change it, right?

Cu Selur

nm
2nd January 2011, 17:38
so if your input doesn't have the required color format one has to change it, right?

Sure. I'm only saying that these cases hardly cover "most of the video conversions".

I'd think FFmpeg and MPlayer developers would accept a proper patch that enables level changes through the command line.

Selur
2nd January 2011, 19:09
Sure. I'm only saying that these cases hardly cover "most of the video conversions".
Sure, nobody ever wanted to do "most of the video conversions".
Nowadays most video conversions are probably done my youtube and other video portals and that's definitively not my goal. :)

I'd think FFmpeg and MPlayer developers would accept a proper patch that enables level changes through the command line.
Thanks, good to know. Just wanted to know what's possible atm. with currently existing linux tools. :)

Cu Selur

Ps.: If anyone else knows a linux tools that capable of doing such conversions please post. :)

ganymede
3rd January 2011, 00:32
If anyone else knows a linux tools that capable of doing such conversions please post.Version 0.6.0 of MLT is just out and it's changelog (http://sourceforge.net/news/?group_id=96039&id=295766) says :* Added Y'CbCr colorspace conversion and option to use full luma range.Didn't test it yet though.
MLT is a multimedia framework built over ffmpeg / libavcodec, serves as the basis of video editing software like kdenlive and includes a standalone commandline application (melt).

Selur
3rd January 2011, 00:35
Cool will look at it! Thanks for the info ganymede. :)
-> nice they are even working on a mingw windows port (if that's available I might end up rewriting Hybrid or write a separate gui to use it)

Cu Selur

Yellow_
3rd January 2011, 09:22
Version 0.6.0 of MLT is just out and it's changelog (http://sourceforge.net/news/?group_id=96039&id=295766) says :Didn't test it yet though.
MLT is a multimedia framework built over ffmpeg / libavcodec, serves as the basis of video editing software like kdenlive and includes a standalone commandline application (melt).

hehe, really appreciated Dan doing those additions. ;-)