83999

ffmpeg concat batch loop with text file

Question:

I'm trying to batch a concat loop for a series of avi files where I need to add to each AVI a preroll and postroll movie.

Here's what I've tried:

_input.txt file:

file '3D_preroll.avi' file '%%a' file '3D_postroll.avi'

concat.bat file:

for %%a in ("*.avi") do ffmpeg -f concat -i _input.txt -c:v libx264 -b:v 1700k -minrate 1500k -maxrate 1900k -bufsize 1900k -deinterlace -acodec libvo_aacenc -ac 2 -ar 48000 -ab 92k "%%a"_432p.mp4 pause

Unfortunately, I get the following error message before FFMPEG crashes: Impossible to open '%%a'

What am I doing wrong?

Thank you :)

Answer1:

This might work for you:

@ECHO OFF &SETLOCAL set "ConcatScript=_input.txt" for %%a in (*.avi) do ( (echo file '3D_preroll.avi' echo file '%%~a' echo file '3D_postroll.avi' )>"%ConcatScript%" ffmpeg -f concat -i "%ConcatScript%" -c:v libx264 -b:v 1700k -minrate 1500k -maxrate 1900k -bufsize 1900k -deinterlace -acodec libvo_aacenc -ac 2 -ar 48000 -ab 92k "%%~a_432p.mp4" ) pause

Recommend

  • ffmpeg concat batch loop with text file
  • How to tell if ffmpeg errored?
  • Win/ffmpeg - How to generate a video from images under ffmpeg?
  • Command for putting watermark on video
  • FFMpeg: merge images with audio for specific duration
  • Do FFMPEG H264 compression presets affect the video quality? [closed]
  • FFMPEG - Moving text to appear every 'X' Seconds
  • shell script ffmpeg stops after 2 jobs
  • converted mp4 file using ffmpegvis not playing JW player
  • ffmpeg fails with: Unable to find a suitable output format for 'pipe:'
  • Fluent-ffmpeg how to reduce the size of the output file without losing any sound
  • Decrypting And Combining .ts Audio Files with .m3u8
  • libavdevice.so.57: failed to map segment from shared object: Permission denied\"
  • Strange PulseAudio monitor device behaviour
  • FFMpeg - Combine multiple filter_complex and overlay functions
  • why is streaming to an flv server with ffmpeg only showing black/blank video for clients?
  • Getting Exception while merging two file with ffmpeg
  • Bash: sort find results using part of a filename [duplicate]
  • Android video crop using ffmpeg
  • smart pointer array deletor
  • Gulp globbing excluding files then unexcluding not working as described
  • CreateProcess and strange nslookup error
  • Forward slash in last argument causes path to directory of batch file (“%~dp0”) to change
  • How to get all use statements declared in PHP class file
  • How can i decode an mp3 and encode it as aac with ezstream
  • SvcUtil.exe vs Add Reference
  • Viewing MJPEG Video Streams
  • How to crop a mp3 in ASP.NET + C#?
  • JsonConverter: Get parent object in ReadJson, without $refs
  • Reading XML into Datatable gives incorrect DateTime when the time has Time Zone info
  • How to save dynamically created textboxes and their values
  • pip in virtualenv gets ConnectTimeoutError
  • Run multiple queries from 1 SQL file showing result in multiple tables
  • Installed module is empty
  • Run Powershell script from inside other Powershell script with dynamic redirection to file
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • coudnt use logback because of log4j