[FFmpeg-user] Could not find tag for codec hevc in stream

Gabriel Zachmann zach at cs.uni-bremen.de
Tue Jan 15 16:24:02 EET 2019


I am trying to convert an H264 video to H265.
I am working on the command line on macOS 10.12.6 (High Sierra).

However, I have a video for which ffmpeg (version 4.0.2) fails with this error message:

[mp4 @ 0x7f843f00c600] Could not find tag for codec hevc in stream #2, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 -- 

You can find the complete command and the output of ffmpeg and ffprobe enclosed below.
You can also get the video file here:  
  https://www.dropbox.com/s/f2ili147h1pn80v/Immersive%20Virtual%20Reality%20Anatomy%20Atlas%20V01.mp4?dl=0

The output of ffprobe on the video is 

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fded800cc00] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Immersive Virtual Reality Anatomy Atlas V01.mp4':
  Metadata:
    major_brand     : M4V 
    minor_version   : 512
    compatible_brands: isomiso2avc1
    encoder         : Lavf56.36.100
  Duration: 00:01:10.47, start: 0.000000, bitrate: 3649 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 3502 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 960x536 [SAR 144:144 DAR 120:67], 90k tbr, 90k tbn, 90k tbc


I am suspecting that the problem arises from Stream #0:2.
I don't even know why it is there.
And I am not sure I need it at all.

Most importantly , I would like to understand if and how I can solve this problem, i.e., still convert it to H265 (HEVC).

Any help and hints or pointers will be highly appreciated.

Best regards, Gabriel



Complete Command line  for  ffmpeg:

% /opt/local/bin/ffmpeg -loglevel error -hide_banner -nostats -nostdin -i 'Immersive Virtual Reality Anatomy Atlas V01.mp4' -map 0 -c:s copy -map_metadata 0 -map_metadata:s:v 0:s:v -dn -map_metadata:s:a 0:s:a -c:a aac -b:a 128k -filter:v 'crop=in_w-mod(in_w\,2):in_h-mod(in_h\,2)' -codec:v hevc -tag:v hvc1 -max_muxing_queue_size 1024 -vf format=yuv420p -preset faster -crf 29 -x265-params me=umh:subme=5:ref=4:aq-mode=2:aq-strength=1.0:psy-rd=2.0:psy-rdoq=1.0:rd=6:log-level=1 -ignore_unknown -f mp4 'Immersive Virtual Reality Anatomy Atlas V01.h265.mp4'

x265 [warning]: Source height < 720p; disabling lookahead-slices
[mp4 @ 0x7fcc27819a00] Could not find tag for codec hevc in stream #2, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 -- 



Complete output of ffmpeg -version:

% /opt/local/bin/ffmpeg -version
ffmpeg version 4.0.2 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 9.1.0 (clang-902.0.39.2)
configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-indev=jack --enable-opencl --disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox --enable-sdl2 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-x86asm --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
libavutil      56. 14.100 / 56. 14.100
libavcodec     58. 18.100 / 58. 18.100
libavformat    58. 12.100 / 58. 12.100
libavdevice    58.  3.100 / 58.  3.100
libavfilter     7. 16.100 /  7. 16.100
libavresample   4.  0.  0 /  4.  0.  0
libswscale      5.  1.100 /  5.  1.100
libswresample   3.  1.100 /  3.  1.100
libpostproc    55.  1.100 / 55.  1.100



Complete output of ffprobe on the video file:

% /opt/local/bin/ffprobe Immersive\ Virtual\ Reality\ Anatomy\ Atlas\ V01.mp4 
ffprobe version 4.0.2 Copyright (c) 2007-2018 the FFmpeg developers
  built with Apple LLVM version 9.1.0 (clang-902.0.39.2)
  configuration: --prefix=/opt/local --enable-swscale --enable-avfilter --enable-avresample --enable-libmp3lame --enable-libvorbis --enable-libopus --enable-librsvg --enable-libtheora --enable-libopenjpeg --enable-libmodplug --enable-libvpx --enable-libsoxr --enable-libspeex --enable-libass --enable-libbluray --enable-lzma --enable-gnutls --enable-fontconfig --enable-libfreetype --enable-libfribidi --disable-libjack --disable-libopencore-amrnb --disable-libopencore-amrwb --disable-indev=jack --enable-opencl --disable-outdev=xv --enable-audiotoolbox --enable-videotoolbox --enable-sdl2 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/clang --arch=x86_64 --enable-x86asm --enable-libx265 --enable-gpl --enable-postproc --enable-libx264 --enable-libxvid
  libavutil      56. 14.100 / 56. 14.100
  libavcodec     58. 18.100 / 58. 18.100
  libavformat    58. 12.100 / 58. 12.100
  libavdevice    58.  3.100 / 58.  3.100
  libavfilter     7. 16.100 /  7. 16.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  1.100 /  5.  1.100
  libswresample   3.  1.100 /  3.  1.100
  libpostproc    55.  1.100 / 55.  1.100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc626001400] stream 0, timescale not set
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Immersive Virtual Reality Anatomy Atlas V01.mp4':
  Metadata:
    major_brand     : M4V 
    minor_version   : 512
    compatible_brands: isomiso2avc1
    encoder         : Lavf56.36.100
  Duration: 00:01:10.47, start: 0.000000, bitrate: 3649 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 3502 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
    Stream #0:2: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 960x536 [SAR 144:144 DAR 120:67], 90k tbr, 90k tbn, 90k tbc




More information about the ffmpeg-user mailing list