[Libav-user] This command take 2 minutes to render. Can it be quicker?

Steve Boyer steveboyer85 at gmail.com
Thu Jun 5 15:53:10 CEST 2014


On Thu, Jun 5, 2014 at 3:15 AM, Vijay Kanta <viju.kantah at gmail.com> wrote:

> I recently added the H264 option. The regular copy "-c:v copy" was already
> present before and I got rid of them, because the video wasn't playing in
> the HTML5 or JW player. It required the special encoding.
>

That's part of the reason I was requesting samples earlier. This detail
would've been good to know beforehand.


>  As I said before audio copy didn't really make any difference when it
> worked. It's just the h264 which is required and I have to use it.
>

As Carl pointed out, audio is much faster to compress than video.

At this point, you are telling us that you must transcode the video, but
don't need to transcode the audio. I agree with Carl in that you should try
different presets. They go from fastest to slowest: ultrafast, superfast,
veryfast, faster, fast, medium, slow, slower, veryslow, placebo. The
quality and filesize will vary between all of them. I've also seen that
having a higher CRF will slightly increase speed, but the more dominant
factor is the preset.

Any video compression will use your system resources. You are wanting high
quality video, fast encoding speeds, and non-resource intense. This IMHO is
the "Good, fast, cheap - pick two" problem and you have to trade something
off here.

"-2 -strict"  were options from ffmpeg documentation when I was a noob, and
> never got rid of them.
>
> Regards,
> ~Vijay.
>

Steve


>
> On Wed, Jun 4, 2014 at 6:42 PM, Steve Boyer <steveboyer85 at gmail.com>
> wrote:
>
>> On Wed, Jun 4, 2014 at 5:32 AM, Vijay Kanta <viju.kantah at gmail.com>
>> wrote:
>>
>>> Hey guys,
>>>
>>> I found out it's the H264 encoding that is really screwing up the cpu
>>> cycles, and not the audio. @carl, moving it down didn't help, it still says
>>> invalid command.
>>>
>>> I found out that h264 encoding takes up 20 minutes with music and srt
>>> combined for a 2 min random video clip.
>>>
>>
>> That isn't surprising. That is why (and entirely my fault for not making
>> it clearer) I suggested copying the audio stream as well as copying the the
>> video stream (by using -c:v copy) as it already is in an MP4 compatible
>> format. I've never messed around with subtitles, part of the reason I was
>> asking for a sample mp3, mp4, and srt. What is the purpose of the -2 and
>> -strict options? Try removing those and see if you have any better luck. If
>> those don't work and are still unwilling to provide a sample, start with
>> omitting the subtitle portions to make sure that the streams are being
>> copied correctly, and build up from there.
>>
>> Steve
>>
>>>
>>> On Sat, May 31, 2014 at 1:24 PM, Carl Eugen Hoyos <cehoyos at ag.or.at>
>>> wrote:
>>>
>>>> Vijay Kanta <viju.kantah at ...> writes:
>>>>
>>>> > ffmpeg -i music/qT0pdDhKxFDnfJHq2.mp3 -c:a copy
>>>> > -i video/HKp1ZpHbANT4dmGRC.mp4 -vcodec libx264
>>>> > -crf 23 -vf subtitles=subtitles/1718379803.srt
>>>> > -preset ultrafast -strict -2
>>>> > film/HKp1ZpHbANT4dmGRC.mp4
>>>>
>>>> Move "-c:a copy" behind the last input file.
>>>>
>>>> But please note that compared to H264 encoding,
>>>> audio encoding should always be fast, so the
>>>> speed difference between audio copying and
>>>> audio reencoding should be less than using
>>>> different x264 presets.
>>>>
>>>> Carl Eugen
>>>>
>>>> _______________________________________________
>>>> Libav-user mailing list
>>>> Libav-user at ffmpeg.org
>>>> http://ffmpeg.org/mailman/listinfo/libav-user
>>>>
>>>
>>>
>>> _______________________________________________
>>> Libav-user mailing list
>>> Libav-user at ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/libav-user
>>>
>>>
>>
>> _______________________________________________
>> Libav-user mailing list
>> Libav-user at ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/libav-user
>>
>>
>
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://ffmpeg.org/pipermail/libav-user/attachments/20140605/85177304/attachment.html>


More information about the Libav-user mailing list