├── install
├── README.md
└── davincimc
/install:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | echo "------------ Installation of Davinci Resolve Media Converter (davincimc) ------------"
4 | echo
5 | echo "- copy davincimc to /usr/local/bin directory."
6 |
7 | chmod u+x ./davincimc
8 | mv ./davincimc /usr/local/bin
9 |
10 | echo
11 | echo "done!"
12 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Davinci Resolve Media Converter.
2 |
3 | ***davincimc*** is a Linux script 🐧, it help you to convert Media and import it into davinci resolve.
4 |
5 | ## Dependency 🇲🇦.
6 | You have to install **FFMPEG**:
7 |
8 | - Debian/Ubuntu(PopOs, LinuxMint, ElementaryOs, MxLinux...)
9 | ```terminal
10 | sudo apt update
11 | sudo apt install ffmpeg
12 | ```
13 | - Fedora
14 | ```terminal
15 | sudo dnf -y install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
16 | sudo dnf -y install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
17 |
18 | sudo dnf update
19 | sudo dnf install -y ffmpeg
20 | ```
21 | - OpenSUSE
22 | ```terminal
23 | sudo zypper install opi
24 | opi codecs
25 | ```
26 | ## Instalation
27 | Clone this reposotory or Download the latest [release version](https://github.com/zakaria-chahboun/davinci-resolve-media-converter/releases/tag/1.0).
28 | ```terminal
29 | sudo ./install
30 | ```
31 |
32 | ## How to use ?
33 | ```
34 | davincimc INPUT.mp4 --MODE
35 | ```
36 |
37 | ### We have two modes:
38 | - *--video*: to convert any video format to (.MOV)
39 | - *--audio*: to extract any media format to (.wav)
40 |
41 |
42 | ### Example:
43 | ```
44 | davincimc ./mymedia/video.mp4 --video
45 | ```
46 | ```
47 | davincimc ./mymedia/podcast.mp4 --audio
48 | ```
49 | ```
50 | davincimc ./mymedia/podcast2.mp3 --audio
51 | ```
52 |
53 | > **The new output Media File has the same name as your file, in the same directory with (the new) extension ✌.**
54 |
55 | ### Help
56 | You can get help by using:
57 | ```
58 | davincimc --help
59 | ```
60 | or
61 | ```
62 | davincimc -h
63 | ```
64 |
65 |
66 |
67 | --------------
68 | ## Windows and Mac
69 | **if you are using Windows or Mac you have to do this manually!**
70 |
71 | **download FFMPEG for any os .. here **
72 |
73 | ```
74 | ffmpeg -i INPUT.mp4 -c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p -c:a pcm_s16le OUTPUT.mov
75 |
76 | ffmpeg -i INPUT.mp4 -c:a pcm_s16le OUTPUT.wav
77 | ```
78 |
79 | thanks to linuxgamecast
80 |
--------------------------------------------------------------------------------
/davincimc:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | author="ZAKARIA CHAHBOUN 11/01/2020"
4 | welcome="This script help you to convert Media to be accepted correctly by DaVinci Resolve!"
5 |
6 | listFormats=('mp4' 'mp3' 'mpa' 'm4a' 'm4v' 'mkv' 'flv' 'avi' 'mov' 'wav' 'ogg' 'wma')
7 |
8 | nargument=$#
9 |
10 | x=$1
11 | output="${x%.*}"
12 |
13 | command -v ffmpeg >/dev/null 2>&1 || { echo >&2 "' ffmpeg ' not found! You have to install it."; exit 1; }
14 |
15 | if [[ "$nargument" == 1 ]]; then
16 | if [[ $1 == "--help" || $1 == "-h" ]]; then
17 | echo "$welcome"
18 | echo "----- How to use -----"
19 | echo "' davincimc YOUR_MEDIA_FILE --MODE '"
20 | echo
21 | echo "MODE 1: --video to convert any video format to (.MOV) and use it into DaVinci Resolve."
22 | echo "MODE 2: --audio to extract any media format to (.wav) and use it into DaVinci Resolve."
23 | echo
24 | echo "------ Example ------"
25 | echo "davincimc ./mymedia/podcast.mp4 --video"
26 | echo "' The new output Media File has the same name as your file in the same directory with (.move) extension. '"
27 | echo
28 | echo "-- Supported formats --"
29 | for e in "${listFormats[@]}"; do
30 | echo $e
31 | done
32 | echo
33 | echo "$author"
34 | exit
35 | fi
36 | fi
37 |
38 | if [[ "$nargument" != 2 ]]; then
39 |
40 | echo "you have to do that in this way"
41 | echo "-----------------------------------"
42 | echo "' davincimc YOUR_MEDIA_FILE --MODE '"
43 | echo "-----------------------------------"
44 | echo "example: davincimc ./mymedia/podcast.mp4 --video"
45 | echo
46 | echo "run this command only with '--help' or '-h' to get help."
47 | exit
48 | fi
49 |
50 | if [[ ! -f $1 ]]; then
51 | echo "'$1' is not a file!"
52 | echo "run this command only with '--help' or '-h' to get help."
53 | exit
54 | elif [[ $1 =~ ^.*.mp4$|^.*.mp3$|^.*.mpa$|^.*.m4a$|^.*.m4v$|^.*.mkv$|^.*.flv$|^.*.avi$|^.*.mov$|^.*.wav$|^.*.ogg$|^.*.wma$ ]]; then
55 | if [[ $2 == "--video" ]]; then
56 | echo "$1"
57 | `ffmpeg -i "$1" -c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p -c:a pcm_s16le "$output.mov"`
58 | clear
59 | echo "*********** ALL IS DONE! ***********"
60 | echo
61 | echo "$output.mov"
62 | echo
63 | echo "************************************"
64 | elif [[ $2 == "--audio" ]]; then
65 | `ffmpeg -i "$1" -c:a pcm_s16le "$output.wav"`
66 | clear
67 | echo "*********** ALL IS DONE! ***********"
68 | echo
69 | echo "$output.wav"
70 | echo
71 | echo "************************************"
72 | else
73 | echo "We have only 2 modes: '--video' and '--audio'"
74 | echo "run this command only with '--help' or '-h' to get help."
75 | fi
76 | else
77 | echo "not supported format!"
78 | echo "run this command only with '--help' or '-h' to get help."
79 | exit
80 | fi
81 |
82 |
83 | : '
84 | ffmpeg -i INPUT.mp4 -c:v dnxhd -profile:v dnxhr_hq -pix_fmt yuv422p -c:a pcm_s16le OUTPUT.mov
85 |
86 | ffmpeg -i INPUT.mp4 -c:a pcm_s16le OUTPUT.wav
87 | '
88 |
--------------------------------------------------------------------------------