Lou Logan
Forum Replies Created
-
Lou Logan
October 9, 2019 at 7:47 pm in reply to: FFMPEG: Add black frames at start and end of video[Andrew Baldinger] “What is that 60 after the -t doing?”
That’s the total output duration. So the output will be 60 seconds in that example. I had to add -t to manually declare an output duration because -shortest isn’t working. This is only needed for the example with audio. The -t value should be input duration + stop_duration.
[Andrew Baldinger] “
ffmpeg -i input -filter_complex "[0:v]tpad=stop_duration=10:color=black[v]" -map "[v]" outputRight?”
That will work assuming you only want video and no audio.
-
Lou Logan
October 9, 2019 at 7:12 pm in reply to: finding a solution to watermark on video being unsharp/pixelatedIf you know you aren’t upscaling (which is bad) then the culprit is probably the chroma subsampling occurring in the overlay filter. Use the “format=auto” option in the overlay filter, such as:
overlay=10:10:format=autoUse the code button next time to properly format your command.
-
Lou Logan
October 9, 2019 at 7:05 pm in reply to: FFMPEG: I need to remove 14 out of 16 audio channels from a mov fileIt is not possible to split channels or use filters without re-encoding, but in this case you can stream copy (re-mux) the video without re-encoding because you are not filtering it.
Use the channelmap filter:
ffmpeg -i input -af "channelmap=map=0|1:channel_layout=stereo" -c:v copy outputor
ffmpeg -i input -af "channelmap=map=FL|FR:channel_layout=stereo" -c:v copy outputSee “ffmpeg -layouts” for channel layout names and descriptions.
-
Lou Logan
October 9, 2019 at 6:49 pm in reply to: At my wit’s end….. Need info on using ffmpeg to convert mp3 and image to mp4ffmpeg can’t do this by itself. You need to use additional features present in your shell/command line.
The answer depends on what you are using, but you didn’t mention your OS.
For Linux or macOS you can use a Bash for loop:
for f in *.jpg; do ffmpeg -framerate 25 -loop 1 -i "$f" -i "${f%.*}.mp3" -c:v libx264 -vf format=yuv420p -c:a aac -movflags +faststart -shortest "${f%.*}.mp4"; doneIf you’re on Windows refer to cmd, batch file, or PowerShell help resources regarding a “for loop” or whatever the Windows equivalent is.
-
Lou Logan
October 9, 2019 at 6:35 pm in reply to: FFMPEG: Add black frames at start and end of videoWith just video:
ffmpeg -i input -filter_complex "tpad=stop_duration=10" outputWith video and audio:
ffmpeg -i input -filter_complex "[0:v]tpad=stop_duration=10[v];[0:a]apad[a]" -map "[v]" -map "[a]" -shortest outputHowever, this second example will not work. I believe there is an existing bug so this command will encode indefinitely (at least at the time I wrote this, but it will probably be fixed eventually).
So you can add the -t option instead of -shortest:
ffmpeg -i input -filter_complex "[0:v]tpad=stop_duration=10[v];[0:a]apad[a]" -map "[v]" -map "[a]" -t 60 outputIf you want to script it use ffprobe to get the input duration and -t should be input duration + stop_duration.
Alternatively, use the color source filter and anullsrc filter to create 10 second black video and silent audio, then concatenate with the concat filter or concat demuxer. Note that all parameters must match the input for proper concatenation, so it can be tricky. If you do it right you can avoid re-encoding if you use the concat demuxer.
-
I’m guessing you downloaded the release version 4.1.1. As I mentioned no release has tpad.
Download the “nightly get version” instead. It will be named something like “20190308-9645147”.
-
There is a better, easier method now using the tpad and adelay filters. This example will add 10 seconds of black video and delay the audio by 10 seconds:
ffmpeg -i input -filter_complex "[0:v]tpad=start_duration=10:color=black[v];[0:a]adelay=10000|10000[a]" -map "[v]" -map "[a]" outputThe tpad filter is newer than any release version, and release versions don’t get new features backported, so it won’t be in any release until version 4.2. This is one reason why general users are recommended to always use a recent build from the git master branch. See the FFmpeg Download page for links to already compiled builds from the git master branch for Linux, macOS, and Windows.
-
Lou Logan
March 24, 2016 at 5:36 pm in reply to: Transcoding 3840×2160 60fps MP4 to WEBM, best settings?Why do you want WebM? Also, WebM is just a container format, so I must ask if you are outputting VP8 or VP9 video.
You should show your ffmpeg command and the complete console output/log.
-
Can you provide a short sample input file so we can attempt to duplicate the issue?
Why the screenshots instead fo simply copying and pasting the text?
-
Complete console outputs missing.