I want to save a
bmp file as
1.mp4 using Ffmpeg, how to achieve it?
The question is very simple. I have some source file, lets call it
source.png and I want to encode it as
bmp, but to save it as a file with extension
mp4. Of course, one way to achieve it is to save it as file with
bmp extension and then use command line to rename it to
mp4. But, that is not what I want. I want it directly to be saved as
I searched on internet and I found that in order to achieve it, one should specify
-f parameter. This is my command line:
ffmpeg -hide_banner -i source.png -f bmp 1.mp4
And, of course, I got an error
Requested output format 'bmp' is not a suitable output format.. I continued searching for solution and I found that calling Ffmpeg with parameter
-formats displays all supported formats. I did it and I found only one format containing word
D bmp_pipe piped bmp sequence
Then I replaced
-f bmp with-f bmp_pipe`, but again I got the same error. So, how to properly do it?
In general, my question is: given extension (for example
bmp in this case), how to determine the word which needs to be placed after
-f in order to encode like that extension is present?
Maybe I was not clear enough in the question. I'm looking for a way to find the connection between extension (
avi, etc) and the Ffmpeg parameter I need to pass in order to encode to that extension.
Basically, I'm creating a user interface application where:
- User enters extension (for example
- User enters output file name (for example
C:\1.exe(just a dumb example))
- I need to spawn ffmpeg process which will encode input file like output file is in that extension which user specified
I hope it is more clear now.