Opened 6 years ago

Closed 6 years ago

#7070 closed defect (invalid)

A proper way of converting yuvj420p colorspace to yuv420p (AVC to HEVC reencoding)

Reported by: Artem S. Tashkinov Owned by:
Priority: minor Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


This is not a bug, this is a request for help.

My phone generates files (AVC) in the yuvj420p colorspace and I cannot figure out how to reencode them to HEVC without losing colors.

I have encoded 1) without options and I've also tried 2) this and 3) this:

ffmpeg -i src -vf "scale=in_range=pc:out_range=tv" out

and this

ffmpeg -i src -pix_fmt yuv420p -vf "scale=in_range=pc:out_range=tv" out

But I always get this warning message:

[swscaler @ 0x1229940] deprecated pixel format used, make sure you did set range correctly

And the resulting file always has different colors (either undersaturated (1) or oversatured (2,3) ).

ffprobe src.mp4
ffprobe -i part0*mp4
ffprobe version 3.4.2 Copyright (c) 2007-2018 the FFmpeg developers
  built with gcc 7 (GCC)
  configuration: --disable-static --enable-nonfree --enable-avfilter --enable-shared --enable-gpl --enable-postproc --enable-pthreads --enable-libspeex --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-libopus --enable-libopenjpeg --disable-debug --disable-doc --enable-libpulse --extra-cflags='-march=native' --enable-version3 --enable-libvorbis --enable-libfdk-aac --enable-gnutls --enable-libfreetype --enable-libx265 --libdir=/usr/local/lib64 --enable-lto
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'part0.mp4':
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.83.100
  Duration: 00:00:31.60, start: 0.014000, bitrate: 19315 kb/s
    Stream #0:0(eng): Video: h264 (Baseline) (avc1 / 0x31637661), yuvj420p(pc, smpte170m), 1920x1080, 19988 kb/s, SAR 1:1 DAR 16:9, 20.51 fps, 20 tbr, 90k tbn, 180k tbc (default)
      handler_name    : VideoHandler
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 96 kb/s (default)
      handler_name    : SoundHandler

Change History (1)

comment:1 by llogan, 6 years ago

Component: swscaleundetermined
Resolution: invalid
Status: newclosed
Version: 3.2.4unspecified

This is a bug tracker only. You can ask for help at the #ffmpeg IRC channel, and/or the ffmpeg-user mailing list.

Note: See TracTickets for help on using tickets.