Correct conversion of yuvj420p?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

Correct conversion of yuvj420p?

Peter B.
Hi everyone!

I've read quite a while ago that pix_fmt "yuvj420p" is deprecated, and
when trying to convert an H.264/MOV to FFV1/MKV, I get the following
message:

 > Incompatible pixel format 'yuvj420p' for codec 'ffv1', auto-selecting
format 'yuv420p'
 > [swscaler @ 0x71c9440] deprecated pixel format used, make sure you
did set range correctly

The comment in
[libavutil/pixfmt.h](https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/pixfmt.h#L78),
says:

 > AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG),
deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range


The source video is: yuvj420p(pc, smpte170m/bt709/bt709)
The output video is: yuv420p(pc, smpte170m/bt709/bt709)

What would be the right commandline to losslessly convert this to FFV1?
I've tried, but so far I get differing streamhash MD5s for the video -
regardless if I set the color range :(



Thanks in advance for any hints!
Peter B.



Here's what I've tried so far:
(Console output below)

// ----------------------------------------
FFMPEG="ffmpeg-4.3.1"
VIDEO_IN="../MVI_1522.MOV"

clear

$FFMPEG -i $VIDEO_IN -n -an -c:v ffv1 -pix_fmt + does_not_work.mkv
$FFMPEG -i $VIDEO_IN -n -an -c:v ffv1 -pix_fmt yuvj420p out.mkv
$FFMPEG -i $VIDEO_IN -n -an -c:v ffv1 -pix_fmt yuvj420p -color_range
jpeg -colorspace smpte170m -color_primaries bt709 -color_trc bt709
out-bt709.mkv
$FFMPEG -i $VIDEO_IN -n -an -c:v ffv1 -pix_fmt yuvj420p -color_range
jpeg out-jpeg.mkv
sleep 1

echo
echo "Source video:"
$FFMPEG -i $VIDEO_IN -f streamhash -hash md5 -v quiet -map 0 -
echo
echo "Without setting color information:"
$FFMPEG -i out.mkv -f streamhash -hash md5 -v quiet -map 0 -
echo
echo "Color information set:"
$FFMPEG -i out-bt709.mkv -f streamhash -hash md5 -v quiet -map 0 -
$FFMPEG -i out-jpeg.mkv -f streamhash -hash md5 -v quiet -map 0 -
// ----------------------------------------


ffmpeg-4.3.1 -i ../MVI_1522.MOV -n -an -c:v ffv1 -pix_fmt +
does_not_work.mkv
ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright
(c) 2000-2020 the FFmpeg developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gmp --enable-libgme --enable-gray
--enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis
--enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d
--enable-libxvid --enable-libzvbi --enable-libzimg
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../MVI_1522.MOV':
   Metadata:
     major_brand     : qt
     minor_version   : 537331968
     compatible_brands: qt  CAEP
     creation_time   : 2012-07-14T20:54:32.000000Z
   Duration: 00:00:11.52, start: 0.000000, bitrate: 45262 kb/s
     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 43657 kb/s,
25 fps, 25 tbr, 25k tbn, 50k tbc (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
     Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
stereo, s16, 1536 kb/s (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> ffv1 (native))
Press [q] to stop, [?] for help
[ffv1 @ 0x5fb9500] Specified pixel format yuvj420p is invalid or not
supported
Error initializing output stream 0:0 -- Error while opening encoder for
output stream #0:0 - maybe incorrect parameters such as bit_rate, rate,
width or height
Conversion failed!



------------
ffmpeg-4.3.1 -i ../MVI_1522.MOV -n -an -c:v ffv1 -pix_fmt yuvj420p out.mkv
ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright
(c) 2000-2020 the FFmpeg developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gmp --enable-libgme --enable-gray
--enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis
--enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d
--enable-libxvid --enable-libzvbi --enable-libzimg
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../MVI_1522.MOV':
   Metadata:
     major_brand     : qt
     minor_version   : 537331968
     compatible_brands: qt  CAEP
     creation_time   : 2012-07-14T20:54:32.000000Z
   Duration: 00:00:11.52, start: 0.000000, bitrate: 45262 kb/s
     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 43657 kb/s,
25 fps, 25 tbr, 25k tbn, 50k tbc (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
     Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
stereo, s16, 1536 kb/s (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> ffv1 (native))
Press [q] to stop, [?] for help
Incompatible pixel format 'yuvj420p' for codec 'ffv1', auto-selecting
format 'yuv420p'
[swscaler @ 0x82fd9c0] deprecated pixel format used, make sure you did
set range correctly
Output #0, matroska, to 'out.mkv':
   Metadata:
     major_brand     : qt
     minor_version   : 537331968
     compatible_brands: qt  CAEP
     encoder         : Lavf58.45.100
     Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv420p,
1920x1080, q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
       encoder         : Lavc58.91.100 ffv1
frame=  288 fps= 43 q=-0.0 Lsize=  255120kB time=00:00:11.48
bitrate=182035.0kbits/s speed= 1.7x
video:255116kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.001688%



------------
ffmpeg-4.3.1 -i ../MVI_1522.MOV -n -an -c:v ffv1 -pix_fmt yuvj420p
-color_range jpeg -colorspace smpte170m -color_primaries bt709
-color_trc bt709 out-bt709.mkv
ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright
(c) 2000-2020 the FFmpeg developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gmp --enable-libgme --enable-gray
--enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis
--enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d
--enable-libxvid --enable-libzvbi --enable-libzimg
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../MVI_1522.MOV':
   Metadata:
     major_brand     : qt
     minor_version   : 537331968
     compatible_brands: qt  CAEP
     creation_time   : 2012-07-14T20:54:32.000000Z
   Duration: 00:00:11.52, start: 0.000000, bitrate: 45262 kb/s
     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 43657 kb/s,
25 fps, 25 tbr, 25k tbn, 50k tbc (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
     Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
stereo, s16, 1536 kb/s (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> ffv1 (native))
Press [q] to stop, [?] for help
Incompatible pixel format 'yuvj420p' for codec 'ffv1', auto-selecting
format 'yuv420p'
[swscaler @ 0x89c9740] deprecated pixel format used, make sure you did
set range correctly
Output #0, matroska, to 'out-bt709.mkv':
   Metadata:
     major_brand     : qt
     minor_version   : 537331968
     compatible_brands: qt  CAEP
     encoder         : Lavf58.45.100
     Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv420p(pc,
smpte170m/bt709/bt709), 1920x1080, q=2-31, 200 kb/s, 25 fps, 1k tbn, 25
tbc (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
       encoder         : Lavc58.91.100 ffv1
frame=  288 fps= 42 q=-0.0 Lsize=  255120kB time=00:00:11.48
bitrate=182035.0kbits/s speed=1.69x
video:255116kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.001694%



------------
ffmpeg-4.3.1 -i ../MVI_1522.MOV -n -an -c:v ffv1 -pix_fmt yuvj420p
-color_range jpeg out-jpeg.mkv
ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright
(c) 2000-2020 the FFmpeg developers
   built with gcc 8 (Debian 8.3.0-6)
   configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gmp --enable-libgme --enable-gray
--enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis
--enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d
--enable-libxvid --enable-libzvbi --enable-libzimg
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../MVI_1522.MOV':
   Metadata:
     major_brand     : qt
     minor_version   : 537331968
     compatible_brands: qt  CAEP
     creation_time   : 2012-07-14T20:54:32.000000Z
   Duration: 00:00:11.52, start: 0.000000, bitrate: 45262 kb/s
     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 43657 kb/s,
25 fps, 25 tbr, 25k tbn, 50k tbc (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
     Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
stereo, s16, 1536 kb/s (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> ffv1 (native))
Press [q] to stop, [?] for help
Incompatible pixel format 'yuvj420p' for codec 'ffv1', auto-selecting
format 'yuv420p'
[swscaler @ 0x7626480] deprecated pixel format used, make sure you did
set range correctly
Output #0, matroska, to 'out-jpeg.mkv':
   Metadata:
     major_brand     : qt
     minor_version   : 537331968
     compatible_brands: qt  CAEP
     encoder         : Lavf58.45.100
     Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv420p(pc),
1920x1080, q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc (default)
     Metadata:
       creation_time   : 2012-07-14T20:54:32.000000Z
       encoder         : Lavc58.91.100 ffv1
frame=  288 fps= 43 q=-0.0 Lsize=  255120kB time=00:00:11.48
bitrate=182035.0kbits/s speed=1.71x
video:255116kB audio:0kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 0.001690%

Source video:
0,v,MD5=521af382c5493165eda080c4a49c81e2
1,a,MD5=f21269116a847f887710cfc67ecc3e6e

Without setting color information:
0,v,MD5=4fbaea423bccbfa1a6d4a9701f09effc

Color information set:
0,v,MD5=4fbaea423bccbfa1a6d4a9701f09effc
0,v,MD5=4fbaea423bccbfa1a6d4a9701f09effc


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Paul B Mahol
On Mon, Sep 07, 2020 at 11:20:10PM +0200, Peter B. wrote:

> Hi everyone!
>
> I've read quite a while ago that pix_fmt "yuvj420p" is deprecated, and when
> trying to convert an H.264/MOV to FFV1/MKV, I get the following message:
>
> > Incompatible pixel format 'yuvj420p' for codec 'ffv1', auto-selecting
> format 'yuv420p'
> > [swscaler @ 0x71c9440] deprecated pixel format used, make sure you did set
> range correctly
>
> The comment in [libavutil/pixfmt.h](https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/pixfmt.h#L78),
> says:
>
> > AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG),
> deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range
>
>
> The source video is: yuvj420p(pc, smpte170m/bt709/bt709)
> The output video is: yuv420p(pc, smpte170m/bt709/bt709)
>
> What would be the right commandline to losslessly convert this to FFV1?
> I've tried, but so far I get differing streamhash MD5s for the video -
> regardless if I set the color range :(

ffmpeg -i input_video.mov -vf setrange=limited -c:v ffv1 out.mkv

That command will tell ffmpeg that range is not full but limited
and will not do lossy conversion with swscale at all.
You will need to signal that encoded video is still full range somehow in container,
otherwise you will get correct hash but output display will think
its really limited while it is actually still full range.

FFv1, still, as time of this writting does not support signaling
this color range in any way in bitstream.
Dunno if matroska container supports it.

Anyway you will need to find another way to store such metadata.


>
>
>
> Thanks in advance for any hints!
> Peter B.
>
>
>
> Here's what I've tried so far:
> (Console output below)
>
> // ----------------------------------------
> FFMPEG="ffmpeg-4.3.1"
> VIDEO_IN="../MVI_1522.MOV"
>
> clear
>
> $FFMPEG -i $VIDEO_IN -n -an -c:v ffv1 -pix_fmt + does_not_work.mkv
> $FFMPEG -i $VIDEO_IN -n -an -c:v ffv1 -pix_fmt yuvj420p out.mkv
> $FFMPEG -i $VIDEO_IN -n -an -c:v ffv1 -pix_fmt yuvj420p -color_range jpeg
> -colorspace smpte170m -color_primaries bt709 -color_trc bt709 out-bt709.mkv
> $FFMPEG -i $VIDEO_IN -n -an -c:v ffv1 -pix_fmt yuvj420p -color_range jpeg
> out-jpeg.mkv
> sleep 1
>
> echo
> echo "Source video:"
> $FFMPEG -i $VIDEO_IN -f streamhash -hash md5 -v quiet -map 0 -
> echo
> echo "Without setting color information:"
> $FFMPEG -i out.mkv -f streamhash -hash md5 -v quiet -map 0 -
> echo
> echo "Color information set:"
> $FFMPEG -i out-bt709.mkv -f streamhash -hash md5 -v quiet -map 0 -
> $FFMPEG -i out-jpeg.mkv -f streamhash -hash md5 -v quiet -map 0 -
> // ----------------------------------------
>
>
> ffmpeg-4.3.1 -i ../MVI_1522.MOV -n -an -c:v ffv1 -pix_fmt +
> does_not_work.mkv
> ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright (c)
> 2000-2020 the FFmpeg developers
>   built with gcc 8 (Debian 8.3.0-6)
>   configuration: --enable-gpl --enable-version3 --enable-static
> --disable-debug --disable-ffplay --disable-indev=sndio
> --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
> --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom
> --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype
> --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libopenjpeg --enable-librubberband --enable-libsoxr
> --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus
> --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc
> --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
> --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi
> --enable-libzimg
>   libavutil      56. 51.100 / 56. 51.100
>   libavcodec     58. 91.100 / 58. 91.100
>   libavformat    58. 45.100 / 58. 45.100
>   libavdevice    58. 10.100 / 58. 10.100
>   libavfilter     7. 85.100 /  7. 85.100
>   libswscale      5.  7.100 /  5.  7.100
>   libswresample   3.  7.100 /  3.  7.100
>   libpostproc    55.  7.100 / 55.  7.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../MVI_1522.MOV':
>   Metadata:
>     major_brand     : qt
>     minor_version   : 537331968
>     compatible_brands: qt  CAEP
>     creation_time   : 2012-07-14T20:54:32.000000Z
>   Duration: 00:00:11.52, start: 0.000000, bitrate: 45262 kb/s
>     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
> 0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 43657 kb/s, 25
> fps, 25 tbr, 25k tbn, 50k tbc (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
>     Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
> stereo, s16, 1536 kb/s (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
> Stream mapping:
>   Stream #0:0 -> #0:0 (h264 (native) -> ffv1 (native))
> Press [q] to stop, [?] for help
> [ffv1 @ 0x5fb9500] Specified pixel format yuvj420p is invalid or not
> supported
> Error initializing output stream 0:0 -- Error while opening encoder for
> output stream #0:0 - maybe incorrect parameters such as bit_rate, rate,
> width or height
> Conversion failed!
>
>
>
> ------------
> ffmpeg-4.3.1 -i ../MVI_1522.MOV -n -an -c:v ffv1 -pix_fmt yuvj420p out.mkv
> ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright (c)
> 2000-2020 the FFmpeg developers
>   built with gcc 8 (Debian 8.3.0-6)
>   configuration: --enable-gpl --enable-version3 --enable-static
> --disable-debug --disable-ffplay --disable-indev=sndio
> --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
> --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom
> --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype
> --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libopenjpeg --enable-librubberband --enable-libsoxr
> --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus
> --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc
> --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
> --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi
> --enable-libzimg
>   libavutil      56. 51.100 / 56. 51.100
>   libavcodec     58. 91.100 / 58. 91.100
>   libavformat    58. 45.100 / 58. 45.100
>   libavdevice    58. 10.100 / 58. 10.100
>   libavfilter     7. 85.100 /  7. 85.100
>   libswscale      5.  7.100 /  5.  7.100
>   libswresample   3.  7.100 /  3.  7.100
>   libpostproc    55.  7.100 / 55.  7.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../MVI_1522.MOV':
>   Metadata:
>     major_brand     : qt
>     minor_version   : 537331968
>     compatible_brands: qt  CAEP
>     creation_time   : 2012-07-14T20:54:32.000000Z
>   Duration: 00:00:11.52, start: 0.000000, bitrate: 45262 kb/s
>     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
> 0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 43657 kb/s, 25
> fps, 25 tbr, 25k tbn, 50k tbc (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
>     Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
> stereo, s16, 1536 kb/s (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
> Stream mapping:
>   Stream #0:0 -> #0:0 (h264 (native) -> ffv1 (native))
> Press [q] to stop, [?] for help
> Incompatible pixel format 'yuvj420p' for codec 'ffv1', auto-selecting format
> 'yuv420p'
> [swscaler @ 0x82fd9c0] deprecated pixel format used, make sure you did set
> range correctly
> Output #0, matroska, to 'out.mkv':
>   Metadata:
>     major_brand     : qt
>     minor_version   : 537331968
>     compatible_brands: qt  CAEP
>     encoder         : Lavf58.45.100
>     Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv420p, 1920x1080,
> q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
>       encoder         : Lavc58.91.100 ffv1
> frame=  288 fps= 43 q=-0.0 Lsize=  255120kB time=00:00:11.48
> bitrate=182035.0kbits/s speed= 1.7x
> video:255116kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: 0.001688%
>
>
>
> ------------
> ffmpeg-4.3.1 -i ../MVI_1522.MOV -n -an -c:v ffv1 -pix_fmt yuvj420p
> -color_range jpeg -colorspace smpte170m -color_primaries bt709 -color_trc
> bt709 out-bt709.mkv
> ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright (c)
> 2000-2020 the FFmpeg developers
>   built with gcc 8 (Debian 8.3.0-6)
>   configuration: --enable-gpl --enable-version3 --enable-static
> --disable-debug --disable-ffplay --disable-indev=sndio
> --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
> --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom
> --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype
> --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libopenjpeg --enable-librubberband --enable-libsoxr
> --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus
> --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc
> --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
> --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi
> --enable-libzimg
>   libavutil      56. 51.100 / 56. 51.100
>   libavcodec     58. 91.100 / 58. 91.100
>   libavformat    58. 45.100 / 58. 45.100
>   libavdevice    58. 10.100 / 58. 10.100
>   libavfilter     7. 85.100 /  7. 85.100
>   libswscale      5.  7.100 /  5.  7.100
>   libswresample   3.  7.100 /  3.  7.100
>   libpostproc    55.  7.100 / 55.  7.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../MVI_1522.MOV':
>   Metadata:
>     major_brand     : qt
>     minor_version   : 537331968
>     compatible_brands: qt  CAEP
>     creation_time   : 2012-07-14T20:54:32.000000Z
>   Duration: 00:00:11.52, start: 0.000000, bitrate: 45262 kb/s
>     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
> 0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 43657 kb/s, 25
> fps, 25 tbr, 25k tbn, 50k tbc (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
>     Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
> stereo, s16, 1536 kb/s (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
> Stream mapping:
>   Stream #0:0 -> #0:0 (h264 (native) -> ffv1 (native))
> Press [q] to stop, [?] for help
> Incompatible pixel format 'yuvj420p' for codec 'ffv1', auto-selecting format
> 'yuv420p'
> [swscaler @ 0x89c9740] deprecated pixel format used, make sure you did set
> range correctly
> Output #0, matroska, to 'out-bt709.mkv':
>   Metadata:
>     major_brand     : qt
>     minor_version   : 537331968
>     compatible_brands: qt  CAEP
>     encoder         : Lavf58.45.100
>     Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv420p(pc,
> smpte170m/bt709/bt709), 1920x1080, q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc
> (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
>       encoder         : Lavc58.91.100 ffv1
> frame=  288 fps= 42 q=-0.0 Lsize=  255120kB time=00:00:11.48
> bitrate=182035.0kbits/s speed=1.69x
> video:255116kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: 0.001694%
>
>
>
> ------------
> ffmpeg-4.3.1 -i ../MVI_1522.MOV -n -an -c:v ffv1 -pix_fmt yuvj420p
> -color_range jpeg out-jpeg.mkv
> ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright (c)
> 2000-2020 the FFmpeg developers
>   built with gcc 8 (Debian 8.3.0-6)
>   configuration: --enable-gpl --enable-version3 --enable-static
> --disable-debug --disable-ffplay --disable-indev=sndio
> --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
> --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom
> --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype
> --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb
> --enable-libopenjpeg --enable-librubberband --enable-libsoxr
> --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus
> --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc
> --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265
> --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi
> --enable-libzimg
>   libavutil      56. 51.100 / 56. 51.100
>   libavcodec     58. 91.100 / 58. 91.100
>   libavformat    58. 45.100 / 58. 45.100
>   libavdevice    58. 10.100 / 58. 10.100
>   libavfilter     7. 85.100 /  7. 85.100
>   libswscale      5.  7.100 /  5.  7.100
>   libswresample   3.  7.100 /  3.  7.100
>   libpostproc    55.  7.100 / 55.  7.100
> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '../MVI_1522.MOV':
>   Metadata:
>     major_brand     : qt
>     minor_version   : 537331968
>     compatible_brands: qt  CAEP
>     creation_time   : 2012-07-14T20:54:32.000000Z
>   Duration: 00:00:11.52, start: 0.000000, bitrate: 45262 kb/s
>     Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
> 0x31637661), yuvj420p(pc, smpte170m/bt709/bt709), 1920x1080, 43657 kb/s, 25
> fps, 25 tbr, 25k tbn, 50k tbc (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
>     Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz,
> stereo, s16, 1536 kb/s (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
> Stream mapping:
>   Stream #0:0 -> #0:0 (h264 (native) -> ffv1 (native))
> Press [q] to stop, [?] for help
> Incompatible pixel format 'yuvj420p' for codec 'ffv1', auto-selecting format
> 'yuv420p'
> [swscaler @ 0x7626480] deprecated pixel format used, make sure you did set
> range correctly
> Output #0, matroska, to 'out-jpeg.mkv':
>   Metadata:
>     major_brand     : qt
>     minor_version   : 537331968
>     compatible_brands: qt  CAEP
>     encoder         : Lavf58.45.100
>     Stream #0:0(eng): Video: ffv1 (FFV1 / 0x31564646), yuv420p(pc),
> 1920x1080, q=2-31, 200 kb/s, 25 fps, 1k tbn, 25 tbc (default)
>     Metadata:
>       creation_time   : 2012-07-14T20:54:32.000000Z
>       encoder         : Lavc58.91.100 ffv1
> frame=  288 fps= 43 q=-0.0 Lsize=  255120kB time=00:00:11.48
> bitrate=182035.0kbits/s speed=1.71x
> video:255116kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: 0.001690%
>
> Source video:
> 0,v,MD5=521af382c5493165eda080c4a49c81e2
> 1,a,MD5=f21269116a847f887710cfc67ecc3e6e
>
> Without setting color information:
> 0,v,MD5=4fbaea423bccbfa1a6d4a9701f09effc
>
> Color information set:
> 0,v,MD5=4fbaea423bccbfa1a6d4a9701f09effc
> 0,v,MD5=4fbaea423bccbfa1a6d4a9701f09effc
>
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

kumowoon1025
In reply to this post by Peter B.
Hi,

>  > Incompatible pixel format 'yuvj420p' for codec 'ffv1', auto-selecting
>
> format 'yuv420p'
>
>  > [swscaler @ 0x71c9440] deprecated pixel format used, make sure you
>
> did set range correctly
>
>
>
> The comment in
>
> [libavutil/pixfmt.h](https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/pixfmt.h#L78),
>
> says:
>
>
>
>  > AV_PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG),
>
> deprecated in favor of AV_PIX_FMT_YUV420P and setting color_range
>
> The source video is: yuvj420p(pc, smpte170m/bt709/bt709)
>
> The output video is: yuv420p(pc, smpte170m/bt709/bt709)
I think it means to force output 0-100% levels with yuv420p format if you are seeking yuvj420p, with the understanding they won’t necessarily be safe.

> What would be the right commandline to losslessly convert this to FFV1?
>
> I've tried, but so far I get differing streamhash MD5s for the video -
>
> regardless if I set the color range :(
Isn’t it unavoidable? Since the ranges are not same. Though maybe if you go from broadcast and force filter setrange=pc they might match? I’m not very sure. One thing I’d mention just in case is color range option only sets what the header claims it’s contents are, for the encoders that accept it.

Regards,
Ted
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Peter B.
In reply to this post by Paul B Mahol
Dear Paul,

On 07.09.20 23:57, Paul B Mahol wrote:

> On Mon, Sep 07, 2020 at 11:20:10PM +0200, Peter B. wrote:
>> [...]
>> The source video is: yuvj420p(pc, smpte170m/bt709/bt709)
>> The output video is: yuv420p(pc, smpte170m/bt709/bt709)
>>
>> What would be the right commandline to losslessly convert this to FFV1?
>> I've tried, but so far I get differing streamhash MD5s for the video -
>> regardless if I set the color range :(
> ffmpeg -i input_video.mov -vf setrange=limited -c:v ffv1 out.mkv
>
> That command will tell ffmpeg that range is not full but limited
> and will not do lossy conversion with swscale at all.

That worked! Thank you!
Streamhash says it's a match :)


> You will need to signal that encoded video is still full range somehow in container,
> otherwise you will get correct hash but output display will think
> its really limited while it is actually still full range.

Thanks for pointing that out.
I've done the following:

$FFMPEG -i $VIDEO_IN -an -c:v ffv1 \
  -vf setrange=limited \
  -pix_fmt yuv420p \
  -color_range jpeg \
  -colorspace smpte170m \
  -color_primaries bt709 \
  -color_trc bt709 \
out.mkv

The streamhash matches, and the color interpretation metadata seems to
be identical to the source:

   * Source video (h.264):
     yuvj420p(pc, smpte170m/bt709/bt709)

   * Target video (ffv1):
     yuv420p(pc, smpte170m/bt709/bt709)



Thanks again Paul!
Peter
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Paul B Mahol
On Tue, Sep 08, 2020 at 04:12:30PM +0200, Peter B. wrote:

> Dear Paul,
>
> On 07.09.20 23:57, Paul B Mahol wrote:
> > On Mon, Sep 07, 2020 at 11:20:10PM +0200, Peter B. wrote:
> > > [...]
> > > The source video is: yuvj420p(pc, smpte170m/bt709/bt709)
> > > The output video is: yuv420p(pc, smpte170m/bt709/bt709)
> > >
> > > What would be the right commandline to losslessly convert this to FFV1?
> > > I've tried, but so far I get differing streamhash MD5s for the video -
> > > regardless if I set the color range :(
> > ffmpeg -i input_video.mov -vf setrange=limited -c:v ffv1 out.mkv
> >
> > That command will tell ffmpeg that range is not full but limited
> > and will not do lossy conversion with swscale at all.
>
> That worked! Thank you!
> Streamhash says it's a match :)
>
>
> > You will need to signal that encoded video is still full range somehow in container,
> > otherwise you will get correct hash but output display will think
> > its really limited while it is actually still full range.
>
> Thanks for pointing that out.
> I've done the following:
>
> $FFMPEG -i $VIDEO_IN -an -c:v ffv1 \
>  -vf setrange=limited \
>  -pix_fmt yuv420p \
>  -color_range jpeg \
>  -colorspace smpte170m \
>  -color_primaries bt709 \
>  -color_trc bt709 \
> out.mkv
>
> The streamhash matches, and the color interpretation metadata seems to be
> identical to the source:
>
>   * Source video (h.264):
>     yuvj420p(pc, smpte170m/bt709/bt709)
>
>   * Target video (ffv1):
>     yuv420p(pc, smpte170m/bt709/bt709)

This is not reporting color range. Better check it matches.

>
>
>
> Thanks again Paul!
> Peter
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Peter B.
Dear Paul,

On 10.09.20 15:53, Paul B Mahol wrote:
>> The streamhash matches, and the color interpretation metadata seems to be
>> identical to the source:
>>
>>    * Source video (h.264):
>>      yuvj420p(pc, smpte170m/bt709/bt709)
>>
>>    * Target video (ffv1):
>>      yuv420p(pc, smpte170m/bt709/bt709)
> This is not reporting color range. Better check it matches.

Will check.

However, after reading "color_range" documentation on [1] do thought
that the "pc" means "full-range".
So I thought that is reporting the range (it thinks it has)?



Kind regards,
Peter



[1] https://ffmpeg.org/ffmpeg-all.html#Codec-Options:
 >
 > color_range integer (decoding/encoding,video)
 >
 > If used as input parameter, it serves as a hint to the decoder, which
color_range the input has. Possible values:
 >
 >     ‘tv’
 >     ‘mpeg’
 >
 >         MPEG (219*2^(n-8))
 >     ‘pc’
 >     ‘jpeg’
 >
 >         JPEG (2^n-1)



_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Paul B Mahol
On Fri, Sep 11, 2020 at 10:10:31AM +0200, Peter B. wrote:

> Dear Paul,
>
> On 10.09.20 15:53, Paul B Mahol wrote:
> > > The streamhash matches, and the color interpretation metadata seems to be
> > > identical to the source:
> > >
> > >    * Source video (h.264):
> > >      yuvj420p(pc, smpte170m/bt709/bt709)
> > >
> > >    * Target video (ffv1):
> > >      yuv420p(pc, smpte170m/bt709/bt709)
> > This is not reporting color range. Better check it matches.
>
> Will check.
>
> However, after reading "color_range" documentation on [1] do thought that
> the "pc" means "full-range".
> So I thought that is reporting the range (it thinks it has)?

Yes, it is. Ignore my remark.

>
>
>
> Kind regards,
> Peter
>
>
>
> [1] https://ffmpeg.org/ffmpeg-all.html#Codec-Options:
> >
> > color_range integer (decoding/encoding,video)
> >
> > If used as input parameter, it serves as a hint to the decoder, which
> color_range the input has. Possible values:
> >
> >     ‘tv’
> >     ‘mpeg’
> >
> >         MPEG (219*2^(n-8))
> >     ‘pc’
> >     ‘jpeg’
> >
> >         JPEG (2^n-1)
>
>
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Peter B.
In reply to this post by Paul B Mahol
Hi again :)

I thought this was solved, but...


On 10.09.20 15:53, Paul B Mahol wrote:

> On Tue, Sep 08, 2020 at 04:12:30PM +0200, Peter B. wrote:
>> Dear Paul,
>>
>> On 07.09.20 23:57, Paul B Mahol wrote:
>>> On Mon, Sep 07, 2020 at 11:20:10PM +0200, Peter B. wrote:
>> Thanks for pointing that out.
>> I've done the following:
>>
>> $FFMPEG -i $VIDEO_IN -an -c:v ffv1 \
>>   -vf setrange=limited \
>>   -pix_fmt yuv420p \
>>   -color_range jpeg \
>>   -colorspace smpte170m \
>>   -color_primaries bt709 \
>>   -color_trc bt709 \
>> out.mkv
>>
>> The streamhash matches, and the color interpretation metadata seems to be
>> identical to the source:
>>
>>    * Source video (h.264):
>>      yuvj420p(pc, smpte170m/bt709/bt709)
>>
>>    * Target video (ffv1):
>>      yuv420p(pc, smpte170m/bt709/bt709)
> This is not reporting color range. Better check it matches.

I've noticed something very odd:
When applying the same FFmpeg command as above, but "-c:v libx264 -crf
21" (instead of FFV1), FFmpeg says it's output is:

 > yuv420p(pc, smpte170m/bt709/bt709)

...but when reading the created file using FFprobe (current git master),
it's back to "yuvj420p":

 > yuvj420p(pc, smpte170m/bt709/bt709)


So, is the file now "AV_PIX_FMT_YUVJ420P" or "AV_PIX_FMT_YUV420P + set
color_range"?


My problem is, that I have literally hundreds (actually more than 1000+)
of these H.264/yuvj420p files that are to be auto-converted to archival
FFV1, but because of the "j" the "pix_fmt +" option cannot be used,
which throws all those files into error - and I'd like to fix this :)



Grateful for any suggestions.

Kind regards,
Peter B.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Paul B Mahol
On Fri, Sep 11, 2020 at 11:49:01AM +0200, Peter B. wrote:

> Hi again :)
>
> I thought this was solved, but...
>
>
> On 10.09.20 15:53, Paul B Mahol wrote:
> > On Tue, Sep 08, 2020 at 04:12:30PM +0200, Peter B. wrote:
> > > Dear Paul,
> > >
> > > On 07.09.20 23:57, Paul B Mahol wrote:
> > > > On Mon, Sep 07, 2020 at 11:20:10PM +0200, Peter B. wrote:
> > > Thanks for pointing that out.
> > > I've done the following:
> > >
> > > $FFMPEG -i $VIDEO_IN -an -c:v ffv1 \
> > >   -vf setrange=limited \
> > >   -pix_fmt yuv420p \
> > >   -color_range jpeg \
> > >   -colorspace smpte170m \
> > >   -color_primaries bt709 \
> > >   -color_trc bt709 \
> > > out.mkv
> > >
> > > The streamhash matches, and the color interpretation metadata seems to be
> > > identical to the source:
> > >
> > >    * Source video (h.264):
> > >      yuvj420p(pc, smpte170m/bt709/bt709)
> > >
> > >    * Target video (ffv1):
> > >      yuv420p(pc, smpte170m/bt709/bt709)
> > This is not reporting color range. Better check it matches.
>
> I've noticed something very odd:
> When applying the same FFmpeg command as above, but "-c:v libx264 -crf 21"
> (instead of FFV1), FFmpeg says it's output is:
>
> > yuv420p(pc, smpte170m/bt709/bt709)
>
> ...but when reading the created file using FFprobe (current git master),
> it's back to "yuvj420p":
>
> > yuvj420p(pc, smpte170m/bt709/bt709)
>
>
> So, is the file now "AV_PIX_FMT_YUVJ420P" or "AV_PIX_FMT_YUV420P + set
> color_range"?
>
>
> My problem is, that I have literally hundreds (actually more than 1000+) of
> these H.264/yuvj420p files that are to be auto-converted to archival FFV1,
> but because of the "j" the "pix_fmt +" option cannot be used, which throws
> all those files into error - and I'd like to fix this :)

YUVJ420P === YUV420P + PC set for color_range.

Beware of unset color_range.

>
>
>
> Grateful for any suggestions.
>
> Kind regards,
> Peter B.
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

kumowoon1025
Hi,

>> So, is the file now "AV_PIX_FMT_YUVJ420P" or "AV_PIX_FMT_YUV420P + set
>> color_range"?

Obviously those names are not relevant until the file meets the av* tools, but they are the same formats. I think yuvj420p was meant to be a separate variant of yuv420p that was not broadcast safe, from ccd sources early on, but since everything is digital nowadays and powerful enough to shift if necessary.

>> My problem is, that I have literally hundreds (actually more than 1000+) of
>> these H.264/yuvj420p files that are to be auto-converted to archival FFV1,
>> but because of the "j" the "pix_fmt +" option cannot be used, which throws
>> all those files into error - and I'd like to fix this :)

setrange affects the frames, not any end result SPS i think. Leaving it out doesn’t set the parameters? Does it convert to limited range by default?

Also, what are some of the benefits of reencoding footage for archival? I can maybe think of being able to detect partial corruption and possibly a increase in data/bitrate, but not much else.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Peter B.
Hi Ted,

On 11.09.20 14:03, Ted Park wrote:
>>> My problem is, that I have literally hundreds (actually more than 1000+) of
>>> these H.264/yuvj420p files that are to be auto-converted to archival FFV1,
>>> but because of the "j" the "pix_fmt +" option cannot be used, which throws
>>> all those files into error - and I'd like to fix this :)
> setrange affects the frames, not any end result SPS i think. Leaving it out doesn’t set the parameters? Does it convert to limited range by default?

I'm still looking for a way to automatically transcode yuvj420p files
along with other pix_fmts to FFV1, while keeping "-pix_fmt +" to make
sure no silent conversions are happening.

Does anyone have a suggestion?


I currently have to fish out all yuvj420p files, because they require a
different recipe than all other source files. This behavior doesn't seem
technically necessary. Why do "yuv420p+colorinfo" files (created with
FFmpeg) revert back to being interpreted as yuvj420p? I thought it's
deprecated?
Not complaining, I'd just like to understand this behavior :)

How do I create a non-yuvj420p file - while keeping colorinfo proper?
btw: MediaInfo shows no difference between yuv420p+colorinfo and
yuvj420p. Here's a related thread:
https://github.com/MediaArea/MediaInfo/issues/484


As long as the content hashcodes of the image data is identical and the
color interpretation metadata set to correct values (=identical to the
source), according to ffprobe - my _Archival Spidersenses(tm)_ are
satisfied.

Am I overlooking something?


> Also, what are some of the benefits of reencoding footage for archival? I can maybe think of being able to detect partial corruption and possibly a increase in data/bitrate, but not much else.

Data format normalization is a thing.
It even helps to rewrap the container with "-c copy". Stabilizes
behavior when dealing with different applications. Normalizing the
codecs without loss is an additional plus.

Imagine dealing with thousands of recordings in the colorful rainbow
variety of media formats over several decades from several sources. It's
great fun actually! (when getting the time and resources to hack a bunch
of bytes into making sense ;))

You wouldn't believe how many "dialects" of H.264/MP4 I encounter on a
daily basis.

Yes it significantly increases the datarate, but it makes it possible to
actually make our archival content as seamlessly accessible as possible.
There's lots of custom ffmpeg-auto-transcode scripts running to fill
archive's websites. In order to keep the data corruption at zero, we use
content- and file-hashcodes to validate any changes to the archival
recordings.
That's also great fun, actually! :)



Still grateful for a "-pix_fmt +" suggestion :)
Thanks!
Peter B.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Paul B Mahol
On Wed, Sep 23, 2020 at 11:31:43PM +0200, Peter B. wrote:

> Hi Ted,
>
> On 11.09.20 14:03, Ted Park wrote:
> > > > My problem is, that I have literally hundreds (actually more than 1000+) of
> > > > these H.264/yuvj420p files that are to be auto-converted to archival FFV1,
> > > > but because of the "j" the "pix_fmt +" option cannot be used, which throws
> > > > all those files into error - and I'd like to fix this :)
> > setrange affects the frames, not any end result SPS i think. Leaving it out doesn’t set the parameters? Does it convert to limited range by default?
>
> I'm still looking for a way to automatically transcode yuvj420p files along
> with other pix_fmts to FFV1, while keeping "-pix_fmt +" to make sure no
> silent conversions are happening.
>
> Does anyone have a suggestion?

What is wrong with my suggestion?

>
>
> I currently have to fish out all yuvj420p files, because they require a
> different recipe than all other source files. This behavior doesn't seem
> technically necessary. Why do "yuv420p+colorinfo" files (created with
> FFmpeg) revert back to being interpreted as yuvj420p? I thought it's
> deprecated?
> Not complaining, I'd just like to understand this behavior :)
>
> How do I create a non-yuvj420p file - while keeping colorinfo proper?
> btw: MediaInfo shows no difference between yuv420p+colorinfo and yuvj420p.
> Here's a related thread:
> https://github.com/MediaArea/MediaInfo/issues/484
>
>
> As long as the content hashcodes of the image data is identical and the
> color interpretation metadata set to correct values (=identical to the
> source), according to ffprobe - my _Archival Spidersenses(tm)_ are
> satisfied.
>
> Am I overlooking something?
>
>
> > Also, what are some of the benefits of reencoding footage for archival? I can maybe think of being able to detect partial corruption and possibly a increase in data/bitrate, but not much else.
>
> Data format normalization is a thing.
> It even helps to rewrap the container with "-c copy". Stabilizes behavior
> when dealing with different applications. Normalizing the codecs without
> loss is an additional plus.
>
> Imagine dealing with thousands of recordings in the colorful rainbow variety
> of media formats over several decades from several sources. It's great fun
> actually! (when getting the time and resources to hack a bunch of bytes into
> making sense ;))
>
> You wouldn't believe how many "dialects" of H.264/MP4 I encounter on a daily
> basis.
>
> Yes it significantly increases the datarate, but it makes it possible to
> actually make our archival content as seamlessly accessible as possible.
> There's lots of custom ffmpeg-auto-transcode scripts running to fill
> archive's websites. In order to keep the data corruption at zero, we use
> content- and file-hashcodes to validate any changes to the archival
> recordings.
> That's also great fun, actually! :)
>
>
>
> Still grateful for a "-pix_fmt +" suggestion :)
> Thanks!
> Peter B.
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Peter B.
Hi Paul! :)

On 24.09.20 09:55, Paul B Mahol wrote:

> On Wed, Sep 23, 2020 at 11:31:43PM +0200, Peter B. wrote:
>> Hi Ted,
>>
>> On 11.09.20 14:03, Ted Park wrote:
>>>>> My problem is, that I have literally hundreds (actually more than 1000+) of
>>>>> these H.264/yuvj420p files that are to be auto-converted to archival FFV1,
>>>>> but because of the "j" the "pix_fmt +" option cannot be used, which throws
>>>>> all those files into error - and I'd like to fix this :)
>>> setrange affects the frames, not any end result SPS i think. Leaving it out doesn’t set the parameters? Does it convert to limited range by default?
>> I'm still looking for a way to automatically transcode yuvj420p files along
>> with other pix_fmts to FFV1, while keeping "-pix_fmt +" to make sure no
>> silent conversions are happening.
>>
>> Does anyone have a suggestion?
> What is wrong with my suggestion?

Your suggestion was the following, right?

> YUVJ420P === YUV420P + PC set for color_range.
> Beware of unset color_range.


There's nothing wrong with it! :)

...but I still have to find out which files are interpreted as
"yuvj420p" by ffmpeg - and then fish them out and treat them with a
separate command, since I have batches with and without color_range set,
therefore "-pix_fmt +" throws a (correct) error when trying to convert
to FFV1 :)

That's where I'm stuck :(


Thanks again!
Peter
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Christian Ebert
Hi Peter,

* Peter B. on Monday, September 28, 2020 at 20:42:56 +0200:
> ...but I still have to find out which files are interpreted as
> "yuvj420p" by ffmpeg - and then fish them out and treat them
> with a separate command, since I have batches with and without
> color_range set, therefore "-pix_fmt +" throws a (correct)
> error when trying to convert to FFV1 :)

How about doing quick diagnosis with ffprobe before you start,
something like:

ffprobe -v error \
-print_format default=noprint_wrappers=1:nokey=1 \
-select_streams V -show_entries stream=pix_fmt

and make the command depend on the result?

--
LAST SHIP HOME                      --->> https://lastshiphome.de
Official Selection                          DOK.fest München 2018
German Ocean Film Award                        CineMare Kiel 2019
Best Documentary Feature   Wales International Film Festival 2020
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Peter B.
On 29.09.20 09:56, Christian Ebert wrote:
> How about doing quick diagnosis with ffprobe before you start,
> something like:
>
> ffprobe -v error \
> -print_format default=noprint_wrappers=1:nokey=1 \
> -select_streams V -show_entries stream=pix_fmt
>
> and make the command depend on the result?

Thanks for the suggestion, but that actually is what I'm doing right now
- yet it means to treat parts of the batches with different
conditions/recipes.

Additionally, in that concrete situation, the source videos (several
thousand...) are stored on an S3-type object based storage (non-Amazon
dialect). So used Mediainfo to avoid having to pull several hundred
Terabyte of videos just to get their tech-MD.


And Mediainfo cannot tell me what FFmpeg considers yuvj420p, because...
Even if it wasn't for the "S3-extra-fun", I'm running into this issue
every now and then in different video collections - and every "if - then
- else" adds extra points of failure (and work).


You see my challenge? :)


Kind regards,
Peter

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Christian Ebert
* Peter B. on Thursday, October 01, 2020 at 14:16:02 +0200:

> On 29.09.20 09:56, Christian Ebert wrote:
>> How about doing quick diagnosis with ffprobe before you start,
>> something like:
>>
>> ffprobe -v error \
>> -print_format default=noprint_wrappers=1:nokey=1 \
>> -select_streams V -show_entries stream=pix_fmt
>>
>> and make the command depend on the result?
>
> Thanks for the suggestion, but that actually is what I'm doing right
> now - yet it means to treat parts of the batches with different
> conditions/recipes.

I would be very surprised if you could use the same command on
thousands of videos.

> Additionally, in that concrete situation, the source videos (several
> thousand...) are stored on an S3-type object based storage (non-Amazon
> dialect). So used Mediainfo to avoid having to pull several hundred
> Terabyte of videos just to get their tech-MD.

What's wrong with that? But then again I don't understand: You
want to process _all_ the thousands of files, so you need them
anyway?

> And Mediainfo cannot tell me what FFmpeg considers yuvj420p, because...

If you can run Mediainfo on them (remotely?), I'd be surprised if
you couldn't run ffprobe on them - and if you haven't
built/installed ffprobe, even parsing `ffprobe -i input` lets you
detect the pix_fmt.

> Even if it wasn't for the "S3-extra-fun", I'm running into this issue
> every now and then in different video collections - and every "if -
> then - else" adds extra points of failure (and work).

I would think if - then - else is the way to _avoid_ points of
failure, but most likely I don't understand you setup and/or
intent, sorry.

Good luck.

--
LAST SHIP HOME                      --->> https://lastshiphome.de
Official Selection                          DOK.fest München 2018
German Ocean Film Award                        CineMare Kiel 2019
Best Documentary Feature   Wales International Film Festival 2020
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Tobias Rapp-2
In reply to this post by Peter B.
On 01.10.2020 14:16, Peter B. wrote:

> On 29.09.20 09:56, Christian Ebert wrote:
>> How about doing quick diagnosis with ffprobe before you start,
>> something like:
>>
>> ffprobe -v error \
>> -print_format default=noprint_wrappers=1:nokey=1 \
>> -select_streams V -show_entries stream=pix_fmt
>>
>> and make the command depend on the result?
>
> Thanks for the suggestion, but that actually is what I'm doing right now
> - yet it means to treat parts of the batches with different
> conditions/recipes.
>
> Additionally, in that concrete situation, the source videos (several
> thousand...) are stored on an S3-type object based storage (non-Amazon
> dialect). So used Mediainfo to avoid having to pull several hundred
> Terabyte of videos just to get their tech-MD.
>
>
> And Mediainfo cannot tell me what FFmpeg considers yuvj420p, because...
> Even if it wasn't for the "S3-extra-fun", I'm running into this issue
> every now and then in different video collections - and every "if - then
> - else" adds extra points of failure (and work).
>
>
> You see my challenge? :)

If your main concern is having different branches of command-line
building code, then my suggestion would be to always detect the input
pixel format first. Then allow format mapping at the start of the
pipeline, but disable it anywhere else:

ffmpeg -i $INPUT ... -pix_fmt +yuv420p \
  -filter:v "format=pix_fmts=yuv420p,setrange=full,..."

This should work for both cases, yuv420p and yuvj420p, and it should be
loss-less for these two cases, but I have not actually tested.

Regards, Tobias

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Mark Himsley-2
On Fri, 2 Oct 2020 at 14:28, Tobias Rapp <[hidden email]> wrote:
>
> ffmpeg -i $INPUT ... -pix_fmt +yuv420p \
>   -filter:v "format=pix_fmts=yuv420p,setrange=full,..."

Be careful with that if you have any interlaced material.
The `format` filter will force the inclusion of a `scale` filter before it.
Unless it's changed recently and I've missed it, the scale filter will
not be interlaced aware, so you might end up blurring the colours for
the two fields in each frame.

--
Mark Himsley
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Correct conversion of yuvj420p?

Peter B.
On 10.10.20 15:15, Mark Himsley wrote:
> On Fri, 2 Oct 2020 at 14:28, Tobias Rapp <[hidden email]> wrote:
>> ffmpeg -i $INPUT ... -pix_fmt +yuv420p \
>>    -filter:v "format=pix_fmts=yuv420p,setrange=full,..."

@Tobias:
This is an interesting syntax. I haven't used that filter option before.
Thanks for the tip!

 

> Be careful with that if you have any interlaced material.
> The `format` filter will force the inclusion of a `scale` filter before it.
> Unless it's changed recently and I've missed it, the scale filter will
> not be interlaced aware, so you might end up blurring the colours for
> the two fields in each frame.

@Mark:
And thank you very much for pointing this out!
If that is the case, then indeed that's a problem, because I definitely
deal with interlaced material - and even better: all cases mixed! :)
(progressive, tff, bff, and-whatever-else-someone-has-produced)



Kind regards,
Peter
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".