ffmpeg to segment a video stream and I would like
ffmpeg to name the segment files with a created date/timestamp.
Is this possible?
Let's say I have segments of 30sec video each:
When I do
ffprobe of each video segment I "correctly" get 30 seconds, which is nice.
However, each file has a "last modified time"/"created time" that I can read, and when I subtract
0001.flv (modified time) -
0000.flv (modified time) I get a result of 29 seconds.
The video duration is 30 seconds, but the time between either date created or last modified is 29 seconds!
If the segment time is 600 seconds then the time between either date created or last modified is 591 seconds! So it's missing 9 seconds according to the file system but the video is indeed 600 seconds.
This is a huge problem -- can someone please help?
This is my commandline:
ffmpeg = spawn('ffmpeg', [ '-loglevel', 'quiet', '-r', '20', '-i', 'pipe:0', '-vcodec', 'copy', '-f', 'segment', '-segment_time', '30', dataDir + '/' + '%04d.flv' ]);
Also, when ffmpeg writes the segment the files have no "birth time" and the "created" & "modified" time is always the same.. so i really can never know when the file was actually created unless i use a "debugfs" (in sudo mode) to dig deeper....
all i want is ffmpeg to put a timestamp in the filename when it creates the segment, why is this not seen as useful? i think its very useful when capturing time from a live source...
and i am NOT encoding-- stop thinking that this is encoding please... i know that transcoding take longer and cause delays in time...
From my observation, doing a codec copy, the "last modified" time between segments is only 591 seconds when i have my video duration at 600 seconds... so i am actually losing time...
But i know this is not a reliable timestamp-- so i am asking for a way to get a more reliable timestamp from ffmpeg other than having to use the "stat" command which is not giving me reliable timestamps...
And yes-- my camera is producing at 20 fps :)