#11212 closed enhancement (no change required)
Video encoding is single-threaded
Reported by: | kallisti5 | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Kits/Media Kit | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Converting a video with MediaConverter results in a single thread being consumed. As FFMPEG supports multiple threads for encoding, this should be investigated. (or an option added to MediaConverter to specify threads)
Attachments (1)
Change History (16)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
For decoding it's done here. Now it's up to the encoder/decoder to actually use this setting.
comment:3 by , 10 years ago
Isn't system_info.info.cpu_count set to the number of cpu cores? If i'm right, it's actually the expected way to work, and there's not any advantage on raw calculus to increase or decrease the number of threads behind.
comment:4 by , 10 years ago
That code is only for decoding, we need to do the same for encoding (in AVCodecEncoder). As mentionned this also assumes ffmpeg will actually use the setting (it may not do so with some video formats).
by , 10 years ago
Attachment: | 0001-Set-thread_count-configuration-variable-to-actual-nu.patch added |
---|
comment:5 by , 10 years ago
patch: | 0 → 1 |
---|
comment:6 by , 10 years ago
I was referring mostly to add it as a configurable option in MediaConverter. In the patch attached i've add the setting in the fContext of AVCodecEncoder and it adds two threads with my dual core cpu compared to the same rev built without it. The cores are more balanced, it can be seen in ProcessController where without the patch there's just one core in high load.
comment:7 by , 10 years ago
There's anyway an accuracy drop when the patch is applied, it may be related to the comments contained in AVFormatReader.cpp. Our version of ffmpeg is also compiled without the --enable-pthread flag which may be cause of problems.
comment:8 by , 9 years ago
What do you mean by "accuracy drop"? Is the encoding less good?
Another option could be to process several files at a time at MediaConverter side. This would be more generic and work also with other encoders, but help with MediaConverter only, and not with other apps.
comment:9 by , 9 years ago
The resulting files played correctly in MediaPlayer but the image was visibly distorted with things like frames dropped. I think the result was different depending on the format, but it has passed a few time since i've tested it.
comment:10 by , 8 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:12 by , 7 years ago
patch: | 1 → 0 |
---|
comment:14 by , 6 years ago
Resolution: | → no change required |
---|---|
Status: | assigned → closed |
Patch was abandoned as it is not needed, FFmpeg does this already.
comment:15 by , 5 years ago
Milestone: | Unscheduled |
---|
Remove milestone for tickets with status = closed and resolution != fixed
Does the ancinet version of ffmpeg we use support multiple threads, or is that a more recent addition to ffmpeg?