Skip to content

Commit

Permalink
Add detelecine and deinterlace as options
Browse files Browse the repository at this point in the history
  • Loading branch information
beandog committed Jan 26, 2021
1 parent ad1f673 commit f2918b9
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions dvd_trip.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ int main(int argc, char **argv) {
bool mkv = false;
bool mp4 = false;
bool webm = false;
bool detelecine = false;
bool deinterlace = false;
int8_t crf = -1;
char str_crf[10];
uint16_t arg_track_number = 1;
Expand Down Expand Up @@ -144,6 +146,9 @@ int main(int argc, char **argv) {

{ "output", required_argument, 0, 'o' },

{ "detelecine", no_argument, 0, 'd' },
{ "deinterlace", no_argument, 0, 'e' },

{ "vcodec", required_argument, 0, 'v'},
{ "acodec", required_argument, 0, 'a'},
{ "crf", required_argument, 0, 'q' },
Expand All @@ -157,7 +162,7 @@ int main(int argc, char **argv) {

};

while((opt = getopt_long(argc, argv, "a:B:c:hL:o:q:s:S:t:Vv:xz", long_options, &long_index )) != -1) {
while((opt = getopt_long(argc, argv, "a:B:c:dehL:o:q:s:S:t:Vv:xz", long_options, &long_index )) != -1) {

switch(opt) {

Expand Down Expand Up @@ -213,6 +218,14 @@ int main(int argc, char **argv) {

break;

case 'd':
detelecine = true;
break;

case 'e':
deinterlace = true;
break;

case 'L':
strncpy(dvd_trip.audio_lang, optarg, 2);
break;
Expand Down Expand Up @@ -308,6 +321,8 @@ int main(int argc, char **argv) {
printf(" -v, --vcodec <x264|x265|vpx> Video codec (defaut: x265)\n");
printf(" -q, --crf <#> Video encoder CRF (default: use codec baseline)\n");
printf(" -a, --acodec <aac|opus> Audio codec (default: AAC)\n");
printf(" -d, --detelecine Detelecine video\n");
printf(" -e, --deinterlace Deinterlace video\n");
// printf(" -f, --force Ignore invalid track warning\n");
printf("\n");
printf("Defaults:\n");
Expand Down Expand Up @@ -721,7 +736,16 @@ int main(int argc, char **argv) {
mpv_set_option_string(dvd_mpv, "ofopts", "movflags=empty_moov");

// Detelecining
strcpy(dvd_trip.vf_opts, "pullup,dejudder");
if(detelecine) {
printf("[dvd_trip] detelecining video using pullup, dejudder, fps filters\n");
strcat(dvd_trip.vf_opts, "pullup,dejudder,fps=fps=24000/1001");
}
if(detelecine && deinterlace)
strcat(dvd_trip.vf_opts, ",");
if(deinterlace) {
printf("[dvd_trip] deinterlacing video using bwdif filter\n");
strcat(dvd_trip.vf_opts, "bwdif=mode=send_frame:deint=interlaced");
}
mpv_set_option_string(dvd_mpv, "vf", dvd_trip.vf_opts);

/** Audio **/
Expand Down

0 comments on commit f2918b9

Please sign in to comment.