[FFmpeg-devel] [PATCH] Adding mkdir option for img2enc (2nd attempt)

Michael Niedermayer michael at niedermayer.cc
Wed Dec 27 03:41:11 EET 2017


On Tue, Dec 26, 2017 at 10:44:31PM +0000, Dr Alan Barclay wrote:
> Hi All,
> 
> Please would someone with an interest in img2enc take a look at my revised
> patches for a minor feature addition and consider committing it to the main
> line for me.
> 
> Example:
> ffmpeg -i ~/trailer.mp4 -strftime 1 -mkdir 1 %Y/%m/%d/out_%H-%M-%S.jpg
> 
> Without the new mkdir option, this command will fail if the directory
> hierarchy for the jpg files does not already exist, which can be difficult
> to predict for time-stamped directories.
> 
> This patch adds a mkdir option to img2enc which invites it to make whatever
> directory hierarchy is necessary for each output file. When used in
> conjunction with the strftime then the jpg files will be located in a newly
> created (time-stamped) directory as processing progresses.
> 
> My typical usage scenario is capturing a long-running live video feed
> (perhaps time-lapsed) and storing the resulting images in a time-stamped
> directory hierarchy fashion, rather than as a numbered sequence of files in
> a single directory.
> 
> If you look at the code you will see that only a half dozen lines of code
> were required in img2enc. The function for creating directories already
> existed in hlsenc.c but I've moved into utils.c as I presumed that was a
> more generic location for it.
> 
> All comments appreciated.
> 
> Thanks ad Regards,
> Alan.
> 
> 
> On 17/12/17 22:46, Carl Eugen Hoyos wrote:
> >2017-12-17 23:41 GMT+01:00 Dr Alan Barclay <alan at escribe.co.uk>:
> >
> >>Please would someone with an interest in img2enc take a look
> >>at my minor feature addition and consider committing it to the
> >>main line for me.
> >To be acceptable, the patch has to be split in two and please
> >move the definition into internal.h
> >
> >Carl Eugen
> >_______________________________________________
> >ffmpeg-devel mailing list
> >ffmpeg-devel at ffmpeg.org
> >http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

>  hlsenc.c   |   35 +----------------------------------
>  internal.h |    7 +++++++
>  utils.c    |   33 +++++++++++++++++++++++++++++++++
>  3 files changed, 41 insertions(+), 34 deletions(-)
> 9560fd03958f79f77b01c0e02c55d98e3dc7b937  0001-Move-mkdir_p-renamed-ff_mkdir_p-from-hlsenc.c-to-uti.patch
> ---
>  libavformat/hlsenc.c   | 35 +----------------------------------
>  libavformat/internal.h |  7 +++++++
>  libavformat/utils.c    | 33 +++++++++++++++++++++++++++++++++
>  3 files changed, 41 insertions(+), 34 deletions(-)

these patches are missing commit messages
patches should be genrated with git format-patch or git send-email


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Elect your leaders based on what they did after the last election, not
based on what they say before an election.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20171227/834648dd/attachment.sig>


More information about the ffmpeg-devel mailing list