I understand how to make timelapse video from the sequence of files.
But what if my files have names like YYYYMMDDHHmmSS.jpg? How can I pass them in the correct order? I would prefer not to rename them (there are 55'000 files, almost 10 Gb).
I just found that there is no much sense to do any additional actions, the files are already sorted in the correct order, so the command below works well:
ffmpeg -framerate 500 -pattern_type glob -i '*.jpg' -c:v libx264 -pix_fmt yuv420p out2.mp4
I know there are some bat/shell commands possible for that, but IMHO it makes things more complicated for so little.
In similar cases I prefer using renaming softwares like Ant Renamer.
Drag & drop your files in the main window
In the Actions tab, click Enumeration in the list
You're given a naming scheme (look down the options to see the different schemes available).
I recommend using the default %name%_%num%%ext%, starting at 1 and with one more digit than your total number of files. Which in your case will result in YYYYMMDDHHmmSS_XXX.jpg
Click the Go button to process.
Once finished, check if the numbers added adequate the original file names (it should since the naming used is already chronological, but do check for safety).
It might not suit you, especially if you really want to do everything from command lines. But for other people, it might be enough.
Related
I'm having an issue where I'm trying to concat 4 audio files into one file, I want them to not play on each other, only after each other. I was wondering if this was possible.
I have it working somewhat right now, however, the final result is weird, the first, second, and 4th ones sound okay, but the 3rd one, the longest in my case, is sped up like a chipmunk.
Here is the command I typed
ffmpeg -f concat -i mylist.txt -c copy output.wav
And here is the mylist.txt:
file 'Alert.wav' file 'Attention.wav' file 'voice.wav' file 'Clear.wav'
I am trying to get the results to be the same length, and the same quality as their source files. Just, connected in one file, kind of like if you open a video editor and attach them into one, but that in my case will not work because I need it to be automated.
I am having an image sequence input of webp-s concatenated (for various reasons) in a single file. I have a full control over the single file format and can potentially reformat it as a container (IVF etc.) if a proper exists.
I would like ffmpeg to consume this input and time properly each individual frame (consider first displayed for 5 seconds, next 3 seconds, 7, 12 etc.) and output a video (mp4).
My current approach is using image2pipe or webp_pipe followed by a list of loop filters, but I am curious if there are any solid alternatives potentially a simple format/container I could use in order to reduce or completely avoid ffmpeg filter instructions as there might be hundreds or more in total.
ffmpeg -filter_complex "...movie=input.webps:f=webp_pipe,loop=10:1:20,loop=10:1:10..." -y out.mp4
I am aware of concat demuxer but having a separate file for each input image is not an option in my case.
I have tried IVF format which works ok for vp8 frames, but doesnt seem to accept webp. An alternative would be welcomed, but way too many exists for me to study each single one and help would be appreciated.
What I did so far:
I learned with this answer that I can use negative mapping to remove unwanted streams (extra audio, subtitles) from my video files.
I them proceeded to apply it to a few dozen files in a folder using a simple for /r loop on Windows' cmd. Since I thought this process as some kind of trim, I didn't care about my original files and wanted ffmpeg to replace them, which of course it cannot.
I tried to search a bit further and find ways to work around this issue without simply using a new destination an manually replacing files afterwards, but had no luck.
However a lot of my findings seemed to indicate that ffmpeg has capabilities to use external temporary files for some of it's functions, even though I couldn't really find more onto it.
What I want to do:
So is there any way that I can make ffmpeg remove those extra streams and them replace the original file somehow. I'll also be needing to use this to multiple file, by I don't think this would be a big issue...
I really need this to be done with ffmpeg, as learning the tool to it's full extent is a long-therm goal of mine and I want to keep working on that curve, but as for batch/cmd, I prefer it because I haven't properly learned a programming language yet (even if I often meddle with a few), but I would be happy to use suggestions of any kind for handling ffmpeg!
Thank you!
Not possible with ffmpeg alone
ffmpeg can't do in-place file changes.
The output must be a new file.
However, deleting/removing/replacing to original file with the new file should be trivial in your batch script.
I saw some vague references while searching and also stumbled upon the cache protocol and -hls_flags temp_file
The cache protocol allows some limited seeking during playback of live inputs. -hls_flags temp_file is only usable with the HLS muxer and creates a file named filename.tmp which is then renamed once the active segment completes. Neither are usable for what you want to do.
Say we have many video records that we want merge with -vcodec copy (or equivalent syntax). Without reencoding, without loss of quality. And few records (minor set), with another codecs, parameters and so on. So we can use ffprobe for file, that represent majority of sources. We get lot of information.
But can we get here commandline hints for ffmpeg, that could be used to convert another (not yet "compatible") files to this same format? At least for one selected stream of "master" file, for example.
Question is not about some scpecific output codec and so on.
There is no exsitsing tool to to this. You would need to write one.
Each video stream inside a video file can only include same codec. So I recommend you to at first step, merge files with same codec with -vcodec copy. The check if which codec is mostly available in your merged files (e.g. CodecA). At second step, convert other merged files with other codecs to CodecA. Finally, merge all files (which all have now CodecA) with -vcodec copy.
Please keep in mind that if the video files are in different sizes, you have to reencode them.
how can i create a checksum of only the media data without the metadata to get a stable identification for a media file. preferably an cross platform approach with a library that has support for many formats. e.g. vlc, ffmpeg or mplayer.
(media files should be audio and video in common formats, images would be nice to have too)
Well, it may be 11 years too late for an answer, but in case others like me stumble upon this...
ffmpeg can output checksums for individual streams. So the same audio or video would output the same checksum independently of it's container format or metadata.
Example for the video track of file $filename, writing the output to $filename.md5 :
ffmpeg -i "$filename" -map 0:v -codec copy -f md5 "$filename.md5"
For audio, use -map 0:a.
To output to STDOUT, use -. For example:
ffmpeg -i "$filename" -map 0:a -codec copy -hide_banner -loglevel warning -f md5 -
I don't know of any existing platform-independent software that will accomplish this, but I do know a way that this could be accomplished in an interpreted (platform-independent) language such as Java.
Essentially, we simply need to strip any metadata (tags) from the file, demultiplexing video files beforehand. Theoretically after demux and removing metadata, one could hash the file and compare against another file that has undergone the same process to match identical files despite having different tags. Unlike a fingerprint, this would not identify similar songs/movies but identical files (imagine you might want the 10 different versions or bitrates of a given song you've archived, but don't want 2 identical copies of any of them floating around).
The most troubling part of this is removing tags as there are many different specifications for tag formats which are not necessarily implemented the same across different applications, i.e. the same exact audio file given identical tags separately through two different applications may not result in identical output files. The only way this could pose an issue fatal to the concept of an audio-only checksum is if popular tagging software makes any changes to the binary audio portion of the file, or pads the audio in a non-standard way.
Taking a checksum is trivial, but I'm not aware off the top of my head of any platform independent libraries to demux and detag mpeg files. I know that in 'nix environments, mpgtx is a great command-line tool that could perform the demux and detag, but obviously that is not a platform-independent solution.
Maybe someone out there feels ambitious?
one possible solution i found seems to be with vlc:
./VLC -I rc snd.mp3 :sout='#std{mux=raw,access=file,dst=-}' vlc://quit | sha1sum