[FFmpeg-user] How to use ffmpeg in batch mode?

Goran Obal obal.goran at gmail.com
Mon Oct 21 10:59:12 EEST 2019


Hi.

If you are only changing the container and don't want to transcode the
contents, be sure to add -c copy in the ffmpeg line of the example (haven't
tested it but it seems fine), so it looks like this:
ffmpeg -i %IN% -y -c copy %OUT%

Br.

On Mon, Oct 21, 2019 at 9:14 AM Michael Koch <astroelectronic at t-online.de>
wrote:

> Am 20.10.2019 um 23:56 schrieb arthur brogard via ffmpeg-user:
> > I have been trying to convert a bunch of mkv files to mp4 using ffmpeg
> in batch mode via a .bat file but I can't get it right.
> > I've followed a number of suggested commands from various hits I've got
> on google but none of them work.
> > Don't need anything fancy.  Just a basic convert from mkv to mp4 if
> anyone can help?
>
> I haven't tested it, but I thing this (Windows) batch file should work:
>
>
> for %%f in (*.mkv) do call :for_body %%f
> goto :the_end
>
> :for_body
> set IN=%1
> set OUT=%IN:mkv=mp4%
> ffmpeg -i %IN% -y %OUT%
> exit /b
>
> :the_end
> pause
>
>
> You find a similar (tested and working) example in my book on page 88:
> http://www.astro-electronic.de/FFmpeg_Book.pdf
>
> Michael
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list