Jump to content


Photo

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

ffmpeg convert mkv2mp4

  • Please log in to reply
1 reply to this topic

#1 euclides.sp OFFLINE  

euclides.sp

    Member

  • Members
  • 12 posts
  • Local time: 04:12 AM

Posted 28 February 2019 - 12:52 PM

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?



#2 sargenthp OFFLINE  

sargenthp

    Member

  • Members
  • 26 posts
  • Local time: 12:12 AM
  • LocationEau Claire, WI

Posted 28 February 2019 - 01:22 PM



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





Also tagged with one or more of these keywords: ffmpeg, convert mkv2mp4

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users