Quantcast

The efficacy of speed up a .ts file

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

The efficacy of speed up a .ts file

Champion
Hi ffmpeg members,

Recently, I have a job to make a speed up mp4 file, and I'm lack of video
knowledge,
so I suffer some issue, below is the command I used:

[1] trim ts file
     ffmpeg -ss 2 -i input.ts -t 5 -vcodec copy -acodec copy output.ts

[2] merge ts file
     ffmpeg -i concat:input1.ts|input2.ts|inputN.ts -y -c copy -bsf:a
aac_adtstoasc output.mp4

[3] speed up 2x and output a mp4 file
     ffmpeg -i input.mp4 -y -filter:v fps=30, setpts=0.5*PTS -an output.mp4

The issue are below:
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?

    - 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?

    - 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?

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.

We want to develop this speed up model as a service, but the process speed
and CPU rate are not good for a service,
do you have some suggest for us?

Many thanks.

Best regards,
Champion Chen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: The efficacy of speed up a .ts file

Carl Eugen Hoyos-2
2017-05-11 5:04 GMT+02:00 Champion <[hidden email]>:

> 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
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Loading...