New answers tagged ffmpeg
0
votes
Accepted
FFmpeg Could not write header (incorrect codec parameters ?): Invalid data found when processing input
Thank you for providing the source.Without, it's very likely, I couldn't have done it.
Extract video:
ffmpeg -i in.mkv -c copy -an -tag:v hvc1 -pix_fmt yuv420p out.ts
Extract audio:
ffmpeg -i in.mkv -...
0
votes
Gray frames appear sometimes when chapters change in trans coding of 4k Blu-ray
I switched to using Jellyfin's version of FFmpeg
0
votes
ffmpeg: What are reasonable values for -aq when creating mp3?
I was downloading m4a audio with yt-dlp and got these numbers:
Command
Result
yt-dlp --extract-audio --audio-format mp3 --audio-quality 2
stereo, 44KHz, 32 bits, ~190kbps VBR
yt-dlp --extract-audio ...
0
votes
ffmpeg - output includes combined video stream from inputs but also exact video streams from inputs
Based on the output, the first two streams are video, the third is audio and the fourth is the video stream you want to keep? This keeps the fourth stream (third video stream) and the first, and only, ...
0
votes
Accepted
Merging multiple audios to a video
Assume that you have one video file (input_vid.mp4) and two audio files (input_aud_1.mp4 and input_aud_2.mp4).
Here's the command. The resulting MKV file will contain two audio streams.
ffmpeg -i ...
0
votes
Merging multiple audios to a video
There is a way, but it will require a small script.
You'll have to concatenate the audio before merging it with the video stream.
#!/bin/bash
prepare_audio() {
mkdir -p temp_pcm && cd ...
0
votes
FFmpeg MP4 command not working as expected
Part of your problem is that you have your commands in the wrong order. As a starting point, you should group your options into input -> processing -> output. There are exeptions to this and as ...
0
votes
Trying to understand video conversion, difference
Setting the bitrate is not recommended, and not what YouTube does. If you download five YouTube videos from five different sources, they will all be at different bitrates. I suspect YouTube uses -crf (...
1
vote
ffmpeg overlay 2D video onto 360 video
Answering myself as a reference to anyone that finds this. The command I had was almost correct, but was missing fov & alpha transparency. The final relevant piece, that I used:
v360=input=flat:...
0
votes
FFMPEG mp3 Encryption
Encrypting an MP3 file directly using FFmpeg might not work as expected because FFmpeg's encryption options are typically used for formats and containers that support encryption, such as MP4. The MP3 ...
0
votes
The quality and size of the frame are the same, but the weight is different
Have you tried direct stream -c copy?
ffmpeg -re -f mpegts -hide_banner -y -i /144.mp4 -c copy -map v:0 -vf scale=144:-1 -map 0:a \
-init_seg_name "init-\$RepresentationID\$.\$ext\$" \
...
0
votes
FFMPEG only streaming one frame when capturing an application
As long as the window stays in that desktop location, you can use this script. It lets you choose the area of desktop to capture. Click top left corner, then bottom right corner. That's the area ...
0
votes
ffmpeg - concatenating identical audio-only files results in "non-montonic DTS" warning
Change the container to matroska first, setting the TS to zero.
for file in *.mp4; do filename="${file%.*}"; ffmpeg -i "$filename".mp4 -c copy -avoid_negative_ts make_zero "$...
0
votes
How do I save a ffmpeg stream from another device?
So, after continuing to tweak my commands, I figured out what I was doing wrong.
ffmpeg -f gdigrab -framerate 30 -i desktop -vcodec mpeg4 -q 12 -f mpegts udp://IP:PORT
In this command, the IP:PORT was ...
0
votes
Accepted
Python/FFMPEG - Converting a CbBI (Apple) PNG to a regular PNG
@Rotem's suggestion to use PyiPNG (at https://github.com/venjye/PyiPNG) works perfectly and I'll use this, but it's weird to me that it's impossible to do same using FFMPEG...
0
votes
How to convert from .srt to .ass with FFmpeg without decoding errors
I wasn't able to download your subtitle to validate it, but in my case it was solved by removing the first dialogue from the file.
I noticed the first dialogue was ID 0, and another one started at ID ...
1
vote
Accepted
FFmpeg: ffv1 -context parameter
What forces ffv1 to encode in intra-frame mode
it's:
-context 0
example:
ffmpeg -i input.mp4 -c:v ffv1 -context 0 -level 3 output.mkv
-i input.mp4 specifies the input file
-c:v ffv1 sets the video ...
1
vote
VBR encoding with ffmpeg native AAC codec
About that ffmpeg aac wiki...
...the vbr-setting for regular aac-lc says:
"*Variable bit rate using -q:a:
ffmpeg -i input.wav -c:a aac -q:a 2 output.m4a
Effective range for -q:a is around 0.1-2. ...
0
votes
Accepted
Reencoded video with ffmpeg is not matching input sar,dar provided
Your video input is 256x144 [SAR 1:1 DAR 16:9]. For that, you just need -vf "scale=1280:720".
The scale filter will adjust the output so as to keep the input DAR, so unless you've cropped or ...
0
votes
How can I rotate a video 180° with FFmpeg?
FYI, rotate metadata is now deprecated in ffmpeg and does not work anymore.
Use the "-display_rotation value" video option instead (before the -i )
See https://ffmpeg.org/ffmpeg.html#Video-...
1
vote
Accepted
How to extract all frames of a video using GTX 550 ti?
No need to complicate things trying to use hardware accelerated extraction, unless you need to do this in large volumes.
You can use ffmpeg to extract frames from a video:
ffmpeg -i video.mp4 %0d.png
...
2
votes
Accepted
Is there a fast way to get the timestamp of a keyframe near an offset?
The basic command would be of the form
ffprobe -v 0 -of compact=p=0 -select_streams v -show_entries packet=pts_time,flags -read_intervals 2990%3010 "input.mkv" | grep K
In my test file, ...
2
votes
Accepted
The proper way to limit framerate when recording screen on macOS
From the log, it is apparent that initially not enough frames are received for ffmpeg to detect input framerate.
That's ok, you can just use pass through input frames without any adjustment.
ffmpeg -f ...
0
votes
Trying to merge ffmpeg commands into one
Here's a bash script to splice the fades into the video's
It then merges into a single file.
#!/bin/bash
mkdir -p temp source
# change source container to mkv with ts to zero
for file in *.mp4; do
...
0
votes
How can I concatenate videos that don't always have audio using ffmpeg?
add silence
#!/bin/bash
cd /tmp
if [ ! -f sample0.mp4 ]; then
#create test files
for i in 0 2; do
ffmpeg -lavfi "testsrc2,sine=440" -t 2 "sample${i}.mp4" -v 16
...
0
votes
Easing when creating a timelapse using FFMPEG
Ugly, but there may no better way: Duplicate the jpg's where it should be slower, and then -vsync 2 to not waste space.
E.g., if after frame 2000 it should be 3x slower, copy 2001.jpg to 2001b.jpg ...
0
votes
Accepted
FFMPEG segment_times arg makes command too long
You'll have to perform this task in stages. Instead of creating all segments in one command, do it piecemeal.
Let's say you have 15 segment split points s1..s15.
ffmpeg -copyts -i input.mkv -map 0 -c ...
0
votes
Can I make ffmpeg stop if integrity check encounters an error?
Neither "-err_detect explode" nor "-xerror" alone worked for me with both flags resulting in ffmpeg taking about a minute and a half to process my manually corrupted test file that ...
1
vote
Accepted
Concatenating audio with image for video in ffmpeg causes infinite video
You didn't set a duration for the image so the video will go on forever, you can limit time for the image with something like:
ffmpeg -loop 1 -t 60 -i image.jpg...
1
vote
How many instances of FFmpeg commands can I run in parallel?
I can get all CPUs engaged, each at 100% utilization, using:
find . -name "*.mp4" -print0 | parallel -0 ffmpeg -i {} {.}.mp3 -hide_banner' \;
parallel options:
{} is replacement string (...
0
votes
Transition effects are not coming with my ffmpeg command
Calculate as follows:.
The first column below shows the original duration of the first four inputs.
These accumulate over time, as shown in the second column.
Each transition duration of 0.5 seconds ...
0
votes
FFmpeg -ss option and keyframes
does "seek point" means "keyframe"
Generally. Some formats (like MP4) contain a list of seek points for each stream. Others dont, but ffmpeg will try to parse packet headers and ...
0
votes
ffmpeg convert container format without re-encoding
From what I have read, opus extradata is necessary for FFmpeg to save the stream to a file, however, this is FFmpeg policy to not create missing opus extradata by the decoders : it is only created by ...
1
vote
Accepted
Ffmpeg image parameter for YouTube
The following command will produce a video output that can be uploaded to youtube. Because it is -crf 0 it is effectively lossless, and would match the quality output of a lossless PNG.
ffmpeg -f ...
1
vote
Accepted
How do you create an ffmpeg lossless image without re-encoding?
PNG is a lossless format, it requires no additional parameters to ensure lossless encoding.
Assumed quality parameters for PNG output with other programs are simply compression settings. You can ...
0
votes
How can I delay a particular rectangular region in a video relative to the rest of it using FFMPEG or other software?
-itsoffset crop overlay amix
ffmpeg -i "input.mkv" -itsoffset 1 -i "input.mkv" -lavfi "
[1]crop=640:480:iw-640:ih-480-50[b];
[0][b]overlay=W-w:H-h-50;
anullsrc[a];
[a][1]amix=...
1
vote
How much and what data is lost in ffmpeg transcoding?
How much and what data is lost in ffmpeg transcoding?
It's not about ffmpeg, it's about the video codec you're using. Video compression is lossy in general, and depending on the codec in use and its ...
0
votes
How to read the name of audio track using ffmpeg
It is possible with an ffmpeg. But it requires ffprobe patching and recompiling.
I just verified, it works.
I took a patch from https://gitea.1f0.de/LAV/FFmpeg/commit/...
1
vote
Accepted
What a correct playlist.m3u8 should contain, or should look like?
You might be able to get away with:
ffmpeg -f mpegts -i segment%03d_1_av.ts -codec copy -map 0:0 -map 0:1 output.mkv
Otherwise...
playlist.m3u
#EXTM3U
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-VERSION:4
#EXT-...
1
vote
Accepted
How to solve a final pb when merging a series of .ts file with concat command of FFmpeg?
It looks like windows has given you one final hurdle. Note the error message says "unknown keyword ' file'". See the initial space? That space can't be seen in notepad when looking at "...
0
votes
FFmpeg incorrect colourspace with hardcoded subtitles
Roughly 1.5 years later I'm revisiting this issue to state that as of FFmpeg 7.0.1 I no longer have this particular problem. I've tested it with the same file, and while the problem still persisted in ...
1
vote
Accepted
To cut and download part of video from vk.com
yt-dlp uses ffmpeg behind the scenes for you, and provides the --download-sections ... argument for exactly this purpose.
--download-sections REGEX:
Download only chapters that match the regular ...
0
votes
Extracting frame timestamp (PTS) and seting it as a file name
ffmpeg -i rtsp://localhost:8554/mystream -vf "select=not(mod(n\,10)),showinfo" -vsync vfr -frame_pts true frame_%04d_%010d.jpeg
This worked for me !.
0
votes
Live Streaming over rtmps using FFMPEG
You can stream to RTMPS the exact same way you would RTMP.
I got it working with CloudFlare Stream by streaming to their rtmps url:
rtmps://live.cloudflare.com:443/live/<streamKey>
I imagine ...
Top 50 recent answers are included
Related Tags
ffmpeg × 7133video × 2692
audio × 1037
video-conversion × 622
linux × 517
streaming × 352
command-line × 289
video-encoding × 270
mp4 × 242
windows × 221
mp3 × 183
video-streaming × 181
video-editing × 180
h.264 × 176
encoding × 171
conversion × 162
vlc-media-player × 154
codec × 148
ubuntu × 133
metadata × 130
subtitles × 124
bash × 122
images × 114
batch × 109
macos × 106