Jump to content

What does ffmpeg *actually* do?

babadoctor
Go to solution Solved by mariushm,

That particular command simply tells ffmpeg to take in a file and output another file, leaving everything else to "default"  / "do the best you can"

-i tells the next parameter/argument is the input file name

the last parameter/argument is assumed to be output file name, unless somewhere else in the list you have something like -o or --output or whatever the explicit switch is for ffmpeg to consider what's after as the output file name.

 

Since you don't specify what video codec or what audio codec is to be used, ffmpeg will guess what codecs would be compatible and usable based on the extension of the output file name (for example, if the extension was .mp3 ffmpeg can determine from that you want an audio only output, and that only mpeg 1 level 3 audio codec can be used within the mp3 container specified by the mp3 extension.

 

IF the video and audio codec of the ts file are compatible with the mp4 container, ffmpeg may default to copying the audio and video streams without processing. Basically, it's a "re-mux" to mp4.

If they can't be simply copied over, ffmpeg will probably pick a default codec like h264 for video, or AAC for audio.

 

You can explicitly say to copy a video track or audio track with a parameter, something like -vcodec copy  or -acodec copy  (not sure these are the exact parameter names)  and it will do it if it's possible.

When I run 

ffmpeg -i input.ts output.mp4

what is it actually doing? It seems to re encode the video, but what is it actually doing in this command?

 

I can't find anything about this online, about what ffmpeg does when no params are specified.

 

Any ideas?

OFF TOPIC: I suggest every poll from now on to have "**CK EA" option instead of "Other"

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, babadoctor said:

Any ideas?

Without any other parameters, it looks at the file-extension of the output-file to come up with the codecs to use. I think with mp4, it defaults to using AAC and H.264, if it has been compiled with support for those codecs.

Hand, n. A singular instrument worn at the end of the human arm and commonly thrust into somebody’s pocket.

Link to comment
Share on other sites

Link to post
Share on other sites

That particular command simply tells ffmpeg to take in a file and output another file, leaving everything else to "default"  / "do the best you can"

-i tells the next parameter/argument is the input file name

the last parameter/argument is assumed to be output file name, unless somewhere else in the list you have something like -o or --output or whatever the explicit switch is for ffmpeg to consider what's after as the output file name.

 

Since you don't specify what video codec or what audio codec is to be used, ffmpeg will guess what codecs would be compatible and usable based on the extension of the output file name (for example, if the extension was .mp3 ffmpeg can determine from that you want an audio only output, and that only mpeg 1 level 3 audio codec can be used within the mp3 container specified by the mp3 extension.

 

IF the video and audio codec of the ts file are compatible with the mp4 container, ffmpeg may default to copying the audio and video streams without processing. Basically, it's a "re-mux" to mp4.

If they can't be simply copied over, ffmpeg will probably pick a default codec like h264 for video, or AAC for audio.

 

You can explicitly say to copy a video track or audio track with a parameter, something like -vcodec copy  or -acodec copy  (not sure these are the exact parameter names)  and it will do it if it's possible.

Link to comment
Share on other sites

Link to post
Share on other sites

15 hours ago, babadoctor said:

what is it actually doing? It seems to re encode the video, but what is it actually doing in this command?

It guessed what output format you wanted from the extension and converted the input file to that format.

 

If you want to know more, try

man ffmpeg

 

Don't ask to ask, just ask... please 🤨

sudo chmod -R 000 /*

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×