Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

Add support or official patch for random filename segment.

Suggestions and feature requests, whislists, etc.

Add support or official patch for random filename segment.

Postby FloridaStream » Mon Nov 21, 2016 9:19 pm

Hi, can yours, ffmpeg users and team add support for this?

Sample usage:
Code: Select all
ffmpeg -i $1 -r 25 -c:a libfaac -ab:a 128k -ac:a 2 -c:v mpeg2video -s:v 640x360 -aspect:v 16:9 -map 0 -f segment -segment_time 120 -segment_list $2.m3u8 -segment_format mpegts "$2-%20r.ts"


Sample code, need fix for memory leak.
gist.github.com/FloridaStream/ee799b6b1b7310d230c2cfd1bd1e93ff

This add the code:

Code: Select all
            case 'r':
                percentd_found = 1;
                if (number < 0)
                    nd += 1;
                snprintf(buf1, sizeof(buf1), "%s", randstring(nd));
                len = strlen(buf1);
                if ((q - buf + len) > buf_size - 1)
                    goto fail;
                memcpy(q, buf1, len);
                q += len;
                goto addchar;


into
Code: Select all
libavformat/utils.c
on
Code: Select all
av_get_frame_filename


Problens with this code:
*Memory leak.
*Filename problem the r of %20r.ts is present in the filename.ts Sample: test_Ds4fg8sf5s89fd5f7440r.ts
*The live transcoding stop without error, just stop randomly after X minutes or hours.
*The file segment does not work, every segment is placed in a single segment, this ends up with several gigabites and breaks the segmentation logic.

I'm using version n2.7.7 from github repository.
I added this, but dont work as great, why ffmpeg dont have this as native? We need this. Its a very userful command.
FloridaStream
 
Posts: 4
Joined: Mon Nov 21, 2016 8:53 pm

Re: Add support or official patch for random filename segmen

Postby llogan » Mon Nov 21, 2016 11:35 pm

You can do something like this:
Code: Select all
"output_$(tr -dc A-Za-z0-9 < /dev/urandom | head -c 20).ts"


We can't support old FFmpeg branches here or third-party code.

If you want FFmpeg to support outputting a random file name please provide a patch to the ffmpeg-devel mailing list or submit a feature request to the bug tracker. However, I'm not convinced that such a feature is needed or would be accepted since you can do this using additional tools as shown above.
Get an answer more quickly by providing your actual ffmpeg command and the complete console output. Use the code button to format your command and output or your question will be ignored.
llogan
 
Posts: 2360
Joined: Fri Jan 25, 2013 9:47 pm
Location: Alaska


Return to Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest