Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
FFMPEG : recode all audio streams while keeping originals [closed]
16 août, par OliravI am trying to add an additional set of audio tracks into some video files, as part of an automated process. I would like to keep all the original audio tracks and have a second re-coded copy.
What I have been using is:
ffmpeg -i file -map 0:v -codec:v copy -map 0:a -codec:a copy -map 0:a:0 -codec:a:0 aac -strict experimental ...(Bitrate, filters etc all with :a:0) -map 0:s -codec:s copy output file
However, I can't work out how to change this to handle input files that have multiple audio tracks as it will only convert the first.
If I change
:a:0
to:a
on the 4th line it produces the extra copy I need but overrides the copy codec for the original copy. -
How to specify start and end frames when making a video with ffmpeg [closed]
16 août, par supercoolI am working with python in a jupyter notebook, and I am trying to use ffmpeg to specify the start and end images and convert several images from a folder into a single video. I have a folder, 'images', with the images inside labeled, 'image0', 'image1', 'image2', etc. I would like to specify the start and end images in my video. For example, I would like to be able to make the video using 'image100', to 'image200'. Right now, I have:
!/home/jovyan/ffmpeg-dir/ffmpeg -i /home/jovyan/images/image%d.bmp -frames:v 1000 /home/jovyan/output.mp4
This is making the video correctly, but I believe it is just taking the first 1000 images.
Thanks!
-
How to convert an AIFF file to an mp3 on Macos ? [closed]
14 août, par RichardI just burned a CD to my macbook pro. The files are in AIFF. I would like them in a "websafe" format.
-
Unable to import audio on python using ffmpeg [closed]
14 août, par Calebe PiacentiniI'm running my code on a VM, so I can't add it to my path. I want to do:
audio = AudioSegment.from_mp3(path_mp3) audio.export(path_wav, format="wav")
I keep getting:
FileNotFoundError: [WinError 2] The system cannot find the file specified
I tried GPT (and Claude, and Deepseek, etc....) and looking at other questions here posted, without sucess. I know I must have ffpmeg. I have download it and added the .exe at both my script folder (such as suggested elsewhere) and also tried adding the option directly to AudioSegmenter, as in
AudioSegment.converter = ffmpeg_path AudioSegment.ffmpeg = ffmpeg_path AudioSegment.ffprobe = ffprobe_path
ffmpeg is working. I tried using it directly on the command prompt and it went just fine. I really do not know what is going on here. And, yes, I'm sure that the audio files do exist. This is not the problem. I'll be happy to provide any additional information and/or context.
-
very low latency streaming with ffmpeg using a webcam [closed]
14 août, par userDtrmI'm trying to configure ffmpeg to do a real-time video streaming using a webcam. The ffmpeg encoder command I use is as follows.
ffmpeg -f v4l2 -input_format yuyv422 -s 640x480 -i /dev/video0 -c:v libx264 -profile:v baseline -trellis 0 -subq 1 -level 32 -preset superfast -tune zerolatency -me_method epzs -crf 30 -threads 0 -bufsize 1 -refs 4 -coder 0 -b_strategy 0 -bf 0 -sc_threshold 0 -x264-params vbv-maxrate=2000:slice-max-size=1500:keyint=30:min-keyint=10: -pix_fmt yuv420p -an -f mpegts udp://192.168.1.8:5001
The ffplay command used to display the video feed is,
ffplay -analyzeduration 1 -fflags -nobuffer -i udp://192.168.1.8:5001
However, I'm experiencing a latency of 0.5 - 1.0s latency in the video stream. Is there a way to reduce this to a number less than 100ms. Also, when I replace the v4l2 camera capture with a screen capture using x11grab, the stream is almost real-time and I experience no noticeable delays. Moreover, changing the encoder from x264 to mpeg2 had no effect on the latency. In addition, the statistics from the ffmpeg shows that the encoder is performing at a 30fps rate, which I believe indicates that the encoding is real-time. This leaves me with only one reason for the experienced delay.
- Is there a significant delay in buffers when using v4l2 during video capturing in a webcam?
- I don't think the transmission delay is in effect in this case as I see no latencies when screen capture is used under the same conditions.
- Can this latency be further reduced?. Can someone think of a different encoder configuration to be used instead of the one that I've been using?