@@ -204,6 +204,38 @@ const convertToAv1 = (options: ConvertOptions) => convert(options.outputPath, {
204204 options . outputPath
205205) ) ;
206206
207+ // eslint-disable-next-line @typescript-eslint/promise-function-async
208+ const convertToHevc = ( options : ConvertOptions ) => convert ( options . outputPath , {
209+ onProgress : ( progress , estimate ) => {
210+ options . onProgress ( 'Converting' , progress , estimate ) ;
211+ } ,
212+ startTime : options . startTime ,
213+ endTime : options . endTime
214+ } , conditionalArgs (
215+ '-i' , options . inputPath ,
216+ '-r' , options . fps . toString ( ) ,
217+ '-c:v' , 'libx265' ,
218+ '-c:a' , 'libopus' ,
219+ '-preset' , 'medium' ,
220+ '-tag:v' , 'hvc1' , // Metadata for macOS
221+ {
222+ args : [ '-an' ] ,
223+ if : options . shouldMute
224+ } ,
225+ {
226+ args : [
227+ '-s' ,
228+ `${ makeEven ( options . width ) } x${ makeEven ( options . height ) } ` ,
229+ '-ss' ,
230+ options . startTime . toString ( ) ,
231+ '-to' ,
232+ options . endTime . toString ( )
233+ ] ,
234+ if : options . shouldCrop || ! areDimensionsEven ( options )
235+ } ,
236+ options . outputPath
237+ ) ) ;
238+
207239// eslint-disable-next-line @typescript-eslint/promise-function-async
208240const convertToApng = ( options : ConvertOptions ) => convert ( options . outputPath , {
209241 onProgress : ( progress , estimate ) => {
@@ -250,6 +282,7 @@ export const crop = (options: ConvertOptions) => convert(options.outputPath, {
250282export default new Map ( [
251283 [ Format . gif , convertToGif ] ,
252284 [ Format . mp4 , convertToMp4 ] ,
285+ [ Format . hevc , convertToHevc ] ,
253286 [ Format . webm , convertToWebm ] ,
254287 [ Format . apng , convertToApng ] ,
255288 [ Format . av1 , convertToAv1 ]
0 commit comments