Jump to content

ffmpeg. How to convert multiple mkv files to mp4 (without converting video) using just one command line on linux


euclides.sp

Recommended Posts

euclides.sp

Hello guys.

I use have my emby on a lunux vps. I'm converting movies from mkv to mp4 (without converting video) using the following command inside movie directory: for i in .mkv; do ffmpeg -i "$i" -movflags faststart -c copy -map 0 "${i%.}.mp4"; done

Works perfectly converting the files inside the directories. Now I want to do the same thing in files located in several other folders. for example:

  • Servidor (type the command here)
    Filme1
    Filme1.mkv
    Filme2 
    Filme2.mkv
    Filme3
    Filme3.mkv

Does anyone know how to do this?

Link to comment
Share on other sites

sargenthp

 

 

Hello guys.

 

I use have my emby on a lunux vps. I'm converting movies from mkv to mp4 (without converting video) using the following command inside movie directory: for i in .mkv; do ffmpeg -i "$i" -movflags faststart -c copy -map 0 "${i%.}.mp4"; done

 

Works perfectly converting the files inside the directories. Now I want to do the same thing in files located in several other folders. for example:

  • Servidor (type the command here)

    Filme1

    Filme1.mkv

    Filme2

    Filme2.mkv

    Filme3

    Filme3.mkv

Does anyone know how to do this?

Here is an example using find...

 

find /starting/path -name "*.mkv" | awk -F'.mkv' '{print $1}' | while read i; do ffmpeg -i "$i.mkv" -movflags faststart -c copy -map 0 "$i.mp4"; done

 

Sent from my PH-1 using Tapatalk

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...