2017-05-11 5:04 GMT+02:00 Champion <[email protected]>: > 1. I use JAVA to call the ffmpeg command, and the command [3] is too slow, > I run my code in AWS EC2(c3.xlarge) and input a 6min30sec .mp4 video, > the process time about 250 sec, do I have some idea to speed up the > process time?
Only if you show us the tested command line together with the complete, uncut console output. > - I change input and output to .ts file, [3] just cost 1/6 time which > compare to output .mp4 file, > but the output quality is down(although they are the same pixel rate > 1280x720), > is this cause by speed up .ts file will lose I frame? Video quality is never affected by the container format. Transport streams and mp4 have difference video encoder defaults though, try to specify the encoder or video format you want. > - I try to add "-preset ultrafast" , the process time will become about > 40 sec, but we think this still too slow, do you have some idea to improve > this? While this is not FFmpeg but x264-related, the answer is probably: Throw more CPU (or a hardware encoder) on the task. > 2. When ffmpeg is running, the CPU rate is too high. > my server(4 core) just run one [3] command, the CPU rate almost > 250-300%, > how can I optimize the cost? > > - I try to use "-threads 1", the CPU rate down to 90-100%, but the > process time is slower. Yes, you can't have the cake and eat it. The option -threads 1 optimizes both encoding and decoding with respect to unnecessary overhead but takes of course longer in real-time. Carl Eugen _______________________________________________ ffmpeg-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
