A
A
accountnujen2021-10-23 22:30:58
Video
accountnujen, 2021-10-23 22:30:58

How to optimize query when converting dav to mp4?

The camera shoots in dav h265 (cannot be changed) and I need to convert the video to any format that telegram perceives as video (mp4, avi, etc.). There is a similar question on the net where the solution is:

ffmpeg -y -i input-file.dav -c:v libx264 -crf 24 output-file.mp4

however, this code, when converting a 16-second video on a 6-core xeon, takes 13 seconds, and on a 4-core ARM Ampere, 23 seconds. And one could say that I run into the performance of the servers, however, when decoding, the following video parameters are displayed:
Input #0, dhav, from '111.dav':
Video: hevc (Main), yuv420p(tv), 1920x1080, 25 fps, 100 tbr, 1k tbn

and they are converted to this
Output #0, mp4, to '111.mp4':
Video: h264 (libx264) (avc1 / 0x31637661),yuv420p, 1920x1080, q=-1--1, 100 fps, 12800 tbn, 100 tbc

That is, from nifiga he takes and changes the parameters of the video. If I change fps from 100 to native 25 in the request, then I will get 9 seconds instead of 23 on Ampere. I don't know, but it changed for some reason. FFMPEG somehow doesn't make the best use of the resources it has.

Therefore, the question is: how can you optimize the query to get the fastest possible result?
p.s. I'm not so much concerned about the size of the file as the time it takes to encode it.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
@
@nidalee, 2021-10-24
_

ffmpeg -y -i input-file.dav -codec copy output-file.mp4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question