Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 193865 | Differences between
and this patch

Collapse All | Expand All

(-)vdrrip-0.3.0/a-tools.c (-1 / +4 lines)
Lines 108-111 Link Here
108
  return s1;
108
  return s1;
109
}
109
}
110
110
111
int roundValue(int i, int i1) {return i / i1 * i1;}
111
int roundValue(int i, int i1) {
112
  if (i%i1 > i1/2) {return (i/i1*i1+i1);}
113
  else {return (i/i1*i1);}
114
}
(-)vdrrip-0.3.0/i18n.c (-3 / +66 lines)
Lines 613-619 Link Here
613
  },
613
  },
614
614
615
  { "expert modus(off)",
615
  { "expert modus(off)",
616
    "Exp.-Modus(aus)",
616
    "Einfach",
617
    "",// TODO
617
    "",// TODO
618
    "Modo esperto(off)",
618
    "Modo esperto(off)",
619
    "",// TODO
619
    "",// TODO
Lines 634-640 Link Here
634
  },
634
  },
635
635
636
  { "expert modus(on)",
636
  { "expert modus(on)",
637
    "Exp.-Modus(ein)",
637
    "Experte",
638
    "",// TODO
638
    "",// TODO
639
    "Modo esperto(on)",
639
    "Modo esperto(on)",
640
    "",// TODO
640
    "",// TODO
Lines 718-724 Link Here
718
  },
718
  },
719
719
720
  { "CropData",
720
  { "CropData",
721
    "Schnitt-Daten",
721
    "Bildschnitt-Info",
722
    "",// TODO
722
    "",// TODO
723
    "Valori di taglio",
723
    "Valori di taglio",
724
    "",// TODO
724
    "",// TODO
Lines 738-743 Link Here
738
#endif
738
#endif
739
  },
739
  },
740
  
740
  
741
  { "RangeData",
742
    "Zeitlaufgrenzen",
743
    "",// TODO
744
    "",// TODO
745
    "",// TODO
746
    "",// TODO
747
    "",// TODO
748
    "",// TODO
749
    "",// TODO
750
    "",// TODO
751
    "",// TODO
752
    "",// TODO
753
    "",// TODO
754
    "",// TODO
755
    "",// TODO
756
    "",// TODO
757
#if VDRVERSNUM>10301
758
    "",// TODO
759
#endif
760
  },
761
  
741
  { "ScaleData",
762
  { "ScaleData",
742
    "Skalierung",
763
    "Skalierung",
743
    "",// TODO
764
    "",// TODO
Lines 885-890 Link Here
885
#endif
906
#endif
886
  },
907
  },
887
908
909
  { "CropPosX",
910
    "Startspalte",// TODO
911
    "",// TODO
912
    "",// TODO
913
    "",// TODO
914
    "",// TODO
915
    "",// TODO
916
    "",// TODO
917
    "",// TODO
918
    "",// TODO
919
    "",// TODO
920
    "",// TODO
921
    "",// TODO
922
    "",// TODO
923
    "",// TODO
924
    "",// TODO
925
#if VDRVERSNUM>10301
926
    "",// TODO
927
#endif
928
  },
929
930
  { "CropPosY",
931
    "Startzeile",// TODO
932
    "",// TODO
933
    "",// TODO
934
    "",// TODO
935
    "",// TODO
936
    "",// TODO
937
    "",// TODO
938
    "",// TODO
939
    "",// TODO
940
    "",// TODO
941
    "",// TODO
942
    "",// TODO
943
    "",// TODO
944
    "",// TODO
945
    "",// TODO
946
#if VDRVERSNUM>10301
947
    "",// TODO
948
#endif
949
  },
950
888
  { "- postprocessing Filters(%s):",
951
  { "- postprocessing Filters(%s):",
889
    "- Nachbearbeitungsfilter(%s):",
952
    "- Nachbearbeitungsfilter(%s):",
890
    "",// TODO
953
    "",// TODO
(-)vdrrip-0.3.0/menu-vdrrip.c (-20 / +144 lines)
Lines 4-9 Link Here
4
4
5
#include <vdr/plugin.h>
5
#include <vdr/plugin.h>
6
#include <vdr/videodir.h>
6
#include <vdr/videodir.h>
7
#if VDRVERSNUM >= 10307
8
#include <vdr/interface.h>
9
#include <vdr/recording.h>
10
#include <vdr/status.h>
11
#endif
7
12
8
#ifdef VDRRIP_DVD
13
#ifdef VDRRIP_DVD
9
  #include <dvdnav/ifo_read.h>
14
  #include <dvdnav/ifo_read.h>
Lines 16-32 Link Here
16
#include "queue.h"
21
#include "queue.h"
17
#include "vdrriprecordings.h"
22
#include "vdrriprecordings.h"
18
23
24
#define ABS(i) ((i)<0?-(i):(i))
19
#define MINQUANT 2
25
#define MINQUANT 2
20
#define MAXQUANT 15
26
#define MAXQUANT 15
21
27
22
#define NUMSCALETYPES 4
28
#define NUMSCALETYPES 4
23
#define NUMPPDEINT 6
29
#define NUMPPDEINT 8
24
30
25
static const char *ScaleTypes[] = { "off", "auto", "dvb", "manual" };
31
static const char *ScaleTypes[] = { "off", "auto", "dvb", "manual" };
26
static const char *DVBScaleWidths[] = { "352", "480", "544", "688", "704", "720" };
32
static const char *DVBScaleWidths[] = { "352", "480", "544", "688", "704", "720" };
27
static const char *DVBScaleHeights[] = { "288", "576" };
33
static const char *DVBScaleHeights[] = { "288", "576" };
28
static const char *CropModes[] = { "crop width & height", "crop only height"};
34
static const char *CropModes[] = { "crop width & height", "crop only height"};
29
static const char *PPDeint[] = { "off", "fd", "lb", "li", "ci", "md", };
35
static const char *PPDeint[] = { "off", "codec_does_il", "fd", "lb", "li", "ci", "md", "l5" };
30
36
31
// --- cMenuVdrrip ---------------------------------------------------------
37
// --- cMenuVdrrip ---------------------------------------------------------
32
38
Lines 92-105 Link Here
92
# ifdef VDRRIP_DVD
98
# ifdef VDRRIP_DVD
93
99
94
cMenuVdrripWarning::cMenuVdrripWarning(const char *Title, const char *Text)
100
cMenuVdrripWarning::cMenuVdrripWarning(const char *Title, const char *Text)
101
#if VDRVERSNUM >= 10307
102
:cMenuText(Title, "")
103
#else
95
:cOsdMenu(Title)
104
:cOsdMenu(Title)
105
#endif
96
{
106
{
97
  bool warning;
107
  bool warning;
98
  warning = true;
108
  warning = true;
99
  //warning = false;
109
  //warning = false;
100
110
101
  if (warning) {
111
  if (warning) {
112
#if VDRVERSNUM >= 10307
113
    SetText(Text);
114
#else
102
    Add(new cMenuTextItem(Text, 1, 2, Setup.OSDwidth - 2, MAXOSDITEMS, clrWhite, clrBackground, fontOsd));
115
    Add(new cMenuTextItem(Text, 1, 2, Setup.OSDwidth - 2, MAXOSDITEMS, clrWhite, clrBackground, fontOsd));
116
#endif
103
    SetHelp(tr("back"), tr("accept"), NULL, NULL);
117
    SetHelp(tr("back"), tr("accept"), NULL, NULL);
104
    hadsubmenu = false;
118
    hadsubmenu = false;
105
  } else {
119
  } else {
Lines 120-125 Link Here
120
  if (hadsubmenu) {return osBack;}
134
  if (hadsubmenu) {return osBack;}
121
  
135
  
122
  switch (Key) {
136
  switch (Key) {
137
#if VDRVERSNUM >= 10307
138
    // cMenuText::ProcessKey don't handle submenus
139
    case kUp|k_Repeat:
140
    case kUp:
141
    case kDown|k_Repeat:
142
    case kDown:
143
    case kLeft|k_Repeat:
144
    case kLeft:
145
    case kRight|k_Repeat:
146
    case kRight:
147
      DisplayMenu()->Scroll(NORMALKEY(Key) == kUp || NORMALKEY(Key) == kLeft,
148
                            NORMALKEY(Key) == kLeft || NORMALKEY(Key) == kRight);
149
      cStatus::MsgOsdTextItem(NULL, NORMALKEY(Key) == kUp);
150
      return osContinue;
151
#endif
152
123
    case kRed: return osBack;
153
    case kRed: return osBack;
124
154
125
    case kGreen: {
155
    case kGreen: {
Lines 138-150 Link Here
138
  ifo_handle_t *ifo_zero = NULL;
168
  ifo_handle_t *ifo_zero = NULL;
139
  ifo_handle_t *ifo_tmp = NULL;
169
  ifo_handle_t *ifo_tmp = NULL;
140
170
171
#if VDRVERSNUM >= 10307
172
  Skins.Message(mtStatus, tr("checking dvd..."));
173
  Skins.Flush();
174
#else
141
  Interface->Status(tr("checking dvd..."));
175
  Interface->Status(tr("checking dvd..."));
142
  Interface->Flush();
176
  Interface->Flush();
177
#endif
143
178
144
  if (access(DVD, R_OK) == -1) {
179
  if (access(DVD, R_OK) == -1) {
145
    char *s = NULL;
180
    char *s = NULL;
146
    asprintf(&s, "No read privileges on %s !", DVD);
181
    asprintf(&s, "No read privileges on %s !", DVD);
182
#if VDRVERSNUM >= 10307
183
    Skins.Message(mtError, s);
184
#else
147
    Interface->Error(s);
185
    Interface->Error(s);
186
#endif
148
    FREE(s);
187
    FREE(s);
149
    return false;
188
    return false;
150
  }
189
  }
Lines 160-166 Link Here
160
	else {
199
	else {
161
	  char *s = NULL;
200
	  char *s = NULL;
162
	  asprintf(&s, "Can't open ifo %d !", i);
201
	  asprintf(&s, "Can't open ifo %d !", i);
202
#if VDRVERSNUM >= 10307
203
	  Skins.Message(mtError, s);
204
#else
163
	  Interface->Error(s);
205
	  Interface->Error(s);
206
#endif
164
	  FREE(s);
207
	  FREE(s);
165
          DVDClose(dvd);
208
          DVDClose(dvd);
166
	  return false;
209
	  return false;
Lines 171-184 Link Here
171
      return true;
214
      return true;
172
    } else {
215
    } else {
173
      DVDClose(dvd);
216
      DVDClose(dvd);
217
#if VDRVERSNUM >= 10307
218
      Skins.Message(mtError, "Can't open main ifo from dvd !");
219
#else
174
      Interface->Error("Can't open main ifo from dvd !");
220
      Interface->Error("Can't open main ifo from dvd !");
221
#endif
175
      return false;
222
      return false;
176
    }
223
    }
177
  }
224
  }
178
 
225
 
179
  char *s = NULL;
226
  char *s = NULL;
180
  asprintf(&s, "Can 't open %s !", DVD);
227
  asprintf(&s, "Can 't open %s !", DVD);
228
#if VDRVERSNUM >= 10307
229
  Skins.Message(mtError, s);
230
#else
181
  Interface->Error(s);
231
  Interface->Error(s);
232
#endif
182
  FREE(s);
233
  FREE(s);
183
  return false;
234
  return false;
184
}
235
}
Lines 190-197 Link Here
190
cMenuVdrripEncode::cMenuVdrripEncode():cOsdMenu(tr("encode vdr-recording")) {
241
cMenuVdrripEncode::cMenuVdrripEncode():cOsdMenu(tr("encode vdr-recording")) {
191
  R = NULL;
242
  R = NULL;
192
  
243
  
244
#if VDRVERSNUM >= 10307
245
  Skins.Message(mtStatus, tr("scanning recordings..."));
246
  Skins.Flush();
247
#else
193
  Interface->Status(tr("scanning recordings..."));
248
  Interface->Status(tr("scanning recordings..."));
194
  Interface->Flush();
249
  Interface->Flush();
250
#endif
195
251
196
  R = new cVdrripRecordings;
252
  R = new cVdrripRecordings;
197
  Set();
253
  Set();
Lines 259-265 Link Here
259
    FREE(s1);
315
    FREE(s1);
260
  }
316
  }
261
317
262
  if (Q->getLockStat()) {Interface->Error(tr("the queuefile is locked by the queuehandler !"));}
318
  if (Q->getLockStat()) {
319
#if VDRVERSNUM >= 10307
320
    Skins.Message(mtError, tr("the queuefile is locked by the queuehandler !"));
321
#else
322
    Interface->Error(tr("the queuefile is locked by the queuehandler !"));
323
#endif
324
  }
263
325
264
  SetHelpKeys();
326
  SetHelpKeys();
265
}
327
}
Lines 353-363 Link Here
353
}
415
}
354
416
355
void cMenuVdrripQueue::AddColItem(cOsdItem *i) {
417
void cMenuVdrripQueue::AddColItem(cOsdItem *i) {
418
#if VDRVERSNUM < 10307
356
#ifdef clrScrolLine
419
#ifdef clrScrolLine
357
   i->SetColor(clrScrolLine, clrBackground);
420
   i->SetColor(clrScrolLine, clrBackground);
358
#else
421
#else
359
   i->SetColor(clrCyan, clrBackground);
422
   i->SetColor(clrCyan, clrBackground);
360
#endif
423
#endif
424
#endif
361
425
362
  Add(i);
426
  Add(i);
363
}
427
}
Lines 584-594 Link Here
584
}
648
}
585
649
586
void cMenuVdrripEditTemplate::AddColItem(cOsdItem *i) {
650
void cMenuVdrripEditTemplate::AddColItem(cOsdItem *i) {
651
#if VDRVERSNUM < 10307
587
#ifdef clrScrolLine
652
#ifdef clrScrolLine
588
   i->SetColor(clrScrolLine, clrBackground);
653
   i->SetColor(clrScrolLine, clrBackground);
589
#else
654
#else
590
   i->SetColor(clrCyan, clrBackground);
655
   i->SetColor(clrCyan, clrBackground);
591
#endif
656
#endif
657
#endif
592
658
593
  Add(i);
659
  Add(i);
594
}
660
}
Lines 600-607 Link Here
600
  MovOSDsaveName = NULL;
666
  MovOSDsaveName = NULL;
601
  FileSize[0] = MovieData[0] = CropData[0] = ScaleData[0] = NULL;
667
  FileSize[0] = MovieData[0] = CropData[0] = ScaleData[0] = NULL;
602
  
668
  
669
#if VDRVERSNUM >= 10307
670
  Skins.Message(mtStatus, tr("reading movie-data..."));
671
  Skins.Flush();
672
#else
603
  Interface->Status(tr("reading movie-data..."));
673
  Interface->Status(tr("reading movie-data..."));
604
  Interface->Flush();
674
  Interface->Flush();
675
#endif
605
676
606
  M = new cMovie(p, n);
677
  M = new cMovie(p, n);
607
  Init(); 
678
  Init(); 
Lines 646-651 Link Here
646
717
647
  CropWidthsave  = -1;
718
  CropWidthsave  = -1;
648
  CropHeightsave = -1;
719
  CropHeightsave = -1;
720
  CropPosXsave   = -1;
721
  CropPosYsave   = -1;
649
722
650
  MovOSD.PPDeinterlace = 0;
723
  MovOSD.PPDeinterlace = 0;
651
  MovOSD.PPDeblock = 0;
724
  MovOSD.PPDeblock = 0;
Lines 675-686 Link Here
675
748
676
  MovOSD.CropWidth      = M->getCropWidth();
749
  MovOSD.CropWidth      = M->getCropWidth();
677
  MovOSD.CropHeight     = M->getCropHeight();
750
  MovOSD.CropHeight     = M->getCropHeight();
751
  MovOSD.CropPosX       = M->getCropPosX();
752
  MovOSD.CropPosY       = M->getCropPosY();
678
  if (M->getPPValues()) {
753
  if (M->getPPValues()) {
679
    if (strstr(M->getPPValues(), "fd")) MovOSD.PPDeinterlace = 1;
754
         if (strstr(M->getPPValues(), "off")) MovOSD.PPDeinterlace = 0;
680
    else if (strstr(M->getPPValues(), "lb")) MovOSD.PPDeinterlace = 2;
755
    else if (strstr(M->getPPValues(), "codec_does_il")) MovOSD.PPDeinterlace = 1;
681
    else if (strstr(M->getPPValues(), "li")) MovOSD.PPDeinterlace = 3;
756
    else if (strstr(M->getPPValues(), "fd")) MovOSD.PPDeinterlace = 2;
682
    else if (strstr(M->getPPValues(), "ci")) MovOSD.PPDeinterlace = 4;
757
    else if (strstr(M->getPPValues(), "lb")) MovOSD.PPDeinterlace = 3;
683
    else if (strstr(M->getPPValues(), "md")) MovOSD.PPDeinterlace = 5;
758
    else if (strstr(M->getPPValues(), "li")) MovOSD.PPDeinterlace = 4;
759
    else if (strstr(M->getPPValues(), "ci")) MovOSD.PPDeinterlace = 5;
760
    else if (strstr(M->getPPValues(), "md")) MovOSD.PPDeinterlace = 6;
761
    else if (strstr(M->getPPValues(), "l5")) MovOSD.PPDeinterlace = 7;
684
    else MovOSD.PPDeinterlace = 0;
762
    else MovOSD.PPDeinterlace = 0;
685
763
686
    if (strstr(M->getPPValues(), "hb/vb/dr/al")) MovOSD.PPDeblock = 1;
764
    if (strstr(M->getPPValues(), "hb/vb/dr/al")) MovOSD.PPDeblock = 1;
Lines 779-784 Link Here
779
      M->getCropHeight(), M->getCalcAspect());
857
      M->getCropHeight(), M->getCalcAspect());
780
  }
858
  }
781
  AddColItem(new cMenuEditStraItem(tr("CropData"), &NumStatic, 1, CropData));
859
  AddColItem(new cMenuEditStraItem(tr("CropData"), &NumStatic, 1, CropData));
860
861
  // Show what range will be used
862
  if (M->getMarks()) {
863
    asprintf(&RangeData[0], "%s", M->getMarks());
864
    AddColItem(new cMenuEditStraItem(tr("RangeData"), &NumStatic, 1, RangeData));
865
  }
782
  
866
  
783
867
784
  // Bitrate Video
868
  // Bitrate Video
Lines 856-863 Link Here
856
    AddColItem(new cOsdItem(tr("------ expert settings: ------")));
940
    AddColItem(new cOsdItem(tr("------ expert settings: ------")));
857
    if (MovOSD.CropWidth != -1 && MovOSD.CropHeight != -1) {
941
    if (MovOSD.CropWidth != -1 && MovOSD.CropHeight != -1) {
858
      AddColItem(new cOsdItem(tr("- adjust crop values:")));
942
      AddColItem(new cOsdItem(tr("- adjust crop values:")));
859
      Add(new cMenuEditIntItem(tr("CropWidth"), &MovOSD.CropWidth, 0, M->getWidth()));
943
      Add(new cMenuEditIntItem(tr("CropWidth"), &MovOSD.CropWidth, 8, M->getWidth()));
860
      Add(new cMenuEditIntItem(tr("CropHeight"), &MovOSD.CropHeight, 0, M->getHeight()));
944
      Add(new cMenuEditIntItem(tr("CropHeight"), &MovOSD.CropHeight, 8, M->getHeight()));
945
      // values are really checked and limited with cMovie class
946
      // and depend on CropWidth/Height and Width/Height for the following parameters
947
      Add(new cMenuEditIntItem(tr("CropPosX"), &MovOSD.CropPosX, -1, M->getWidth()));
948
      Add(new cMenuEditIntItem(tr("CropPosY"), &MovOSD.CropPosY, -1, M->getHeight()));
861
    }
949
    }
862
      asprintf(&s, tr("- postprocessing Filters(%s):"), M->getPPValues() ? M->getPPValues() : "off");
950
      asprintf(&s, tr("- postprocessing Filters(%s):"), M->getPPValues() ? M->getPPValues() : "off");
863
      AddColItem(new cOsdItem(s));
951
      AddColItem(new cOsdItem(s));
Lines 877-895 Link Here
877
    if (M->getScaleType() == 1 || M->getScaleType() == 3) {
965
    if (M->getScaleType() == 1 || M->getScaleType() == 3) {
878
      CropWidthsave  = M->getCropWidth();
966
      CropWidthsave  = M->getCropWidth();
879
      CropHeightsave = M->getCropHeight();
967
      CropHeightsave = M->getCropHeight();
968
      CropPosXsave  = M->getCropPosX();
969
      CropPosYsave = M->getCropPosY();
880
    }
970
    }
881
    M->setNumTemplate(MovOSD.Template);
971
    M->setNumTemplate(MovOSD.Template);
882
    // restore old crop values
972
    // restore old crop values
883
    if (M->getScaleType() == 1 || M->getScaleType() == 3) {
973
    if (M->getScaleType() == 1 || M->getScaleType() == 3) {
884
      M->setCropValues(CropWidthsave, CropHeightsave);
974
      M->setCropValues(CropWidthsave, CropHeightsave, CropPosXsave, CropPosYsave);
885
    }
975
    }
886
    M->saveMovieData();
976
    M->saveMovieData();
887
    Set();
977
    Set();
888
978
889
#ifdef VDRRIP_DVD
979
#ifdef VDRRIP_DVD
890
  } else if (M->isDVD() && MovOSD.Title != MovOSDsave.Title && MovOSD.Title > 0) {
980
  } else if (M->isDVD() && MovOSD.Title != MovOSDsave.Title && MovOSD.Title > 0) {
981
#if VDRVERSNUM >= 10307
982
    Skins.Message(mtStatus, tr("reading audio-data from dvd..."));
983
    Skins.Flush();
984
#else
891
    Interface->Status(tr("reading audio-data from dvd..."));
985
    Interface->Status(tr("reading audio-data from dvd..."));
892
    Interface->Flush();
986
    Interface->Flush();
987
#endif
893
    M->setDVDTitle(MovOSD.Title, true);
988
    M->setDVDTitle(MovOSD.Title, true);
894
    M->saveMovieData();
989
    M->saveMovieData();
895
    Set();
990
    Set();
Lines 949-958 Link Here
949
    if (MovOSDsave.ScaleType == 1 || MovOSDsave.ScaleType == 3) {
1044
    if (MovOSDsave.ScaleType == 1 || MovOSDsave.ScaleType == 3) {
950
      CropWidthsave  = M->getCropWidth();
1045
      CropWidthsave  = M->getCropWidth();
951
      CropHeightsave = M->getCropHeight();
1046
      CropHeightsave = M->getCropHeight();
1047
      CropPosXsave  = M->getCropPosX();
1048
      CropPosYsave = M->getCropPosY();
952
      M->setScaleType(MovOSD.ScaleType);
1049
      M->setScaleType(MovOSD.ScaleType);
953
    } else {
1050
    } else {
954
      M->setScaleType(MovOSD.ScaleType);
1051
      M->setScaleType(MovOSD.ScaleType);
955
      M->setCropValues(CropWidthsave, CropHeightsave);
1052
      M->setCropValues(CropWidthsave, CropHeightsave, CropPosXsave, CropPosYsave);
956
    }
1053
    }
957
    M->saveMovieData();
1054
    M->saveMovieData();
958
    Set();
1055
    Set();
Lines 971-988 Link Here
971
    Set();
1068
    Set();
972
1069
973
  } else if (MovOSD.CropWidth != MovOSDsave.CropWidth || MovOSD.CropHeight != MovOSDsave.CropHeight) {
1070
  } else if (MovOSD.CropWidth != MovOSDsave.CropWidth || MovOSD.CropHeight != MovOSDsave.CropHeight) {
974
    if (MovOSD.CropWidth <= MovOSDsave.CropWidth) {
1071
    if (ABS(MovOSD.CropWidth - MovOSDsave.CropWidth)
975
      MovOSD.CropWidth = roundValue(MovOSD.CropWidth, 16);
1072
        + ABS(MovOSD.CropHeight - MovOSDsave.CropHeight) == 1) {
976
    } else {MovOSD.CropWidth = roundValue(MovOSD.CropWidth, 16) + 16;}
1073
      MovOSD.CropWidth = MovOSDsave.CropWidth + 8*(MovOSD.CropWidth - MovOSDsave.CropWidth);
977
    
1074
      MovOSD.CropHeight = MovOSDsave.CropHeight + 8*(MovOSD.CropHeight - MovOSDsave.CropHeight);
978
    if (MovOSD.CropHeight <= MovOSDsave.CropHeight) {
1075
    }
979
      MovOSD.CropHeight = roundValue(MovOSD.CropHeight, 16);
980
    } else {MovOSD.CropHeight = roundValue(MovOSD.CropHeight, 16) + 16;} 
981
1076
982
    M->setCropValues(MovOSD.CropWidth, MovOSD.CropHeight);
1077
    M->setCropValues(MovOSD.CropWidth, MovOSD.CropHeight);
983
    M->saveMovieData();
1078
    M->saveMovieData();
984
    Set();
1079
    Set();
985
1080
1081
  } else if (MovOSD.CropPosX != MovOSDsave.CropPosX || MovOSD.CropPosY != MovOSDsave.CropPosY) {
1082
    M->setCropValues(MovOSD.CropWidth, MovOSD.CropHeight, MovOSD.CropPosX, MovOSD.CropPosY);
1083
    M->saveMovieData();
1084
    Set();
1085
986
  } else if (MovOSD.PPDeinterlace != MovOSDsave.PPDeinterlace || MovOSD.PPDeblock != MovOSDsave.PPDeblock) {
1086
  } else if (MovOSD.PPDeinterlace != MovOSDsave.PPDeinterlace || MovOSD.PPDeblock != MovOSDsave.PPDeblock) {
987
    if (MovOSD.PPDeinterlace == 0 && MovOSD.PPDeblock == 0) M->setPPValues(NULL);
1087
    if (MovOSD.PPDeinterlace == 0 && MovOSD.PPDeblock == 0) M->setPPValues(NULL);
988
    else if (MovOSD.PPDeinterlace == 0 && MovOSD.PPDeblock == 1) M->setPPValues("hb/vb/dr/al");
1088
    else if (MovOSD.PPDeinterlace == 0 && MovOSD.PPDeblock == 1) M->setPPValues("hb/vb/dr/al");
Lines 1062-1073 Link Here
1062
          q->Rename       = VdrripSetup.Rename;
1162
          q->Rename       = VdrripSetup.Rename;
1063
          q->Container    = M->C->getContainer(M->getContainer());
1163
          q->Container    = M->C->getContainer(M->getContainer());
1064
          q->Preview      = p;
1164
          q->Preview      = p;
1165
	  q->StartByte    = M->getStartByte();
1166
	  q->Frames       = M->getFrames();
1065
1167
1066
          if(Q->New(q)) {
1168
          if(Q->New(q)) {
1067
            FREE(q);
1169
            FREE(q);
1068
            DELETE(Q);
1170
            DELETE(Q);
1069
            return osBack;
1171
            return osBack;
1070
          } else {Interface->Error(tr("the queuefile is locked by the queuehandler !"));}
1172
          } else {
1173
#if VDRVERSNUM >= 10307
1174
	    Skins.Message(mtError, tr("the queuefile is locked by the queuehandler !"));
1175
#else
1176
	    Interface->Error(tr("the queuefile is locked by the queuehandler !"));
1177
#endif
1178
	  }
1071
1179
1072
          FREE(q);
1180
          FREE(q);
1073
          DELETE(Q);
1181
          DELETE(Q);
Lines 1089-1099 Link Here
1089
	  } else {
1197
	  } else {
1090
	    if (Interface->Confirm(tr("crop black movie boarders ?"))) {
1198
	    if (Interface->Confirm(tr("crop black movie boarders ?"))) {
1091
	      CropReset = true;
1199
	      CropReset = true;
1200
#if VDRVERSNUM >= 10307
1201
	      Skins.Message(mtStatus, tr("search for black movie boarders"));
1202
	      Skins.Flush();
1203
#else
1092
              Interface->Status(tr("search for black movie boarders"));
1204
              Interface->Status(tr("search for black movie boarders"));
1093
	      Interface->Flush();
1205
	      Interface->Flush();
1206
#endif
1094
              if (! M->setCropValues()) {
1207
              if (! M->setCropValues()) {
1095
		CropReset = false;
1208
		CropReset = false;
1209
#if VDRVERSNUM >= 10307
1210
		Skins.Message(mtError, tr("couldn't detect black movie boarders !"));
1211
#else
1096
		Interface->Error(tr("couldn't detect black movie boarders !"));
1212
		Interface->Error(tr("couldn't detect black movie boarders !"));
1213
#endif
1097
	      }
1214
	      }
1098
	      M->saveMovieData();
1215
	      M->saveMovieData();
1099
            }
1216
            }
Lines 1133-1143 Link Here
1133
}
1250
}
1134
1251
1135
void cMenuVdrripMovie::AddColItem(cOsdItem *i) {
1252
void cMenuVdrripMovie::AddColItem(cOsdItem *i) {
1253
#if VDRVERSNUM < 10307
1136
#ifdef clrScrolLine
1254
#ifdef clrScrolLine
1137
   i->SetColor(clrScrolLine, clrBackground);
1255
   i->SetColor(clrScrolLine, clrBackground);
1138
#else
1256
#else
1139
   i->SetColor(clrCyan, clrBackground);
1257
   i->SetColor(clrCyan, clrBackground);
1140
#endif
1258
#endif
1259
#endif
1141
1260
1142
  Add(i);
1261
  Add(i);
1143
}
1262
}
Lines 1163-1170 Link Here
1163
  eOSState state = cOsdMenu::ProcessKey(Key);
1282
  eOSState state = cOsdMenu::ProcessKey(Key);
1164
1283
1165
  if (Key == kOk) {
1284
  if (Key == kOk) {
1285
#if VDRVERSNUM >= 10307
1286
    Skins.Message(mtStatus, tr("reading audio-data from dvd..."));
1287
    Skins.Flush();
1288
#else
1166
    Interface->Status(tr("reading audio-data from dvd..."));
1289
    Interface->Status(tr("reading audio-data from dvd..."));
1167
    Interface->Flush();
1290
    Interface->Flush();
1291
#endif
1168
    M->setDVDTitle(Current() + 1, true);
1292
    M->setDVDTitle(Current() + 1, true);
1169
    M->saveMovieData();
1293
    M->saveMovieData();
1170
    return osBack;
1294
    return osBack;
(-)vdrrip-0.3.0/menu-vdrrip.h (-1 / +15 lines)
Lines 7-12 Link Here
7
7
8
#include <vdr/osd.h>
8
#include <vdr/osd.h>
9
#include <vdr/menuitems.h>
9
#include <vdr/menuitems.h>
10
#if VDRVERSNUM >= 10307
11
#include <vdr/menu.h>
12
#include <vdr/skins.h>
13
#endif
10
14
11
#include "movie.h"
15
#include "movie.h"
12
#include "vdrriprecordings.h"
16
#include "vdrriprecordings.h"
Lines 35-40 Link Here
35
  //expert menu:
39
  //expert menu:
36
  int CropWidth;
40
  int CropWidth;
37
  int CropHeight;
41
  int CropHeight;
42
  int CropPosX;
43
  int CropPosY;
38
  int PPDeinterlace;
44
  int PPDeinterlace;
39
  int PPDeblock;
45
  int PPDeblock;
40
  int Bpp;
46
  int Bpp;
Lines 51-57 Link Here
51
57
52
#ifdef VDRRIP_DVD
58
#ifdef VDRRIP_DVD
53
59
54
class cMenuVdrripWarning : public cOsdMenu {
60
class cMenuVdrripWarning
61
#if VDRVERSNUM >= 10307
62
  : public cMenuText {
63
#else
64
  : public cOsdMenu {
65
#endif
55
private:
66
private:
56
  bool hadsubmenu;
67
  bool hadsubmenu;
57
68
Lines 140-151 Link Here
140
  char *FileSize[1];
151
  char *FileSize[1];
141
  char *MovieData[1];
152
  char *MovieData[1];
142
  char *CropData[1];
153
  char *CropData[1];
154
  char *RangeData[1];
143
  char *ScaleData[1];
155
  char *ScaleData[1];
144
156
145
  bool OSDupdate, Crop, CropReset, Expert;
157
  bool OSDupdate, Crop, CropReset, Expert;
146
158
147
  int CropWidthsave;
159
  int CropWidthsave;
148
  int CropHeightsave;
160
  int CropHeightsave;
161
  int CropPosXsave;
162
  int CropPosYsave;
149
163
150
  int NumStatic;
164
  int NumStatic;
151
165
(-)vdrrip-0.3.0/movie.c (-81 / +169 lines)
Lines 6-17 Link Here
6
#include <stdlib.h>
6
#include <stdlib.h>
7
#include <string.h>
7
#include <string.h>
8
#include <math.h>
8
#include <math.h>
9
#include <sys/types.h>
10
#include <sys/stat.h>
11
#include <unistd.h>
9
12
10
#ifdef VDRRIP_DVD
13
#ifdef VDRRIP_DVD
11
  #include <dvdnav/ifo_read.h>
14
  #include <dvdnav/ifo_read.h>
12
#endif //VDRRIP_DVD
15
#endif //VDRRIP_DVD
13
16
14
#include <vdr/plugin.h>
17
#include <vdr/plugin.h>
18
#include <vdr/recording.h>
15
19
16
#include "movie.h"
20
#include "movie.h"
17
#include "menu-vdrrip.h"
21
#include "menu-vdrrip.h"
Lines 21-30 Link Here
21
25
22
#define SAVEFILE "save.vdrrip"
26
#define SAVEFILE "save.vdrrip"
23
27
24
#define IDENTCMD "%s \'%s\'%s -identify -frames 0 2>/dev/null | sed -e \'s/[`\\!$\"]/\\&/g\'"
28
#define DVDIDENT "%s \'%s\'%s -identify -vo null -ao null -frames 1 2>/dev/null | sed -e \'s/[`\\!$\"]/\\&/g\'"
25
#define CROPCMD "%s \'%s\'%s -vo null -ao null -really-quiet -ss %i -frames %i -vop cropdetect 2>/dev/null | grep \"crop=\" | sed \"s/.*crop\\(.*\\)).*/\\1/\" | sort | uniq -c | sort -r"
29
#define DVDCROP "%s \'%s\'%s -vo null -ao null -quiet -ss %i -frames %i -vf cropdetect 2>/dev/null | sed -ne \'/crop=/ s/.*crop\\(=.*\\)).*/\\1/p\' | sort | uniq -c | sort -nr"
26
#define AUDIOCMD "%s \'%s/001.vdr\' -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO"
30
#define DVDAUDIO "%s %s -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO"
27
#define AUDIOCMDDVD "%s %s -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO"
31
32
#define VDRIDENT "%s \'%s\'%s -identify -vo null -ao null -frames 1 2>/dev/null | sed -e \'s/[`\\!$\"]/\\&/g\'"
33
#define VDRCROP "%s \'%s\'%s -vo null -ao null -quiet -sb %lld -frames %i -vf cropdetect 2>/dev/null | sed -ne \'/crop=/ s/.*crop\\(=.*\\)).*/\\1/p\' | sort | uniq -c | sort -nr"
34
#define VDRAUDIO "%s \'%s/001.vdr\' -vo null -ao null -frames 0 -aid %i 2>/dev/null | grep AUDIO"
35
28
#define MENCCMD "%s %s help 2>/dev/null"
36
#define MENCCMD "%s %s help 2>/dev/null"
29
37
30
// --- cMovie ------------------------------------------------------------
38
// --- cMovie ------------------------------------------------------------
Lines 38-44 Link Here
38
  StrTitles = NULL;
46
  StrTitles = NULL;
39
#endif //VDRRIP_DVD
47
#endif //VDRRIP_DVD
40
48
41
  Dir = OrigName = Name = PPValues = NULL;
49
  Dir = Marks = Name = OrigName = PPValues = NULL;
42
  A = NULL;
50
  A = NULL;
43
  StrAudioData = StrAudioData2 = NULL;
51
  StrAudioData = StrAudioData2 = NULL;
44
52
Lines 75-83 Link Here
75
    Dvd = false;
83
    Dvd = false;
76
84
77
    // detect vdr-data
85
    // detect vdr-data
78
    setLengthVDR();
79
    queryMpValuesVDR();
86
    queryMpValuesVDR();
80
    queryAudioDataVDR();
87
    queryAudioDataVDR();
88
    setLengthVDR();
89
    setMarksVDR();
81
    
90
    
82
    if (! restoreMovieData()) {
91
    if (! restoreMovieData()) {
83
      // set to default template
92
      // set to default template
Lines 167-174 Link Here
167
int cMovie::getFileNumbers() {return FileNumbers;}
176
int cMovie::getFileNumbers() {return FileNumbers;}
168
177
169
void cMovie::setBitrate(int v, int a) {
178
void cMovie::setBitrate(int v, int a) {
170
  // avoid BitrateAudio < 32
179
  // set audio bitrates and avoid BitrateAudio < 32
171
  if (a < 32 && strcmp(C->getACodec(ACodec), "copy") != 0) {a = 32;}
180
  if (ACodec == C->getNumACodec("copy")) { a = A[AudioID].Bitrate; }
181
  else { if (a < 32) {a = 32;} }
172
  BitrateAudio = a;
182
  BitrateAudio = a;
173
183
174
  if (v == -1) {
184
  if (v == -1) {
Lines 259-265 Link Here
259
  ScaleHeight = height;
269
  ScaleHeight = height;
260
}
270
}
261
271
272
void cMovie::setCropValues(int width, int height, int posx, int posy) {
273
  setCropValues(width, height);
274
275
  if (posx > Width - CropWidth) { CropPosX = Width - CropWidth; }
276
  else if (posx < 0) { CropPosX = 0; }
277
  else { CropPosX = posx; }
278
279
  if (posy > Height - CropHeight) { CropPosY = Height - CropHeight; }
280
  else if (posy < 0) { CropPosY = 0; }
281
  else { CropPosY = posy; }
282
}
283
262
void cMovie::setCropValues(int width, int height) {
284
void cMovie::setCropValues(int width, int height) {
285
  CalcAspect = Aspect;
286
263
  CropWidth  = width;
287
  CropWidth  = width;
264
  if (CropWidth > Width) CropWidth = Width;
288
  if (CropWidth > Width) CropWidth = Width;
265
  
289
  
Lines 267-280 Link Here
267
  if (CropHeight > Height) CropHeight = Height;
291
  if (CropHeight > Height) CropHeight = Height;
268
292
269
  if (CropWidth == -1) CropPosX = -1;
293
  if (CropWidth == -1) CropPosX = -1;
270
  else CropPosX = (Width - CropWidth) / 2;
294
  else {
295
    CropPosX = (Width - CropWidth) / 2;
296
    CalcAspect = CropWidth * CalcAspect / Width;
297
  }
271
298
272
  if (CropHeight == -1) {
299
  if (CropHeight == -1) {CropPosY = -1;}
273
    CropPosY = -1;
300
  else {
274
    CalcAspect = Aspect;
275
  } else {
276
    CropPosY = (Height - CropHeight) / 2;
301
    CropPosY = (Height - CropHeight) / 2;
277
    CalcAspect = Height * Aspect / CropHeight;
302
    CalcAspect = Height * CalcAspect / CropHeight;
278
  }
303
  }
279
304
280
  setScale();
305
  setScale();
Lines 285-356 Link Here
285
  char *cmd = NULL, *buf = NULL;
310
  char *cmd = NULL, *buf = NULL;
286
  bool ret = true;
311
  bool ret = true;
287
312
288
  size_t i = 0;
313
  off_t skipbytes = 0;
289
  int l = 0;
314
  int skipseconds = 0;
290
  int l1;
315
  int frames_to_inspect;
291
316
292
  if (Dvd) {asprintf(&cmd, IDENTCMD, MPlayer, Dir, "");
317
  FILE *p = NULL;
293
  } else {asprintf(&cmd, IDENTCMD, MPlayer, Dir, "/001.vdr");}
294
318
295
  FILE *p = popen(cmd, "r");
319
  if (Dvd) {
296
  if (p) {
320
    asprintf(&cmd, DVDIDENT, MPlayer, Dir, "");
297
    char *s = NULL;
321
298
    s = strcol(strgrep("ID_LENGTH", p), "=", 2);
322
    p = popen(cmd, "r");
299
    if (s) {l = atoi(s);}
323
    if (p) {
300
    FREE(s);
324
      char *s = NULL;
325
      s = strcol(strgrep("ID_LENGTH", p), "=", 2);
326
      if (s) {skipseconds = atoi(s)/2;}
327
      FREE(s);
328
    } else {
329
      dsyslog("[vdrrip] could not open pipe to %s !", cmd);
330
    }
331
    pclose(p);
332
    FREE(cmd);
301
  } else {
333
  } else {
302
    dsyslog("[vdrrip] could not open pipe to %s !", cmd);
334
    asprintf(&cmd, "%s%s", Dir, "/001.vdr"); //lazy and safe strcat
303
  }
304
  pclose(p);
305
  FREE(cmd);
306
335
336
    /* skip to the middle of 001.vdr - there are cases where -ss option of
337
     * mplayer does not work to seek a vdr file, so use -sb instead
338
     */
339
    struct stat *vdrstat = (struct stat *) malloc(sizeof(struct stat));
340
    if (0 == stat(cmd, vdrstat)) {
341
      skipbytes = (vdrstat->st_size) >> 1; // divide filesize by 2
342
    } else {
343
      dsyslog("[vdrrip] could not stat %s to determine filesize!", cmd);
344
    }
345
346
    FREE(vdrstat);
347
    FREE(cmd);
348
  }
307
349
308
  l1 = VdrripSetup.CropLength * (int)Fps;
350
  frames_to_inspect = VdrripSetup.CropLength * (int)Fps;
309
  if (Dvd) {
351
  if (Dvd) {
310
    asprintf(&cmd, CROPCMD, MPlayer, Dir, "", l/2, l1);
352
    asprintf(&cmd, DVDCROP, MPlayer, Dir, "", skipseconds, frames_to_inspect);
311
    isyslog("[vdrrip] detecting crop values in %s", Dir);
353
    isyslog("[vdrrip] detecting crop values in %s", Dir);
312
  } else {
354
  } else {
313
    asprintf(&cmd, CROPCMD, MPlayer, Dir, "/001.vdr", l/2, l1);
355
    asprintf(&cmd, VDRCROP, MPlayer, Dir, "/001.vdr", (long long) skipbytes, frames_to_inspect);
314
    isyslog("[vdrrip] detecting crop values in %s/001.vdr", Dir);
356
    isyslog("[vdrrip] detecting crop values in %s/001.vdr", Dir);
357
    isyslog("[vdrrip] mplayer command used: %s", cmd);
315
  }
358
  }
316
  p = popen(cmd, "r");
359
  p = popen(cmd, "r");
317
  FREE(cmd);
360
  FREE(cmd);
318
361
319
  if (p) {
362
  if (p) {
320
    //  get first line
363
    /* get first line only - shows most occurences of identically detected crop parameters
364
     * within frames_to_inspect starting from skipseconds/skipbytes
365
     */
366
    size_t i;
321
    if (getline(&buf, &i, p) != -1) {
367
    if (getline(&buf, &i, p) != -1) {
322
      char *s = NULL;
368
      char *s = NULL;
323
369
324
      s = strcol(buf, "=", 2);
370
      s = strcol(buf, "=", 2);
325
      CropWidth = roundValue(atoi(strcol(s, ":", 1)), 16);
371
      CropHeight = atoi(strcol(s, ":", 2));
326
      if (CropWidth > Width || CropWidth < 0) {
372
      CropPosY = atoi(strcol(s, ":", 4));
327
	ret = false;
373
      if (CropHeight > Height || CropHeight < 8) {ret = false;}
328
	CropWidth = Width;
374
      if (CropPosY > Height - CropHeight || CropPosY < 0) {ret = false;}
329
      }
375
330
      
376
      // crop width only if desired
331
      CropHeight = roundValue(atoi(strcol(s, ":", 2)), 16);
377
      if (VdrripSetup.CropMode == 1) {
332
      if (CropHeight > Height || CropHeight < 0) {
378
        CropWidth = Width;
333
	ret = false;
379
	CropPosX = 0;
334
	CropHeight = Height;
380
      } else {
381
        CropWidth = atoi(strcol(s, ":", 1));
382
        CropPosX = atoi(strcol(s, ":", 3));
383
        if (CropWidth > Width || CropWidth < 8) {ret = false;}
384
        if (CropPosX > Width - CropWidth || CropPosX < 0) {ret = false;}
335
      }
385
      }
336
386
337
      if (VdrripSetup.CropMode == 1) {CropWidth = Width;} 
387
      // CalcAspect is changed now
338
      CropPosX = (Width - CropWidth) / 2;
388
      if (ret) {
339
      CropPosY = (Height - CropHeight) / 2;
389
        CalcAspect = Height * Aspect / CropHeight;
340
      // CalcAspect is changed now:
390
        setScale();
341
      CalcAspect = Height * Aspect / CropHeight;
391
      }
342
      setScale();
343
392
344
      FREE(s);
393
      FREE(s);
345
      FREE(buf);
394
      FREE(buf);
346
    } else {
347
      ret = false;
348
    }
395
    }
349
396
350
  pclose(p);
397
    pclose(p);
351
  } else ret = false;
398
  }
352
399
353
  if (! ret) initCropValues();
400
  if (!ret) initCropValues();
354
401
355
  return ret;
402
  return ret;
356
}
403
}
Lines 363-368 Link Here
363
  CalcAspect = Aspect;
410
  CalcAspect = Aspect;
364
}
411
}
365
412
413
long long cMovie::getStartByte() { return StartByte; }
414
int cMovie::getFrames() { return Frames; }
415
char *cMovie::getMarks() { return Marks; } 
416
366
void cMovie::setCodecs(int v, int a) {
417
void cMovie::setCodecs(int v, int a) {
367
  // validate video codec
418
  // validate video codec
368
  if (v >= 0 && v < C->getNumVCodecs()) {VCodec = v;
419
  if (v >= 0 && v < C->getNumVCodecs()) {VCodec = v;
Lines 383-394 Link Here
383
    ACodec = C->getNumACodec("copy");
434
    ACodec = C->getNumACodec("copy");
384
  }
435
  }
385
436
386
  // set audio bitrates
437
  // set bitrates
387
  if (ACodec == C->getNumACodec("copy")) {
438
  setBitrate(T->getBitrateVideo(NumTemplate), T->getBitrateAudio(NumTemplate));
388
    setBitrate(T->getBitrateVideo(NumTemplate), A[AudioID].Bitrate);
389
  } else {
390
    setBitrate(T->getBitrateVideo(NumTemplate), T->getBitrateAudio(NumTemplate));
391
  }
392
}
439
}
393
440
394
void cMovie::setBpp(int i) {
441
void cMovie::setBpp(int i) {
Lines 429-435 Link Here
429
int cMovie::getCropPosY() {return CropPosY;}
476
int cMovie::getCropPosY() {return CropPosY;}
430
477
431
double cMovie::getResBpp() {
478
double cMovie::getResBpp() {
432
  return (double)BitrateVideo * 1024. / (double)ScaleWidth / (double)ScaleHeight / Fps;}
479
  return (double)BitrateVideo * 1024. / (double)ScaleWidth / (double)ScaleHeight / Fps;
480
}
433
481
434
double cMovie::getBpp() {return (double)Bpp;}
482
double cMovie::getBpp() {return (double)Bpp;}
435
483
Lines 491-500 Link Here
491
}
539
}
492
540
493
541
542
void cMovie::setMarksVDR() {
543
  Frames = StartByte = -1;
544
  cMarks *vdrmarks = new cMarks();
545
  vdrmarks->Load(Dir);
546
547
  if (vdrmarks->GetNext(StartByte)) StartByte = vdrmarks->GetNext(0)->position;
548
  if (vdrmarks->GetNext(StartByte)) Frames = vdrmarks->GetNext(StartByte)->position - StartByte;
549
  FREE(vdrmarks);
550
    
551
  if (Frames > -1) {
552
    asprintf(&Marks, "%s - %s",
553
      (const char*) IndexToHMSF(StartByte, true),
554
      (const char*) IndexToHMSF(Frames, true)
555
    );
556
557
    isyslog("[vdrrip] found two valid marks: encoding from %s..", Marks);
558
559
    /* If the index is not OK, we simply encode Frames number of frames,
560
     * since we do not need the index to compute this value for mplayer. */
561
    cIndexFile *vdrindex = new cIndexFile(Dir, false);
562
    if (vdrindex->Ok()) {
563
      uchar fnum = 0;
564
      int foff = 0;
565
566
      if (vdrindex->Get(StartByte, &fnum, &foff)) {
567
	Frames -= StartByte; // will be mplayer endpos
568
        StartByte = (fnum-1)*MAXVIDEOFILESIZE*1024LL*1024LL + (long long)(foff);
569
      } else { StartByte = 0 ; }
570
    } else { StartByte = 0 ; }
571
572
    /* Update Length for Bitrate, Filesize computation.. fps must be known for this*/
573
    Length = Frames / Fps ;
574
  } else {
575
    FREE(Marks);
576
    Marks = NULL;
577
  }
578
}
579
580
494
void cMovie::queryMpValuesVDR() {
581
void cMovie::queryMpValuesVDR() {
495
  char *cmd = NULL, *s = NULL;
582
  char *cmd = NULL, *s = NULL;
496
583
497
  asprintf(&cmd, IDENTCMD, MPlayer, Dir, "/001.vdr");
584
  asprintf(&cmd, VDRIDENT, MPlayer, Dir, "/001.vdr");
498
  FILE *p = popen(cmd, "r");
585
  FILE *p = popen(cmd, "r");
499
  if (p) {
586
  if (p) {
500
    s = strcol(strgrep("ID_VIDEO_WIDTH", p), "=", 2);
587
    s = strcol(strgrep("ID_VIDEO_WIDTH", p), "=", 2);
Lines 515-525 Link Here
515
    } else {Fps = -1;}
602
    } else {Fps = -1;}
516
    FREE(s);
603
    FREE(s);
517
604
518
    s = strcol(strgrep("ID_VIDEO_ASPECT", p), "=", 2);
605
    Aspect = -1;
519
    if (s) {
606
    while(s = strcol(strgrep("ID_VIDEO_ASPECT", p), "=", 2)){
520
      Aspect = atof(s);
607
       Aspect = atof(s);
521
    } else {Aspect = -1;}
608
       if (Aspect != 0) break;
522
609
    }   
610
    if (Aspect == 0) {Aspect = 1.333333;}
523
    CalcAspect = Aspect;
611
    CalcAspect = Aspect;
524
612
525
    pclose(p);
613
    pclose(p);
Lines 538-544 Link Here
538
  bool next = true;
626
  bool next = true;
539
627
540
  while (next) {
628
  while (next) {
541
    asprintf(&cmd, AUDIOCMD, MPlayer, Dir, c);
629
    asprintf(&cmd, VDRAUDIO, MPlayer, Dir, c);
542
    FILE *p = popen(cmd, "r");
630
    FILE *p = popen(cmd, "r");
543
    if (p) {
631
    if (p) {
544
      if (getline(&buf, &i, p) != -1) {
632
      if (getline(&buf, &i, p) != -1) {
Lines 630-640 Link Here
630
  
718
  
631
  FILE *f = fopen(file,"w");
719
  FILE *f = fopen(file,"w");
632
  if (f) {
720
  if (f) {
633
    fprintf(f,"%s;%i;%i;%i;%s;%i;%i;%i;%i;%i;%i;%i;%i;%i;%s;%i;%i;%s;%s;%s;%d\n",
721
    fprintf(f,"%s;%i;%i;%i;%s;%i;%i;%i;%i;%i;%i;%i;%i;%i;%s;%i;%i;%s;%s;%s;%lld;%lld;%d\n",
634
    Name, FileSize, FileNumbers, Bitrate, C->getVCodec(VCodec), BitrateVideo,
722
    Name, FileSize, FileNumbers, Bitrate, C->getVCodec(VCodec), BitrateVideo,
635
    CropWidth, CropHeight, CropPosX, CropPosY, ScaleType, ScaleWidth,
723
    CropWidth, CropHeight, CropPosX, CropPosY, ScaleType, ScaleWidth,
636
    ScaleHeight, Bpp, C->getACodec(ACodec), BitrateAudio, AudioID, PPValues,
724
    ScaleHeight, Bpp, C->getACodec(ACodec), BitrateAudio, AudioID, PPValues,
637
    T->getName(NumTemplate), C->getContainer(Container),
725
    T->getName(NumTemplate), C->getContainer(Container), StartByte, Frames,
638
#ifdef VDRRIP_DVD
726
#ifdef VDRRIP_DVD
639
      Dvd ? Title : 0
727
      Dvd ? Title : 0
640
#else
728
#else
Lines 661-672 Link Here
661
  FILE *f = fopen(file,"r");
749
  FILE *f = fopen(file,"r");
662
  if (f) {
750
  if (f) {
663
    if (getline(&buf, &i, f) != -1) {
751
    if (getline(&buf, &i, f) != -1) {
752
      fclose(f);
753
664
      Name          = strcol(buf, ";",  1);
754
      Name          = strcol(buf, ";",  1);
665
      FileSize      = atoi(strcol(buf, ";",  2));
755
      FileSize      = atoi(strcol(buf, ";",  2));
666
      FileNumbers   = atoi(strcol(buf, ";",  3));
756
      FileNumbers   = atoi(strcol(buf, ";",  3));
667
      Bitrate       = atoi( strcol(buf, ";", 4));
668
      vcodec        = strcol(buf, ";",  5);
757
      vcodec        = strcol(buf, ";",  5);
669
      BitrateVideo  = atoi(strcol(buf, ";",  6));
670
      CropWidth     = atoi(strcol(buf, ";",  7));
758
      CropWidth     = atoi(strcol(buf, ";",  7));
671
      CropHeight    = atoi(strcol(buf, ";",  8));
759
      CropHeight    = atoi(strcol(buf, ";",  8));
672
      CropPosX      = atoi(strcol(buf, ";",  9));
760
      CropPosX      = atoi(strcol(buf, ";",  9));
Lines 676-682 Link Here
676
      ScaleHeight   = atoi(strcol(buf, ";", 13));
764
      ScaleHeight   = atoi(strcol(buf, ";", 13));
677
      Bpp           = atoi(strcol(buf, ";", 14));
765
      Bpp           = atoi(strcol(buf, ";", 14));
678
      acodec        = strcol(buf, ";", 15);
766
      acodec        = strcol(buf, ";", 15);
679
      BitrateAudio  = atoi(strcol(buf, ";", 16));
680
      AudioID       = atoi(strcol(buf, ";", 17));
767
      AudioID       = atoi(strcol(buf, ";", 17));
681
      PPValues      = strcol(buf, ";", 18);
768
      PPValues      = strcol(buf, ";", 18);
682
      if (strcmp(PPValues, "(null)") == 0) PPValues = NULL;
769
      if (strcmp(PPValues, "(null)") == 0) PPValues = NULL;
Lines 684-701 Link Here
684
      // migrate from version 0.1.1
771
      // migrate from version 0.1.1
685
      container     = strcol(buf, ";", 20);
772
      container     = strcol(buf, ";", 20);
686
      if (! container) container = strdup("avi");
773
      if (! container) container = strdup("avi");
774
      StartByte     = atoll(strcol(buf, ";", 21));
775
      Frames        = atoll(strcol(buf, ";", 22));
687
#ifdef VDRRIP_DVD
776
#ifdef VDRRIP_DVD
688
      // migrate from version 0.2.0a
777
      // migrate from version 0.2.0a
689
      if (Dvd) Title = atoi(strcol(buf, ";", 21));
778
      if (Dvd) Title = atoi(strcol(buf, ";", 23));
690
#endif //VDRRIP_DVD
779
#endif //VDRRIP_DVD
691
780
692
      FREE(buf);
693
694
      fclose(f);
695
      isyslog("[vdrrip] restored data from file %s !", file);
696
697
      // validate some values:
781
      // validate some values:
698
      if (! Dvd) setCropValues(CropWidth, CropHeight);
782
      if (! Dvd) setCropValues(CropWidth, CropHeight, CropPosX, CropPosY);
699
783
700
      NumTemplate = T->getNumTemplate(tname);
784
      NumTemplate = T->getNumTemplate(tname);
701
      if (NumTemplate == -1) {
785
      if (NumTemplate == -1) {
Lines 716-722 Link Here
716
      FREE(acodec);
800
      FREE(acodec);
717
801
718
      setAudioID(AudioID);
802
      setAudioID(AudioID);
803
      setBitrate(atoi(strcol(buf, ";", 6)), atoi(strcol(buf, ";", 16)));
804
      setMarksVDR();
719
805
806
      isyslog("[vdrrip] restored data from file %s !", file);
807
      FREE(buf);
720
    } else {
808
    } else {
721
      dsyslog("[vdrrip] could not read data from file %s !", file);
809
      dsyslog("[vdrrip] could not read data from file %s !", file);
722
      FREE(file);
810
      FREE(file);
Lines 951-957 Link Here
951
  size_t i = 0;
1039
  size_t i = 0;
952
  int b = 0;
1040
  int b = 0;
953
1041
954
  asprintf(&cmd, AUDIOCMDDVD, MPlayer, Dir, c);
1042
  asprintf(&cmd, DVDAUDIO, MPlayer, Dir, c);
955
  FILE *p = popen(cmd, "r");
1043
  FILE *p = popen(cmd, "r");
956
  if (p) {
1044
  if (p) {
957
    if (getline(&buf, &i, p) != -1) {
1045
    if (getline(&buf, &i, p) != -1) {
(-)vdrrip-0.3.0/movie.h (-1 / +8 lines)
Lines 42-47 Link Here
42
    
42
    
43
    char *OrigName;
43
    char *OrigName;
44
    char *Name;
44
    char *Name;
45
    char *Marks;
45
    char *Dir;
46
    char *Dir;
46
    int Length;
47
    int Length;
47
    int FileSize;
48
    int FileSize;
Lines 62-67 Link Here
62
    int CropHeight;
63
    int CropHeight;
63
    int CropPosX;
64
    int CropPosX;
64
    int CropPosY;
65
    int CropPosY;
66
    long long StartByte;
67
    int Frames;
65
    int Bpp;
68
    int Bpp;
66
    int Container;
69
    int Container;
67
    int VCodec;
70
    int VCodec;
Lines 71-77 Link Here
71
    struct AudioData *A;
74
    struct AudioData *A;
72
    char *PPValues;
75
    char *PPValues;
73
    
76
    
74
    char *MarksFile;
75
    char **StrAudioData;
77
    char **StrAudioData;
76
    char **StrAudioData2;
78
    char **StrAudioData2;
77
79
Lines 116-127 Link Here
116
    int getScaleType();
118
    int getScaleType();
117
    int getScaleWidth();
119
    int getScaleWidth();
118
    int getScaleHeight();
120
    int getScaleHeight();
121
    void setCropValues(int width, int height, int posx, int posy);
119
    void setCropValues(int width, int height);
122
    void setCropValues(int width, int height);
120
    bool setCropValues();
123
    bool setCropValues();
121
    int getCropHeight();
124
    int getCropHeight();
122
    int getCropWidth();
125
    int getCropWidth();
123
    int getCropPosX();
126
    int getCropPosX();
124
    int getCropPosY();
127
    int getCropPosY();
128
    long long getStartByte();
129
    int getFrames();
130
    char* getMarks();
125
    void setBpp(int i);
131
    void setBpp(int i);
126
    double getBpp();
132
    double getBpp();
127
    double getResBpp();
133
    double getResBpp();
Lines 142-147 Link Here
142
148
143
    // VDR-Movie
149
    // VDR-Movie
144
    void setLengthVDR();
150
    void setLengthVDR();
151
    void setMarksVDR();
145
    void queryMpValuesVDR();
152
    void queryMpValuesVDR();
146
    void queryAudioDataVDR();
153
    void queryAudioDataVDR();
147
154
(-)vdrrip-0.3.0/queue.c (-4 / +10 lines)
Lines 54-63 Link Here
54
      Q[c].Rename       = atoi(strcol(buf, ";", 19));
54
      Q[c].Rename       = atoi(strcol(buf, ";", 19));
55
      // migrate from version 0.1.1
55
      // migrate from version 0.1.1
56
      char *cont        = strcol(buf, ";", 20);
56
      char *cont        = strcol(buf, ";", 20);
57
      cont ? Q[c].Container = cont : Q[c].Container = strdup("avi");
57
      cont   ? Q[c].Container = cont         : Q[c].Container = strdup("avi");
58
      // migrate from version 0.2.0a
58
      // migrate from version 0.2.0a
59
      char *prev        = strcol(buf, ";", 21);
59
      char *prev        = strcol(buf, ";", 21);
60
      prev ? Q[c].Preview = atoi(prev) : Q[c].Preview = 0;
60
      prev   ? Q[c].Preview   = atoi(prev)   : Q[c].Preview = 0;
61
      // migrate from version 0.3.0
62
      char *sb          = strcol(buf, ";", 22);
63
      sb     ? Q[c].StartByte = atoll(sb)     : Q[c].StartByte = 0;
64
      char *frames      = strcol(buf, ";", 23);
65
      frames ? Q[c].Frames    = atoi(frames) : Q[c].Frames = 0;
61
66
62
      FREE(buf);
67
      FREE(buf);
63
      c++;
68
      c++;
Lines 84-95 Link Here
84
  if (q) {
89
  if (q) {
85
    for (c = 0; c < NumMovies; c++) {
90
    for (c = 0; c < NumMovies; c++) {
86
      if (strcmp(Q[c].Name, "delete") != 0) {
91
      if (strcmp(Q[c].Name, "delete") != 0) {
87
        fprintf(q,"%s;%s;%i;%i;%s;%i;%i;%i;%i;%i;%i;%i;%i;%i;%s;%i;%i;%s;%i;%s;%i\n",
92
        fprintf(q,"%s;%s;%i;%i;%s;%i;%i;%i;%i;%i;%i;%i;%i;%i;%s;%i;%i;%s;%i;%s;%i;%lld;%i\n",
88
        Q[c].Dir, Q[c].Name, Q[c].FileSize, Q[c].FileNumbers, Q[c].VCodec,
93
        Q[c].Dir, Q[c].Name, Q[c].FileSize, Q[c].FileNumbers, Q[c].VCodec,
89
        Q[c].BitrateVideo, Q[c].MinQuant, Q[c].MaxQuant, Q[c].CropWidth,
94
        Q[c].BitrateVideo, Q[c].MinQuant, Q[c].MaxQuant, Q[c].CropWidth,
90
        Q[c].CropHeight, Q[c].CropPosX, Q[c].CropPosY, Q[c].ScaleWidth,
95
        Q[c].CropHeight, Q[c].CropPosX, Q[c].CropPosY, Q[c].ScaleWidth,
91
        Q[c].ScaleHeight, Q[c].ACodec, Q[c].BitrateAudio, Q[c].AudioID,
96
        Q[c].ScaleHeight, Q[c].ACodec, Q[c].BitrateAudio, Q[c].AudioID,
92
        Q[c].PPValues, Q[c].Rename, Q[c].Container, Q[c].Preview);
97
        Q[c].PPValues, Q[c].Rename, Q[c].Container, Q[c].Preview,
98
	Q[c].StartByte, Q[c].Frames);
93
	n++;
99
	n++;
94
      }
100
      }
95
    }
101
    }
(-)vdrrip-0.3.0/queue.h (+2 lines)
Lines 31-36 Link Here
31
  int Rename;
31
  int Rename;
32
  char *Container;
32
  char *Container;
33
  int Preview;
33
  int Preview;
34
  long long StartByte;
35
  int Frames;
34
};
36
};
35
37
36
class cQueue {
38
class cQueue {
(-)vdrrip-0.3.0/scripts/queuehandler.sh (-64 / +107 lines)
Lines 61-69 Link Here
61
# 26.03.2004: 0.3.0: - added evecho function                    #
61
# 26.03.2004: 0.3.0: - added evecho function                    #
62
#                    - added $mencoder_ac3 & $mplayer_ac3       #
62
#                    - added $mencoder_ac3 & $mplayer_ac3       #
63
#                    - added $qh_ver & qh_conf_ver              #
63
#                    - added $qh_ver & qh_conf_ver              #
64
# 23.04.2004: 0.3.1: - change to -dvd if the mencoder-version   #
65
#                      is 0.XX (thx to micmac@www.vdrportal.de) #
66
# 23.09.2007: 0.3.2: - sync to updated mplayer cmdline options  #
67
#                      -vop => -vf and filters are not applied  #
68
#                      in reverse order anymore                 #
64
#                                                               #
69
#                                                               #
65
#################################################################
70
#################################################################
66
qh_ver="0.3.0"
71
qh_ver="0.3.2"
67
72
68
73
69
function initialize () {
74
function initialize () {
Lines 72-78 Link Here
72
#
77
#
73
  
78
  
74
  scriptname=`basename $0`
79
  scriptname=`basename $0`
75
  scriptdir=`dirname $0`
80
  scriptdir=/etc/vdr/plugins/vdrrip
76
81
77
  cfgfile="$scriptname.conf"
82
  cfgfile="$scriptname.conf"
78
83
Lines 92-97 Link Here
92
    log_error "usage: $scriptname queuefile tempdir" 1
97
    log_error "usage: $scriptname queuefile tempdir" 1
93
  fi
98
  fi
94
99
100
  mkdir -p "$tempdir"
95
  if [ ! -d "$tempdir" ]
101
  if [ ! -d "$tempdir" ]
96
  then
102
  then
97
    log_error "directory $tempdir doesn't exist, aborting !" 1
103
    log_error "directory $tempdir doesn't exist, aborting !" 1
Lines 101-107 Link Here
101
107
102
  local pids=`pgrep -d" " "$scriptname"`
108
  local pids=`pgrep -d" " "$scriptname"`
103
  local pid1=`echo "$pids" | cut -d" " -f1`
109
  local pid1=`echo "$pids" | cut -d" " -f1`
104
  local pid2=`echo "$pids" | cut -d" " -f3`
110
  local pid2=`echo "$pids" | cut -d" " -f2`
105
111
106
  if [ "$pid1" != "$pid2" ]
112
  if [ "$pid1" != "$pid2" ]
107
  then
113
  then
Lines 135-141 Link Here
135
  IFS=";"
141
  IFS=";"
136
  read dir name filesize filenumbers vcodec br_video min_q max_q \
142
  read dir name filesize filenumbers vcodec br_video min_q max_q \
137
  crop_w crop_h crop_x crop_y scale_w scale_h acodec br_audio audio_id \
143
  crop_w crop_h crop_x crop_y scale_w scale_h acodec br_audio audio_id \
138
  ppvalues rename container preview < "$queuefile"
144
  ppvalues rename container preview sb frames < "$queuefile"
139
  IFS=$saveifs
145
  IFS=$saveifs
140
146
141
  # there is an active encoding
147
  # there is an active encoding
Lines 156-164 Link Here
156
  fi
162
  fi
157
163
158
  if [ "$ppvalues" = "(null)" ]; then ppvalues=""; fi
164
  if [ "$ppvalues" = "(null)" ]; then ppvalues=""; fi
159
165
  
160
  dvd=`echo "$dir" | grep "^dvd://"`
166
  dvd=`echo "$dir" | grep "^dvd://"`
161
167
    
162
  if [ "$preview" = "1" ]
168
  if [ "$preview" = "1" ]
163
  then
169
  then
164
    local mode="preview"
170
    local mode="preview"
Lines 214-219 Link Here
214
    mc=$mencoder
220
    mc=$mencoder
215
    mp=$mplayer
221
    mp=$mplayer
216
  fi
222
  fi
223
  
224
  # change the dvd-parameter to -dvd if the mencoder-version is 0.XX
225
  if [ "$dvd" ]
226
  then
227
    local menc_ver=`$mc -v 2>/dev/null | grep "MEncoder" | sed "s/^MEncoder \(.\).*/\1/"`
228
    if [ "$menc_ver" = "0" ]
229
    then
230
      dvd=`echo "$dvd" | sed "s/^dvd:\/\//-dvd /"`
231
    fi
232
    log_debug "dvd: $dvd"
233
  fi
217
234
218
  # check needed tools  
235
  # check needed tools  
219
  case "$container" in
236
  case "$container" in
Lines 302-311 Link Here
302
  name="$name(preview)"
319
  name="$name(preview)"
303
  shortname="$shortname(preview)"
320
  shortname="$shortname(preview)"
304
  
321
  
305
  # start the preview in the middle of the movie
322
  previewval="-sb $(($(du -b "$dir/001.vdr" | cut -f 1) >> 1)) -endpos $previewlength"
306
  local length=`"$mp" -identify -frames 0 "$dir/001.vdr" 2>/dev/null | grep ID_LENGTH | cut -d"=" -f2`
307
  let local ss=length/2
308
  previewval="-ss $ss -endpos $previewlength"
309
}
323
}
310
324
311
325
Lines 316-342 Link Here
316
  if [ "$error" ]; then return
330
  if [ "$error" ]; then return
317
  elif [ "$dvd" ]; then return; fi
331
  elif [ "$dvd" ]; then return; fi
318
332
333
  # Recreate $tempdir if removed by vdr housekeeping
334
  mkdir -p "$tempdir"
335
  if [ ! -d "$tempdir" ]; then return; fi
336
  cd "$tempdir"
337
319
  case "$container" in
338
  case "$container" in
320
    "avi")
339
    "avi")
321
      # join all vdr-files to $tempdir/temp.vdr
322
      if [ -e "$dir/002.vdr" -a "$preview" != "1" ]
340
      if [ -e "$dir/002.vdr" -a "$preview" != "1" ]
323
      then
341
      then
324
        log_info "joining all vdr-files from directory $dir"
342
        log_info "piping all vdr-files in $dir"
325
	evecho "joining vdr-files"
343
	evecho "piping all vdr-files"
326
        nice -+19 cat $dir/[0-9][0-9][0-9].vdr > "$tempdir/temp.vdr"
327
     else
328
	create_symbolic_link
329
      fi
344
      fi
330
      ;;
345
      ;;
331
    "ogm"|"matroska")
346
    "ogm"|"matroska")
332
      # demux vdr-recording with vdrsync
347
      # demux vdr-recording with vdrsync
333
      if [ "$preview" = "1" ]
348
      if [ "$preview" != "1" ]
334
      then
349
      then
335
        create_symbolic_link
336
      else
337
        log_info "demuxing all vdr-files from directory $dir"
350
        log_info "demuxing all vdr-files from directory $dir"
338
	evecho "demuxing vdr-files"
351
	evecho "demuxing vdr-files"
339
        execute "$vdrsync $dir -o $tempdir"
352
        execute "$vdrsync $dir -o $tempdir"
353
	# vdrsync 0.1.2.2 developer version creates bd.mpa
354
	if [ -e "$tempdir/bd.mpa" ]
355
	then
356
	  mv "$tempdir/bd.mpa" "$tempdir/bd.ac3"
357
	fi
340
      fi
358
      fi
341
      ;;
359
      ;;
342
    *)
360
    *)
Lines 345-369 Link Here
345
}
363
}
346
364
347
365
348
function create_symbolic_link() {
349
#
350
# creates a symbolic link of 001.vdr to $temdir/temp.vdr
351
#
352
  if [ "$error" ]; then return
353
  elif [ "$dvd" ]; then return; fi
354
355
  log_info "create a symbolic link from $dir/001.vdr to $tempdir/temp.vdr"
356
  ln -s "$dir/001.vdr" "$tempdir/temp.vdr"
357
358
  if [ ! -e "$tempdir/temp.vdr" ]
359
  then
360
    log_info "could not create a symolic link"
361
    log_info "try to copy $dir/001.vdr to $tempdir/temp.vdr"
362
    execute "cp $dir/001.vdr $tempdir/temp.vdr"
363
  fi
364
}
365
366
367
function check_exe () {
366
function check_exe () {
368
#
367
#
369
# checks if $1 is a executable and exit the queuehandler with
368
# checks if $1 is a executable and exit the queuehandler with
Lines 443-467 Link Here
443
      ;;
442
      ;;
444
  esac
443
  esac
445
444
446
  # set mencoder -vop values
445
  # handle interlacing passthrough request
446
  local mintopts=""
447
  local xintopts=""
448
  if [ "${ppvalues#codec_does_il}" != "$ppvalues" ]
449
  then
450
    local mintopts="ildct:ilme"
451
    local xintopts="interlacing"
452
    ppvalues = ${ppvalues:14}
453
  fi
454
455
  # set mencoder -vf values
447
  if [ "$crop_w" = "-1" -a "$crop_h" = "-1" -a "$crop_x" = "-1" -a \
456
  if [ "$crop_w" = "-1" -a "$crop_h" = "-1" -a "$crop_x" = "-1" -a \
448
       "$crop_y" = "-1" -a "$scale_w" = "-1" -a "$scale_h" = "-1" ]
457
       "$crop_y" = "-1" -a "$scale_w" = "-1" -a "$scale_h" = "-1" ]
449
  then
458
  then
450
    local vopopts=""
459
    local vfopts=""
451
  elif [ "$crop_w" = "-1" -a "$crop_h" = "-1" -a "$crop_x" = "-1" -a \
460
  elif [ "$crop_w" = "-1" -a "$crop_h" = "-1" -a "$crop_x" = "-1" -a \
452
         "$crop_y" = "-1" ]
461
         "$crop_y" = "-1" ]
453
  then
462
  then
454
    local vopopts="scale=$scale_w:$scale_h"
463
    local vfopts="scale=$scale_w:$scale_h"
455
  else
464
  else
456
    local vopopts="scale=$scale_w:$scale_h,crop=$crop_w:$crop_h:$crop_x:$crop_y"
465
    local vfopts="crop=$crop_w:$crop_h:$crop_x:$crop_y,scale=$scale_w:$scale_h"
457
  fi
466
  fi
458
467
459
  if [ "$ppvalues" ]
468
  if [ "$ppvalues" ]
460
  then
469
  then
461
    local vopopts="-vop pp=$ppvalues,$vopopts"
470
    local vfopts="-vf pp=$ppvalues,$vfopts"
462
  elif [ "$vopopts" ]
471
  elif [ "$vfopts" ]
463
  then
472
  then
464
    local vopopts="-vop $vopopts"
473
    local vfopts="-vf $vfopts"
465
  fi
474
  fi
466
475
467
  # encode in two passes 
476
  # encode in two passes 
Lines 470-489 Link Here
470
    if [ "$pass" = "1" ]
479
    if [ "$pass" = "1" ]
471
    then
480
    then
472
      local ofile="-o /dev/null"
481
      local ofile="-o /dev/null"
482
      local mturbo=":turbo"
483
      local xturbo=":turbo"
473
    else
484
    else
474
      local ofile="-o $tempdir/$name.avi"
485
      local ofile="-o $tempdir/$name.avi"
486
      if [ "$useropts_lavc" ]; then
487
	log_info "\$useropts_lavc are set to \"$useropts_lavc\""
488
	mturbo="$mturbo:$useropts_lavc"
489
      fi
490
      if [ "$mintopts" ]; then
491
	log_info "Encoding an interlaced stream with \"$mintopts\""
492
	mturbo="$mturbo:$mintopts"
493
      fi
494
      if [ "$useropts_xvid" ]; then
495
	log_info "\$useropts_xvid are set to \"$useropts_xvid\""
496
	xturbo="$xturbo:$useropts_xvid"
497
      fi
498
      if [ "$xintopts" ]; then
499
	log_info "Encoding an interlaced stream with \"$xintopts\""
500
	xturbo="$xturbo:$xintopts"
501
      fi
475
    fi
502
    fi
476
503
477
    # set mencoder video values
504
    # set mencoder video values
478
    case "$vcodec" in
505
    case "$vcodec" in
479
      "lavc")
506
      "lavc")
480
        local vopts="-ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=$br_video:vqmin=$min_q:vqmax=$max_q:vpass=$pass -sws 2"
507
        local vopts="-ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=$br_video:vqmin=$min_q:vqmax=$max_q:vpass=$pass$mturbo -sws 2"
481
        ;;
508
        ;;
482
      "xvid")
509
      "xvid")
483
        local vopts="-ovc xvid -xvidencopts bitrate=$br_video:me_quality=6:pass=$pass -sws 2"
510
        local vopts="-ovc xvid -xvidencopts bitrate=$br_video:me_quality=6:pass=$pass$xturbo -sws 2"
484
        ;;
485
      "divx4")
486
        local vopts="-ovc divx4 -divx4opts br=$br_video:q=5:min_quant=$min_q:max_quant=$max_q:pass=$pass -sws 2"
487
        ;;
511
        ;;
488
      *)
512
      *)
489
        log_error "unknown video codec $vcodec"
513
        log_error "unknown video codec $vcodec"
Lines 498-504 Link Here
498
    elif [ "$container" = "avi" -o "$preview" = "1" ]
522
    elif [ "$container" = "avi" -o "$preview" = "1" ]
499
    then
523
    then
500
      # no dvd, avi container
524
      # no dvd, avi container
501
      local ifile="$tempdir/temp.vdr"
525
      if [ -e "$dir/002.vdr" ]
526
      then
527
        local ifile="$tempdir/temp.vdr"
528
        rm -f "$ifile"
529
        mkfifo "$ifile"
530
        ( cat "$dir"/[0-9][0-9][0-9].vdr > "$ifile" & )
531
      else
532
        local ifile="$dir/001.vdr"
533
      fi
534
535
      # since the other containers use vdrsync, which handles vdr marks??
536
      # use the following only for this containertype
537
      if [ $frames -gt 0 ]; then local vopts="-frames $frames $vopts" ; fi
538
      if [ "$sb" != "-1" ]; then local vopts="-sb $sb $vopts" ; fi
502
    else
539
    else
503
      # no dvd, ogm/matroska container
540
      # no dvd, ogm/matroska container
504
541
Lines 511-521 Link Here
511
	  log_info "video-file $tempdir/e$num.mpv not found !"
548
	  log_info "video-file $tempdir/e$num.mpv not found !"
512
	  if [ $num -ge 9 ]
549
	  if [ $num -ge 9 ]
513
	  then
550
	  then
514
	      log_error "no video-stream found !"
551
            log_error "no video-stream found !"
515
              # exit loop
552
            # exit loop
516
              local ifile="dummy"
553
            local ifile="dummy"
517
	    fi
554
          fi
518
	    let num=num+1
555
          let num=num+1
519
        else	  
556
        else	  
520
	  log_info "video-file $tempdir/e$num.mpv found !"
557
	  log_info "video-file $tempdir/e$num.mpv found !"
521
          local ifile="$tempdir/e$num.mpv"
558
          local ifile="$tempdir/e$num.mpv"
Lines 536-542 Link Here
536
573
537
    evecho "enc. $encstr ($pass. pass)"
574
    evecho "enc. $encstr ($pass. pass)"
538
    if [ "$useropts" ]; then log_info "\$useropts are set to \"$useropts\""; fi
575
    if [ "$useropts" ]; then log_info "\$useropts are set to \"$useropts\""; fi
539
    execute "$mc $ifile $ofile $useropts $vopts $vopopts $aopts $previewval"
576
    execute "$mc $ifile $ofile $useropts $vopts $vfopts $aopts $previewval"
540
  done
577
  done
541
}
578
}
542
579
Lines 729-736 Link Here
729
    rm -f "$queuefile"
766
    rm -f "$queuefile"
730
  else
767
  else
731
    let lines=lines-1
768
    let lines=lines-1
732
    tail -n $lines "$queuefile" > /tmp/queuefile.tmp
769
    cp -a "$queuefile" /tmp/queuefile.tmp
733
    mv /tmp/queuefile.tmp $queuefile
770
    tail -n $lines /tmp/queuefile.tmp > "$queuefile"
734
  fi
771
  fi
735
772
736
  if [ "$error" ]
773
  if [ "$error" ]
Lines 784-789 Link Here
784
        # detect length of splitted file and add it to $splitpos
821
        # detect length of splitted file and add it to $splitpos
785
        local length=`$mplayer -identify -frames 0 $tempdir/$ofile 2>/dev/null | \
822
        local length=`$mplayer -identify -frames 0 $tempdir/$ofile 2>/dev/null | \
786
                      grep ID_LENGTH | cut -d= -f2`
823
                      grep ID_LENGTH | cut -d= -f2`
824
        # repeat command if failed first time
825
        if [ -z "$length" ]
826
        then
827
            length=`$mplayer -identify -frames 0 $tempdir/$ofile 2>/dev/null | \
828
                    grep ID_LENGTH | cut -d= -f2`
829
        fi
787
        let splitpos=splitpos+length-overlap
830
        let splitpos=splitpos+length-overlap
788
        let count=count+1
831
        let count=count+1
789
      done
832
      done
Lines 832-838 Link Here
832
#
875
#
833
# echo $1 on stderr and write it to the syslog with priority user.error
876
# echo $1 on stderr and write it to the syslog with priority user.error
834
#
877
#
835
  logger -s -p user.error -t [vdrrip-qh] "$1"
878
  logger -s -p user.error -t vdrrip-qh "$1"
836
879
837
  if [ "$2" ]
880
  if [ "$2" ]
838
  then
881
  then
Lines 848-854 Link Here
848
#
891
#
849
# echo $1 on stdout and write it to the syslog with priority user.info
892
# echo $1 on stdout and write it to the syslog with priority user.info
850
#
893
#
851
  logger -s -p user.info -t [vdrrip-qh] "$1" 2>&1
894
  logger -s -p user.info -t vdrrip-qh "$1" 2>&1
852
}
895
}
853
896
854
897
Lines 858-864 Link Here
858
#
901
#
859
  if [ "$debug" = "1" ]
902
  if [ "$debug" = "1" ]
860
  then
903
  then
861
    logger -s -p user.debug -t [vdrrip-qh] "$1"
904
    logger -s -p user.debug -t vdrrip-qh "$1"
862
  fi
905
  fi
863
}
906
}
864
907
Lines 874-883 Link Here
874
  # execute $cmd and save the return-code:
917
  # execute $cmd and save the return-code:
875
  if [ "$stdout" = "1" ]
918
  if [ "$stdout" = "1" ]
876
  then
919
  then
877
    nice -+19 $cmd 2>/tmp/queuehandler.err
920
    nice -n 19 $cmd 2>/tmp/queuehandler.err
878
    local rc="$?"
921
    local rc="$?"
879
  else
922
  else
880
    nice -+19 $cmd 1>/dev/null 2>/tmp/queuehandler.err
923
    nice -n 19 $cmd 1>/dev/null 2>/tmp/queuehandler.err
881
    local rc="$?"
924
    local rc="$?"
882
  fi
925
  fi
883
926
(-)vdrrip-0.3.0/scripts/queuehandler.sh.conf (-10 / +21 lines)
Lines 33-48 Link Here
33
33
34
  # this pathes are used for the encoding of vdr-recordings & dvd's.
34
  # this pathes are used for the encoding of vdr-recordings & dvd's.
35
  # they _must_ point to an unpatched mencoder & mplayer
35
  # they _must_ point to an unpatched mencoder & mplayer
36
  mencoder="/usr/local/bin/mencoder"
36
  mencoder="/usr/bin/mencoder"
37
  mplayer="/usr/local/bin/mplayer"
37
  mplayer="/usr/bin/mplayer"
38
38
39
  # this pathes are only used for encoding a vdr-recording with
39
  # this pathes are only used for encoding a vdr-recording with
40
  # selected ac3-stream.
40
  # selected ac3-stream.
41
  # they _must_ point to an ac3-patched mencoder & mplayer.
41
  # they _must_ point to an ac3-patched mencoder & mplayer.
42
  # if you don't use this feature you should deactivate the option
42
  # if you don't use this feature you should deactivate the option
43
  # AC3 Support (MPlayer-patch inst.) in the plugins setup-menu.
43
  # AC3 Support (MPlayer-patch inst.) in the plugins setup-menu.
44
  mencoder_ac3="/usr/local/bin/mencoder_ac3"
44
  mencoder_ac3="/usr/bin/mencoder"
45
  mplayer_ac3="/usr/local/bin/mplayer_ac3"
45
  mplayer_ac3="/usr/bin/mplayer"
46
46
47
47
48
  # this string is added to the mencoder-command in the
48
  # this string is added to the mencoder-command in the
Lines 52-62 Link Here
52
52
53
53
54
  # optional tools (only needed for ogm/matroska-container)
54
  # optional tools (only needed for ogm/matroska-container)
55
  vdrsync="/usr/local/bin/vdrsync.pl"
55
  vdrsync="/usr/bin/vdrsync.pl"
56
  ffmpeg="/usr/local/bin/ffmpeg"
56
  ffmpeg="/usr/bin/ffmpeg"
57
  ogmmerge="/usr/local/bin/ogmmerge"
57
  ogmmerge="/usr/bin/ogmmerge"
58
  ogmsplit="/usr/local/bin/ogmsplit"
58
  ogmsplit="/usr/bin/ogmsplit"
59
  mkvmerge="/usr/local/bin/mkvmerge"
59
  mkvmerge="/usr/bin/mkvmerge"
60
60
61
61
62
62
Lines 64-71 Link Here
64
  # from the queuehandler on your tv.
64
  # from the queuehandler on your tv.
65
  # You have to specify only $svdrpsend or $netcat.
65
  # You have to specify only $svdrpsend or $netcat.
66
  # $netcat is only recommend, if perl isn't installed.
66
  # $netcat is only recommend, if perl isn't installed.
67
  svdrpsend="/usr/local/bin/svdrpsend.pl"
67
  svdrpsend="/usr/bin/svdrpsend.pl"
68
  #netcat=""
68
  #netcat=""
69
69
70
  vdrhostname="localhost"
70
  vdrhostname="localhost"
71
71
72
  # These are the options beside the bitrate and eventually the 
73
  # interlace options passed to mencoder you can control the 
74
  # quality of the encoding by changing them here
75
76
  useropts_lavc=""
77
  # For a high quality high bitrate encoding use:
78
  #useropts_lavc="mbd=2:trell:cbp:mv0:cmp=3:subcmp=3"
79
  useropts_xvid=""
80
  # For a high quality high bitrate encoding use:
81
  #useropts_xvid="me_quality=6:vhq=1:notrellis:max_bframes=2"
82
(-)vdrrip-0.3.0/vdrrip.c (+8 lines)
Lines 132-144 Link Here
132
  if (access(MPlayer, X_OK) == -1) {
132
  if (access(MPlayer, X_OK) == -1) {
133
    char *s = NULL;
133
    char *s = NULL;
134
    asprintf(&s, "%s doesn't exist or isn't a executable !", MPlayer);
134
    asprintf(&s, "%s doesn't exist or isn't a executable !", MPlayer);
135
#if VDRVERSNUM >= 10307
136
    Skins.Message(mtError, s);
137
#else
135
    Interface->Error(s);
138
    Interface->Error(s);
139
#endif
136
    FREE(s);
140
    FREE(s);
137
    return NULL;
141
    return NULL;
138
  } else if (access(MEncoder, X_OK) == -1) {
142
  } else if (access(MEncoder, X_OK) == -1) {
139
    char *s = NULL;
143
    char *s = NULL;
140
    asprintf(&s, "%s doesn't exist or isn't a executable !", MEncoder);
144
    asprintf(&s, "%s doesn't exist or isn't a executable !", MEncoder);
145
#if VDRVERSNUM >= 10307
146
    Skins.Message(mtError, s);
147
#else
141
    Interface->Error(s);
148
    Interface->Error(s);
149
#endif
142
    FREE(s);
150
    FREE(s);
143
    return NULL;
151
    return NULL;
144
  } else return new cMenuVdrrip();
152
  } else return new cMenuVdrrip();
(-)vdrrip-0.3.0/vdrriprecordings.c (-1 / +1 lines)
Lines 10-16 Link Here
10
#include "vdrriprecordings.h"
10
#include "vdrriprecordings.h"
11
#include "a-tools.h"
11
#include "a-tools.h"
12
12
13
#define FINDRECCMD "find %s -follow -type d -regex '.*rec$'"
13
#define FINDRECCMD "find %s -follow -type d -regex '.*rec$' | sort"
14
14
15
// --- cVdrripRecordings -----------------------
15
// --- cVdrripRecordings -----------------------
16
16

Return to bug 193865