New answers tagged

0 votes

Creation of black half size frame in the middle of a split video stream results in an FFmpeg error

In response to this comment: After you used [bg] to create an overlay it is consumed, you would have to use another [bg]split[bg1][bg2] if your intention is to use it twice. – Ricardo Bohner This ...
CANJMP's user avatar
  • 23
0 votes

Creation of black half size frame in the middle of a split video stream results in an FFmpeg error

The black half frame needs to be a separate input, this worked. ffmpeg -i %1 -f lavfi -i color=black:size=%H%x%H% -filter_complex "[0]split[left][right]; [left]crop=ih:iw/2:0:0[left_half];[right]...
CANJMP's user avatar
  • 23
0 votes

H264_QSV will decode, VP9_QSV will not

I haven't been watching, but I can give a sort of answer. The information on the Intel web site is not complete, and the information returned by ffmpeg can be misleading. The information that ffmpeg ...
Bart Lederman's user avatar
0 votes
Accepted

FFMpeg: How to get the real return value in bash

The error-code returned by ffmpeg is not guaranteed to be non-zero in case of error. One solution is to use the -xerror parameter, which stands for "Stop and exit on error". The return error-...
harrymc's user avatar
  • 481k
0 votes

Extract Artworks from folder of Songs

A little late, I know. But it took me forever to figure out the right syntax, and this is always the first search result for me, so I figured I'd post my stuff here. #!/bin/bash for f in *.m4a; do ...
Dynix's user avatar
  • 1
1 vote
Accepted

Ffmpeg: Compile argument for 'delogo'

-enable-gpl has to be set during configure. Dependency information can be found in the configure script. For delogo, see this line, delogo_filter_deps="gpl"
Gyan's user avatar
  • 36.4k
0 votes

FFMPEG extract chapters not copying correct title

found a solution. not using ffmpeg, but using mkvextract and mkvmerge, which seems to get the job done. Extract chapters from a file mkvextract chapters input.mkv > chapters.txt Add chapters to a ...
paperskyline's user avatar
0 votes

ffmpeg fetching PTS/DTS for data packets incorrectly

If you want to capture the input as a raw bytestream, then you need to force the data format throughout, otherwise ffmpeg will try to interpret all streams and replace unrecognized ones with generic ...
Gyan's user avatar
  • 36.4k
1 vote
Accepted

adding audio overlay at a specific point

The error you are getting is in the first line: option 'delay' to filter 'adelay': Option not found. The actual name of the option is delays and not delay, so that part of the filter would need to be: ...
gepa's user avatar
  • 1,071
4 votes
Accepted

How to create animated GIF from a sequence of image files?

Since your file names have numbers with leading zeros, you should use the form %04d instead of %d. (Also you are missing an underscore before the %d). From the documentation: A sequence pattern may ...
gepa's user avatar
  • 1,071
1 vote

How to specify audio input to FFplay?

As Gyan commented, we nay pipe from FFmpeg to FFplay: ffmpeg -i -f v4l2 -framerate 60 -video_size 1280x720 -input_format mjpeg -i /dev/video0 -f alsa -i hw:1 -c copy -f nut pipe: | ffplay -f nut -i ...
Rotem's user avatar
  • 2,387
0 votes

How can I detect which channels contain compressed audio in a video file by using command line tools?

MediaInfo has a command line version (which I did not know about when I posted my question). It looks like that gives all the information I need. $ mediainfo --Inform="Audio;%ID% %Format%\n&...
kfank's user avatar
  • 11
1 vote
Accepted

What is the "data" format in FFmpeg?

data is for format-agnostic single-stream data, so it can be anything. You have to explicitly add a map and codec setting in order to copy any stream i.e. ffmpeg -f data -i in.bin -map 0 -c copy -f ...
Gyan's user avatar
  • 36.4k
2 votes
Accepted

Why am I getting pixelated videos in FFmpeg when converting to a GIF?

The original WebM input file has an alpha (transparency) channel. Possible solution is overlaying the semi-transparent video over a black background: ffmpeg -y -c:v libvpx-vp9 -i connecting.webm -vf &...
Rotem's user avatar
  • 2,387
0 votes

How can I generate a video with a single solid color that changes at intervals with FFMPEG?

The glib answer is "spend 3 hours studying how ffmpeg filters work" - what I've done today for fun, so I used this question as a challenge. Looks like there's a number of ways to get the ...
Andrew E's user avatar
  • 103
0 votes

How to generate a pure white background video with ffmpeg?

This isn't answering the OP's question, but for anyone else finding this question when looking for how to use ffmpeg to generate a solid color image, using @Gyan's answer, the full command is as ...
Andrew E's user avatar
  • 103
2 votes
Accepted

How to remove all subtitle channels except the first English one with FFmpeg?

The syntax is -map 0:s:m:language:eng: ffmpeg -y -i "Episode 01 - Yaha-kui zaShunina.mkv" -map 0:v -map 0:a? -map 0:s:m:language:eng -codec copy "copy Episode 01 - Yaha-kui zaShunina....
Rotem's user avatar
  • 2,387
1 vote
Accepted

ffmpeg Error when trying to concatenate 2 parts with different speed

It looks like a bug in FFmpeg, that is related to concatenating a video with itself. Possible workaround is using the same input file twice (as if it were two input files): ffmpeg -i 7.mp4 -i 7.mp4 -...
Rotem's user avatar
  • 2,387
-1 votes

why the ffmpeg cuda decoder much slower than the cpu decoder?

-c:v h264_cuvid is calling CUVID, which is slower and less efficient than NVENC. Replace it it with -c:v h264_nvenc CUVID for encode and decode is decades old and should be considered depreciated. It ...
Amorphous's user avatar
  • 403
0 votes

Properly downmix 5.1 to stereo using ffmpeg

mpv-downmix-gui is an mpv GUI to modify the parameters to downmix surround sound to stereo the default parameters are taken from RFC 7845 Section 5.1.1.5 usually, to increase the volume of dialogs, ...
milahu's user avatar
  • 185
1 vote

Converting video from 1080p to 720p with smallest quality loss using ffmpeg

downscale to 720p = fit the video into 1280x720 ffmpeg \ -i input.mp4 \ -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease:force_divisible_by=2 \ -sws_flags lanczos \ output.mp4 ...
milahu's user avatar
  • 185
0 votes
Accepted

Want to understand encoding with Opus for maximum audio quality in FFmpeg. Bitrate stuck at 96kbps?

The libopus encoder does not support quality-based encoding. The default bitrate is based on channel count. You'll have to set some manual bitrate. It can go as high as 256k * # of channels. VBR is on ...
Gyan's user avatar
  • 36.4k
0 votes

How to repair damaged AAC file without re-encoding using FFmpeg or other tools?

Audacity and most audio editors decompresses the audio when you load the file, and when re-exporting it in a lossy format you are now doing another round of lossy compression, although MP4 (AAC) was ...
harrymc's user avatar
  • 481k
1 vote
Accepted

Can not use drawtext with ffmpeg

You need to add --enable-libharfbuzz as well.
Gyan's user avatar
  • 36.4k
0 votes

Fade in a movie from white with FFmpeg

For a fade-in from white, you can use the color=XY argument of the fade filter: $ ffmpeg -i input.mp4 -filter:0 fade=in:0:15:color=white output.mp4 The fade-in begins on the 0th frame in full white ...
edison23's user avatar
  • 133
1 vote
Accepted

Nmap does not show open RTP and RTCP ports

Each transport protocol has its own set of port numbers. You scanned TCP ports, but both of those protocols run over UDP. (UDP also doesn't have an "open connection" handshake, so if you do ...
u1686_grawity's user avatar
0 votes

Extracting QuickTime mov_text subtitles with ffmpeg

If you're happy to transcode the mov_text subtitles to something else, (e.g. Subrip SRT files) you could try the following: ffmpeg -i test.mov -map 0:s:0 -c:s srt subtitles.srt
Andrew Paul Landells's user avatar
0 votes

FFmpeg trimming of Linux Screencast video does not work as described in another answer

The time is probably wrong because your video has 10 seconds but on the metadata of the video it says it has 30 seconds, so maybe removing the metadata: ffmpeg -ss 21 -i input.webm -map_metadata -1 -c ...
Ricardo Bohner's user avatar
0 votes

Error submitting a packet to the muxer: Cannot allocate memory

I managed to resolve the issue by dividing the task into two separate commands: initially trimming the videos with the trim filter and saving them individually, followed by concatenating the trimmed ...
Zahra's user avatar
  • 11
1 vote

Adaptive streaming to rtsp relay

I found a solution using gstreamer. The mediamtx server can be used as is and it's whip endpoint should be used. The on the client: gst-launch-1.0 whipclientsink signaller::whip-endpoint="http://...
kuon's user avatar
  • 11
0 votes

Can I mux H.265 into FLV by force?

@jiandingzhe there are hardware encoders which will produce HEVC/h.265 in AMF format over RTMP. I'm the maintainer of Red5 and we accept their stream and with near-future work it'll be implemented in ...
Paul Gregoire's user avatar
0 votes

Adaptive streaming to rtsp relay

The -b:v argument specifies the video bitrate. You will adjust this value to meet your network's needs. See this answer on StackOverflow https://stackoverflow.com/a/65884523/704977
music2myear's user avatar
  • 41.8k
0 votes

How to use ffmpeg speedup video specific time range in one line ffmpeg cli

You have to use concat filter to merge them. ffmpeg -i "$input_file" -filter_complex "[0:v]trim=start=0:end=10,setpts=PTS/10[v1];[0:a]atrim=start=0:end=10,asetpts=PTS/10[a1];[0:v]trim=...
Gyan's user avatar
  • 36.4k

Top 50 recent answers are included