Question / Help How to use the ffmpeg custom output to record video as png files?

John Guo

New Member
Hi, I want to record video as the png files. I choose the ffmpeg output to complish this. The "image2(Video)" option was selected for The "Container Format" and the "png" option was selected for the "Video Encoder".
1546931064554.png


When I clicked "Start Recording" there was an error dialog with "An unspecified error occurred while recording".

1546931127488.png


Here is the log file.

Any ideas?
 

Attachments

My experience with the custom ffmpeg output is that OBS insists on having both the video as well as the audio part active in the encoder section. I was not able to make OBS throw away either the audio or the video part. Disabling one encoder as you did didn't work, unfortunately. I was only able to select a container format that is able to contain both audio and video for a successful output.
So here you might be out of luck. I'm not telling it cannot be done, but I tried many audio-only and video only container formats+video encoder+audio encoder combinations to either produce only video or only audio and failed.
If you somehow manage to make it work nonetheless, please let us know.
 
My experience with the custom ffmpeg output is that OBS insists on having both the video as well as the audio part active in the encoder section. I was not able to make OBS throw away either the audio or the video part. Disabling one encoder as you did didn't work, unfortunately. I was only able to select a container format that is able to contain both audio and video for a successful output.
So here you might be out of luck. I'm not telling it cannot be done, but I tried many audio-only and video only container formats+video encoder+audio encoder combinations to either produce only video or only audio and failed.
If you somehow manage to make it work nonetheless, please let us know.

After many times hard try, I found if you specified the filename just like it as the ffmpeg command line argument, it worked!
1547002086366.png


But another problem was coming, I could not set the framerate to control the number of picture files per second. Neither "Video Bitrate" nor "Keyframe interval" can control this.
 
That's probably set in Settings->Video->fps.
Great that you found out that giving a filename helps that module figuring out what it should do.
 
Last edited:
By the way, by giving fractional such as 1/5, you are able to create one frame (png picture) every 5 seconds. You can use this for timelapse recordings or for a sane amount of images. 60 images per second would be somewhat excessive ;)
On the other hand, for timelapse videos you don't need to write png's, you can record directly to the standard video format with a fps below 1 and use a fps changer in postprocessing.
 
after searching for 6 hours for the solution to this problem and this being the fix, all I've got to say is thank you for coming back to put up the solution.
from november 2021
 
Thank you for your sharing. This method does enable me to save the pictures successfully, but NOW I have a problem: there are many empty pictures with 0 Btye in the saved pictures. I am trying to solve this problem, but there is no result
 
Back
Top