[FFmpeg-devel] [PATCH] libavformat/segment: strftime date sub-directories

James Courtier-Dutton james.dutton at gmail.com
Mon Sep 24 21:58:26 EEST 2018

On 24 September 2018 at 13:48, Moritz Barsnick <barsnick at gmx.net> wrote:

> On Mon, Sep 24, 2018 at 12:39:42 +0100, James Courtier-Dutton wrote:
> > Automatically create sub-directories if needed based on date.
> > E.g.
> > ffmpeg ... -timelimit 2147483647 -f segment -strftime 1 -segment_time 10
> "%Y/%m/%d/%Y-%m-%d_%H-%M-%S.mkv"
> [...]
> > +static int mkdir_p(const char *path) {
> Is this code duplicated from libavformat/hlsenc.c?
> I don't know what the policy is, and how code from hls vs. segment has
> been deduplicated previously, but it seems like this is a candidate for
> being careful.
It is a duplicate from hisenc.c.  hisenc already has this "create
sub-directories" feature, but I needed it for the segment use case.
I made it static so that it would be treated as local to the .c file.
I don't know ffmpeg well enough to know how best to de-duplicate it.
I am happy to update my patch, if someone can give me a pointer as to what
to do.

Kind Regards


More information about the ffmpeg-devel mailing list