Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
FFMPEG Generate video clips and concatenate them all
8 février 2020, par lms702I have a bunch of images (.png) and audio files (.wav) that I want to combine and concatenate. For example, if I have a1.wav, i1.png, a2.wav, and i2.png, I want to output a video that is a1.wav overlayed onto i1.png, then (concatenated to a2.wav overlayed onto i2.png.
Currently, my approach is to save each individual clip and then concatenate them all at the end.
To save each clip, I use this command (in a loop for all of my clips):
ffmpeg -i {imageFile} -i {audioFile} -nostdin -qscale:v 1 -vcodec libx264 -pix_fmt yuv420p {outputFile.mp4}``
It outputs an mp4 that kind of works - the playback is really buggy but works in full screen.
My current approach to concatenating has not been at all successful. I create a list of the clip names and put it into {filename} then call this command:
ffmpeg -f concat -i {filename} -c copy clips/finalOutput.mp4
This outputs a pretty jumbled video and this error repeated:
[mp4 @ 000001cdec110740] Non-monotonous DTS in output stream 0:1; previous: 1045041, current: 604571; changing to 1045042. This may result in incorrect timestamps in the output file.
So, a few questions.
What is the best way to go about this process?
Should I be saving each clip or is there a better way to do it all in one command?
If I do save each clip, is there a better file format I should use?
Plz help with the concatenation command.
Also note that because I am automating this with python I can build arbitrarily large commands, though that might not be ideal.
I am very new to this and I would really appreciate any help!
-
ffmpeg : Audio input device not recognized
8 février 2020, par shrimpwidgetWhat is needed for my ffmpeg command to recognize my audio input device?
The following reference has not helped resolve my problem: enter link description here
I want to record me talking (to my Windows laptop) while my screen activity is captured. While I have succeeded in capturing what's on the screen (by removing all mention of audio from my command), I have been unable to capture audio, as the device I mention is not recognized by ffmpeg. (I routinely use the default laptop for audio input to Audacity...surely there's some way to use it in this ffmpeg command, too.)
My audio devices:
ffmpeg -list_devices true -f dshow -i dummy [dshow @ 000000000044a940] DirectShow audio devices [dshow @ 000000000044a940] "Microphone Array (IDT High Defi" [dshow @ 000000000044a940] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Microphone Array (IDT High Defi" [dshow @ 000000000044a940] "Dock Mic (IDT High Definition A" [dshow @ 000000000044a940] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Dock Mic (IDT High Definition A" [dshow @ 000000000044a940] "Jack Mic (IDT High Definition A" [dshow @ 000000000044a940] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Jack Mic (IDT High Definition A" [dshow @ 000000000044a940] "Rec. Playback (IDT High Definit" [dshow @ 000000000044a940] Alternative name "@device_cm_{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Rec. Playback (IDT High Definit"
The full name is found via regedit: Microphone Array (IDT High Definition Audio CODEC)
Why isn't the audio input device found?
ffmpeg -y -f gdigrab -i desktop -framerate 10 -f dshow -i audio="Microphone Array (IDT High Definition Audio CODEC)" -vcodec libx264 "C:\jed\ffmpeg\_mydata\clip.mp4" [gdigrab @ 0000000000498540] Capturing whole desktop as 1366x768x32 at (0,0) [gdigrab @ 0000000000498540] Stream #0: not enough frames to estimate rate; consider increasing probesize Input #0, gdigrab, from 'desktop': Duration: N/A, start: 1575576239.093815, bitrate: 1006131 kb/s Stream #0:0: Video: bmp, bgra, 1366x768, 1006131 kb/s, 29.97 fps, 1000k tbr, 1000k tbn, 1000k tbc [dshow @ 000000000049a5e0] Could not find audio only device with name [Microphone Array (IDT High Definition Audio CODEC)] among source devices of type audio. [dshow @ 000000000049a5e0] Searching for audio device within video devices for Microphone Array (IDT High Definition Audio CODEC) [dshow @ 000000000049a5e0] Could not find audio only device with name [Microphone Array (IDT High Definition Audio CODEC)] among source devices of type video. audio=Microphone Array (IDT High Definition Audio CODEC): I/O error
-
Is it possible to extract the dialogue in a video track using the subtitles track with ffmpeg ?
7 février 2020, par user1306470I want to take a video file as an input and generate an output consisting of an audio track which would be a shorter version of the original audio track of the video where only the dialogue is output. I have the subtitles of the video in a separate file which I can use to extract the dialogue. Is this possible to do with ffmpeg?
-
How do I set an audio file to certain characteristics ?
7 février 2020, par Daniel BrowerHow do I convert an mp3 file to a file with the following characteristics?
single-channel (monaural) little-endian unheadered 16-bit signed PCM sampled at 16000 Hz
I have tried running this command:
ffmpeg -i audio16000.mp3 -ar 16000 -ac 1 audio16000.wav
When I checked the file with this command:
sox --i audio16000.wav
I got the following results:
Input File : 'audio16000.wav' Channels : 1 Sample Rate : 16000 Precision : 16-bit Duration : 00:05:30.98 = 5295744 samples ~ 24823.8 CDDA sectors File Size : 10.6M Bit Rate : 256k Sample Encoding: 16-bit Signed Integer PCM
It doesn't say if it's little endian or if it's unheadered. I also thought only a raw file is unheadered, and that a wav file has a header, but instructions I'm reading tells me to use that ffmpeg command I used above.
-
How to combine multiple images horizontally and vertically using ffmpeg [duplicate]
7 février 2020, par user3625087I'm attempting to create a script that can stitch together images side by side. These images are basically letters that I want to create words with (think of those ransom letters in Hollywood movies with randomly cut out letters from magazines). I need to specifically use these images, so I don't want ffmpeg to type out some words into images itself. I've seen some similar answers using
hstack
andtile
filter complexes but those didn't work for me. Here is what I've tried so far:ffmpeg -pattern_type glob -i h.png -i e.png -i l.png -i l.png -i o.png -filter_complex tile=5x1 test.png
For this one, -pattern_type didn't exist as an option (I'm using ffmpeg 4.2 on Windows), so I removed it and the result was 1 letter and black space for the rest.
ffmpeg -y -i h.png -i e.png -i l.png -i l.png -i o.png -filter_complex hstack test.png
For this one, the result was 2 letters side by side, and then black space for the rest.
All of my images are of the same height and variable width. Is there a command that can achieve this?