Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
|
|
Thread Tools | Search this Thread | Display Modes |
29th April 2015, 10:28 | #1 | Link |
Registered User
Join Date: Oct 2014
Posts: 43
|
How to use x264 coding 1280*1080 resolution color videos in real time?
Dear Friends:
Now I am encoding 1280*1080 resolution color videos with x264 library, the average encoding time of each frame is about 50-60ms, but the time is too slow for me. I want to shorten the encoding time by adjusting x264 parameters, and I don't care too much about compression ratio if encoding speed is fast. I NEED YOUR WARM HELP AND ADVICE. THANK YOU VERY MUCH! |
29th April 2015, 13:39 | #2 | Link |
Retried Guesser
Join Date: Jun 2012
Posts: 1,373
|
x264 --crf 22 --preset ultrafast -o <output-path> <input-path>
If that is not fast enough, seek help from Intel or AMD EDIT add --tune zerolatency if you are streaming live video. Last edited by raffriff42; 29th April 2015 at 13:49. |
29th April 2015, 16:53 | #4 | Link |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
That seems very slow considering the encoder parameters and the resolution.
What CPU does this run on? Can you describe your workflow in more detail? Do you use Avisynth to feed the frames?
__________________
Groucho's Avisynth Stuff |
2nd May 2015, 22:00 | #5 | Link |
Registered User
Join Date: Oct 2014
Posts: 43
|
Thank you very much! I really find that RGB2YUV function consumes much times, because I have to transfer the RGB color image to yuv format,
it is the real reason why the encoding is so slow. Do you have any idea to accelerate RGB2YUV functions for x264 ? By the way , what does that mean of " Do you use Avisynth to feed the frames?" Thank you very much! |
2nd May 2015, 22:05 | #6 | Link | |
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
|
Quote:
__________________
Groucho's Avisynth Stuff |
|
2nd May 2015, 22:06 | #7 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
In the former case, I suggest you replace your own code with a highly optimized library (instead of reinventing the wheel), unless your own code is very optimized already, of course. I think x264 uses libswscale for this purpose. Alternatives you could look into include the colorspace conversion routines of Avisynth, or maybe the fmtconv plug-in for VapourSynth. Well, do you call the x264 library directly (from your own code) or do you use the x264 command-line encoder? In the latter case, do you feed x264 with an Avisynth script or with something else?
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 2nd May 2015 at 22:43. |
|
3rd May 2015, 10:23 | #9 | Link | |
Registered User
Join Date: Oct 2014
Posts: 43
|
Quote:
2. You mean that I use libswscale to RGB2YUV color space conversion or directly let x264 to encode RGB directly, which will use libswscale for a conversion inside? 3. OK, I will see your montioned avisynth2 and fmtconv methods 4. I use x264 library directly to encode, any good ideas for me still? Thank you very much! |
|
3rd May 2015, 12:29 | #10 | Link | |
Software Developer
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
|
Quote:
This happens inside the command-line front-end, not inside the "core" library. Code:
x264_8bit_x86.exe --crf 16 -o test.mp4 foreman_cif.rgb.avi lavf [info]: 352x288p 0:1 @ 25/1 fps (vfr) resize [warning]: converting from bgr24 to yuv420p x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 Cache64 SlowShuffle x264 [info]: profile High, level 1.3 Still, it doesn't mean that you have to implement it all by yourself. You could try using something like libswscale or "borrowing" code from Avisynth or fmtconv...
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊ Last edited by LoRd_MuldeR; 3rd May 2015 at 14:43. |
|
3rd May 2015, 20:26 | #11 | Link | |
Registered User
Join Date: Oct 2014
Posts: 43
|
Quote:
|
|
Tags |
high resolution, x264 |
Thread Tools | Search this Thread |
Display Modes | |
|
|