Hello,
I need to 1) create a 10s silent video from a picture, 2) edit a "soundful" video (ie. it has audio and video), and 3) join the two files.
Using the following commands, the joined video has no audio — the input video is fine, so it's the last command that's wrong:
What command should I use to join them correctly?Code:REM 1. Make video from picture: c:\ffmpeg -loop 1 -i pic.png -t 10 -vf scale=720:404 -c:v libx264 -pix_fmt yuv420p -c:a aac -ar 44100 -b:a 96k -ac 2 -threads 2 -f mp4 01.pic.mp4 REM 2. Edit video: c:\ffmpeg -i input.mp4 -ss 0:13:08.280 -to 0:13:49.600 -vf scale=720:404 -c:v libx264 -pix_fmt yuv420p -c:a aac -ar 44100 -b:a 96k -ac 2 -threads 2 -f mp4 02.video.mp4 REM 3. Join two video files: (for %%i in (*.mp4) do @echo file '%%i') > input.txt c:\ffmpeg -safe 0 -f concat -i input.txt -c copy joined.mp4 c:\ffmpeg --version ffmpeg version 2023-11-05-git-44a0148fad-essentials_build-www.gyan.dev Copyright (c) 2000-2023 the FFmpeg developers
Thank you.
--
Edit: Here's how to doctor the silent video file so it has an audio stream (it might be possible to get it right the first time):
Code:c:\ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -i 01.pic.mp4 -c:v copy -c:a aac -shortest 01.pic.silent.mp4
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 5 of 5
Thread
-
Last edited by yetanotherlogin; 5th Feb 2024 at 11:49.
-
I didn't set the framerate in either. Why does it matter, and is it the cause of the problem I had?
-
Here's what ffprobe says about the two videos:
Code:Vid1 Duration: 00:00:10.00, start: 0.000000, bitrate: 29 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 720x404, 26 kb/s, 25 fps, 25 tbr, 12800 tbn (default) Vid2 Duration: 00:00:41.32, start: 0.000000, bitrate: 397 kb/s Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 720x404 [SAR 404:405 DAR 16:9], 295 kb/s, 25 fps, 25 tbr, 12800 tbn (default)
Similar Threads
-
Avisynth Video & Audio Encoding and joining trimmed sections
By tugatomsk in forum EditingReplies: 2Last Post: 4th Apr 2022, 15:04 -
Audio mute to video and mixing audio file with FFMPEG
By mikoyuri in forum Newbie / General discussionsReplies: 1Last Post: 13th Mar 2021, 03:58 -
Download HLS video using FFMPEG with separate video and audio URLs?
By oschrndz in forum Video Streaming DownloadingReplies: 2Last Post: 15th Dec 2020, 13:53 -
When video is re-encoded following splitting/joining, does it affect audio?
By 90sTV in forum Newbie / General discussionsReplies: 4Last Post: 23rd Dec 2019, 10:30 -
converted video by ffmpeg, plays video and audio,but audio overtakes
By jraju in forum Newbie / General discussionsReplies: 1Last Post: 5th Dec 2019, 00:59