[FFmpeg-user] h265 hev1/hvc1

AB_ffmpeg ffmpeg at rgbaz.eu
Fri Aug 28 16:13:07 CEST 2015


Hi everyone,

I am trying to match an MP4 but can't find the correct options to
achieve what I need.
Below are outputs of the ffmpeg command and an output of ffprobe
from the resulting video.

What I'm after are the following settings:
-have 'hvc1 / 0x31637668' as the encoding of the h265 video stream
   I'm unable to find how to set the NAL in the x265 options. Is it 
possible to
   create such a file?
-I would also like to have the brand, minor_version, and compatible_brands
   to stay the same as the input (resp. mp42, 0, isommp42).
   I was able to change the brand by adding '-brand mp42', but i'm not sure
   if that's the correct way...

Can anyone hint me how to achieve this?

thanks in advance

gr
Arno





% ffmpeg -i inputFile.mp4 -c:v libx265 outputFile.mp4

ffmpeg version 2.7.2 Copyright (c) 2000-2015 the FFmpeg developers
   built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 
3.6.0svn)
   configuration: --prefix=/usr/local/Cellar/ffmpeg/2.7.2_1 
--enable-shared --enable-pthreads --enable-gpl --enable-version3 
--enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= 
--host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame 
--enable-libvo-aacenc --enable-libxvid --enable-libfreetype 
--enable-libvorbis --enable-libvpx --enable-libass --enable-ffplay 
--enable-libfdk-aac --enable-libopus --enable-libquvi --enable-libx265 
--enable-nonfree --enable-vda
   libavutil      54. 27.100 / 54. 27.100
   libavcodec     56. 41.100 / 56. 41.100
   libavformat    56. 36.100 / 56. 36.100
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 16.101 /  5. 16.101
   libavresample   2.  1.  0 /  2.  1.  0
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  2.100 /  1.  2.100
   libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'inputFile.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: isommp42
     creation_time   : 2015-08-28 09:36:09
   Duration: 00:00:01.02, start: 0.000000, bitrate: 2829 kb/s
     Stream #0:0(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 
stereo, fltp, 155 kb/s (default)
     Metadata:
       creation_time   : 2015-08-28 09:36:10
       handler_name    : Mainconcept MP4 Sound Media Handler
     Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), 
yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 2724 kb/s, 24 fps, 24 
tbr, 24k tbn, 48 tbc (default)
     Metadata:
       creation_time   : 2015-08-28 09:36:10
       handler_name    : Mainconcept MP4 Video Media Handler
       encoder         : AVC Coding
x265 [info]: HEVC encoder version 1.7
x265 [info]: build info [Mac OS X][clang 6.1.0][64 bit] 16bpp
x265 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle
x265 [info]: Main 10 profile, Level-3.1 (Main tier)
x265 [info]: Thread pool created using 4 threads
x265 [info]: frame threads / pool features       : 2 / wpp(12 rows)
x265 [info]: Internal bit depth                  : 10
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut       : 24 / 250 / 40
x265 [info]: Lookahead / bframes / badapt        : 20 / 4 / 2
x265 [info]: b-pyramid / weightp / weightb / refs: 1 / 1 / 0 / 3
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 64 / 1
x265 [info]: Rate Control / qCompress            : CRF-28.0 / 0.60
x265 [info]: tools: rd=3 psy-rd=0.30 signhide tmvp strong-intra-smoothing
x265 [info]: tools: deblock sao
Output #0, mp4, to 'ug.mp4':
   Metadata:
     major_brand     : mp42
     minor_version   : 0
     compatible_brands: isommp42
     encoder         : Lavf56.36.100
     Stream #0:0(eng): Video: hevc (libx265) ([35][0][0][0] / 0x0023), 
yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 24 fps, 12288 tbn, 24 tbc 
(default)
     Metadata:
       creation_time   : 2015-08-28 09:36:10
       handler_name    : Mainconcept MP4 Video Media Handler
       encoder         : Lavc56.41.100 libx265
     Stream #0:1(eng): Audio: aac (libfdk_aac) ([64][0][0][0] / 0x0040), 
48000 Hz, stereo, s16, 139 kb/s (default)
     Metadata:
       creation_time   : 2015-08-28 09:36:10
       handler_name    : Mainconcept MP4 Sound Media Handler
       encoder         : Lavc56.41.100 libfdk_aac
Stream mapping:
   Stream #0:1 -> #0:0 (h264 (native) -> hevc (libx265))
   Stream #0:0 -> #0:1 (aac (native) -> aac (libfdk_aac))
Press [q] to stop, [?] for help
frame=   25 fps=4.3 q=0.0 Lsize=      32kB time=00:00:01.02 bitrate= 
252.2kbits/s dup=1 drop=0
video:10kB audio:18kB subtitle:0kB other streams:0kB global headers:1kB 
muxing overhead: 10.141912%
x265 [info]: frame I:      1, Avg QP:22.10  kb/s: 758.21
x265 [info]: frame P:      5, Avg QP:27.18  kb/s: 131.56
x265 [info]: frame B:     19, Avg QP:35.30  kb/s: 32.44
x265 [info]: global :     25, Avg QP:33.15  kb/s: 81.29
x265 [info]: Weighted P-Frames: Y:0.0% UV:0.0%
x265 [info]: consecutive B-frames: 16.7% 0.0% 0.0% 16.7% 66.7%




% ffprobe outputFile.mp4

ffprobe version 2.7.2 Copyright (c) 2007-2015 the FFmpeg developers
   built with Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 
3.6.0svn)
   configuration: --prefix=/usr/local/Cellar/ffmpeg/2.7.2_1 
--enable-shared --enable-pthreads --enable-gpl --enable-version3 
--enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= 
--host-ldflags= --enable-opencl --enable-libx264 --enable-libmp3lame 
--enable-libvo-aacenc --enable-libxvid --enable-libfreetype 
--enable-libvorbis --enable-libvpx --enable-libass --enable-ffplay 
--enable-libfdk-aac --enable-libopus --enable-libquvi --enable-libx265 
--enable-nonfree --enable-vda
   libavutil      54. 27.100 / 54. 27.100
   libavcodec     56. 41.100 / 56. 41.100
   libavformat    56. 36.100 / 56. 36.100
   libavdevice    56.  4.100 / 56.  4.100
   libavfilter     5. 16.101 /  5. 16.101
   libavresample   2.  1.  0 /  2.  1.  0
   libswscale      3.  1.101 /  3.  1.101
   libswresample   1.  2.100 /  1.  2.100
   libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'outputFile.mp4':
   Metadata:
     major_brand     : isom
     minor_version   : 512
     compatible_brands: isomiso2mp41
     encoder         : Lavf56.36.100
   Duration: 00:00:01.07, start: 0.042667, bitrate: 242 kb/s
     Stream #0:0(eng): Video: hevc (Main 10) (hev1 / 0x31766568), 
yuv420p10le(tv), 1280x720 [SAR 1:1 DAR 16:9], 82 kb/s, 24 fps, 24 tbr, 
12288 tbn, 24 tbc (default)
     Metadata:
       handler_name    : VideoHandler
     Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 
stereo, fltp, 139 kb/s (default)
     Metadata:
       handler_name    : SoundHandler


More information about the ffmpeg-user mailing list