Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Long video files are shortened when exported [closed]
28 avril, par MathildaI'm working on videos with a maximal length of 23h59m59s (let's say 24h). I wanted to do several modifications on these videos, including dividing them into smaller parts and converting them into images. I'm doing it with Python in the Anaconda interface.
My 24-hour videos are properly read by the Windows "Films & TV" player. They are also properly read by VLC media player. However, as soon as I try to use them:
- in editing software (Movavi);
- on an online editing site (Video-cutter);
- on Python (
cv2
andmoviepy
packages); or - on
ffmpeg
the indicated video duration is correct only if the video is less than 13h15m22s. If it is longer than that, the indicated duration is equal to the real duration minus 13h15m22s, regardless of the loaded video's metadata (size, weight, fps, duration).
I have tried with videos of different durations, different pixel sizes and weights in GB, and different fps. I had variable fps mode on the videos, so I tried to set them to fixed mode using ffmpeg, but the exported video with fixed fps still has 13h15m22s missing. For videos taken from the web (YouTube), this problem does not appear on any of the 4 tested supports, so there is no problem coming from my machine or software. The issue must be in the videos. But I don't understand what could be in the videos for it to always be 13h15m22s that are removed, regardless of the video size. Moreover, if the video was corrupted, I wouldn't be able to display it in Films & TV or VLC media player.
I used
ffmpeg
to see if the video was corrupted:ffmpeg.exe -v error -i "/Users/myname/Desktop/myvideo.mp4" -f null >error.log 2>&1 ffmpeg.exe -v error -i "/Users/myname/Desktop/myvideo.mp4" -f null ffprobe -show_entries stream=r_frame_rate,nb_read_frames,duration -select_streams v -count_frames -of compact=p=1:nk=1 -threads 3 -v 0
And nothing appears in the output so I guess there's no error detected. I tried to repair my video with
ffmpeg
anyway:ffmpeg -i "/Users/myname/Desktop/myvideo.mp4" -c copy "/Users/myname/Desktop/myvideo_fixed.mp4”
And there is still 13h15m22s missing.
I finally tried to repair it with Untrunc, which gave me a completely black video of 55 minutes for a video supposed to last several hours. Untrunc asks for the corrupted file and a functional video file taken by the same camera as input, so I used a 3min26 file for this, assuming that since the file is less than 13h15m22s and does not appear truncated on the software, it is not corrupted. Maybe I should have taken a larger video file (a few hours for example), but I'm not sure it's going to change anything.
I don't know what to do to be able to cut these videos and use them in Python without them being truncated.
-
ffmpeg scale down video dynamically (squeeze-back) or zoompan out to smaller than original
27 avril, par SamI have 2 videos, I'm trying to overlay one on top of the other, and have it shrink down in an animated fashion until it appears like a picture-in-picture setup. Then, after a few seconds it should scale back up.
This is what I am trying to achieve (these would be videos, not images):
This is the closest I've been able to get, but, crucially, zoompanning "out" (as opposed to "in") does not appear to work; so, of course, this does not work:
ffmpeg -i bg.mov -i top.mov -filter_complex "[0:v]zoompan=z='pzoom-0.1':d=1, setpts=PTS-STARTPTS[top]; [1:v]setpts=PTS-STARTPTS+2/TB, scale=1920x1080, format=yuva420p,colorchannelmixer=aa=1.0[bottom]; [top][bottom]overlay=shortest=0" -vcodec libx264 out.mp4
Is this achievable with ffmpeg?
-
Scale image overlay over the time with ffmpeg
27 avril, par Nazarii KahaniakI have an overlay image and background video. I want to make the overlay 3 times bigger when 10 seconds of video pass, the scaling animation should take 1 second. Is it possible to do something like this with ffmpeg?
-
How to properly configure FFmpeg with libsvtav1 parameters to achieve smaller file sizes than H.264 ? [closed]
27 avril, par Satyam Manoj SinghI'm implementing a video transcoding pipeline using FFmpeg's libsvtav1 encoder, but encountering unexpected results when trying to batch process 10 H.264 videos (each ~5 minutes).
Current Implementation:
// Command line implementation ffmpeg -i input.mp4 -c:v libsvtav1 -crf 24 -y output_crf24.mp4 // Also tried ffmpeg -i input.mp4 -c:v libsvtav1 -crf 30 -y output_crf30.mp4
Problem: Despite using CRF values that should theoretically reduce file size (24 and 30), all resulting AV1 files are larger than their H.264 originals: Original (H.264):
Resolution: 1280x960 Bitrate: ~1463 kb/s FFprobe: Stream #0:0: Video: h264 (High), yuv420p(progressive), 1280x960, 1460 kb/s, 30 fps
Encoded (AV1 CRF 24):
Bitrate: ~1503 kb/s FFprobe: Stream #0:0: Video: av1 (Main), yuv420p, 1280x960, 1501 kb/s, 30 fps encoder: Lavc62.0.101 libsvtav1
What I've tried:
Different CRF values (24, 30) Default preset settings
What additional parameters or coding approaches should I implement to properly configure libsvtav1 for achieving the expected file size reduction while maintaining reasonable quality? Are there specific preset options or parameters I'm missing in my implementation?
-
Error installing ffmpeg-kit-ios-full-gpl (ios) , requested URL returned error : 404
26 avril, par codnix devI am using this library in my project :- ffmpeg_kit_flutter_full_gpl: ^6.0.3. I am getting the error :- when trying to run pod install it show that it cannot already find the link where to download the zip file and responded 404
usr/bin/curl -f -L -o /var/folders/0q/cmpgdyp97dlf1ljyc63g71lm0000hy/T/d20250402-65474-7s1bkn/file.zip https://github.com/arthenica/ffmpeg-kit/releases/download/v6.0/ffmpeg-kit-full-gpl-6.0-ios-xcframework.zip --create-dirs --netrc-optional --retry 2 -A 'CocoaPods/1.16.2 cocoapods-downloader/2.1'.
The requested URL returned error: 404.
This error occurs only during the installation of the POD file.