Re: [PATCH] cleanup option handling export_mov
Stefan Scheffler <[email protected]> Tue, 16 Dec 2008 17:54:52 +0100
| Newsgroups | gmane.comp.video.transcode.devel |
|---|---|
| Message-ID | <[email protected]> |
Am Mon, 15 Dec 2008 13:21:49 -0600 schrieb Carl Karsten <[email protected]>: > Stefan Scheffler wrote: > > Hi, > > > > this patch makes export_mov use optstr_get to parse meta data and > > extended/codecs options. The current parser is pretty ugly and > > doesn't handle non int values. > > > > When you gave me that patch, you also gave me: > > "this makes -y raw work" > > transcode/export/export_raw.c > > - srcfmt = IMG_YUV422P; > + srcfmt = IMG_UYVY; > > Should that get committed? > > Carl K No, that was just to verify someting. I had a fix for decoding jpeg quicktime files in yuv mode. Maybe that's the one you actually meant. I've attached a slightly cleaned up version. The module will automatically load the levels filter if it reads a file that can only be decoded into the YUVJ420P colormodel. The idea is taken from import_ffmpeg, but it's not actually used there. I hope that's not for a reason... I haven't actually tested the attached version, because tc fails to recognize a lot of quicktime files lately. For some reason tcprobe segfaults when it opens them with libdvdread to check for DVD. It's strange, I don't think I've had this problem before. stefan
import_mov_jyuv2.diff
(text/x-patch, 3 KB)
Index: import/import_mov.c
===================================================================
RCS file: /cvstc/transcode/import/import_mov.c,v
retrieving revision 1.20
diff -u -r1.20 import_mov.c
--- import/import_mov.c 14 Sep 2006 08:25:15 -0000 1.20
+++ import/import_mov.c 16 Dec 2008 16:34:06 -0000
@@ -226,29 +226,48 @@
break;
case CODEC_YUV:
- /* use raw mode when possible */
- /* not working ?*/
- /* if (strcmp(qt_codec, "yv12")) rawVideo=1; */
- /* allocate buffer for row pointers */
- row_ptr = tc_malloc(3*sizeof(char *));
- if(row_ptr==0) {
- tc_log_error(MOD_NAME,"can't alloc row pointers");
- return(TC_IMPORT_ERROR);
- }
+ /* use raw mode when possible */
+ /* not working ?*/
+ /* if (strcmp(qt_codec, "yv12")) rawVideo=1; */
+
+ /* allocate buffer for row pointers */
+ row_ptr = tc_malloc(3*sizeof(char *));
+ if(row_ptr==0) {
+ tc_log_error(MOD_NAME,"can't alloc row pointers");
+ return(TC_IMPORT_ERROR);
+ }
+
+ if (!quicktime_reads_cmodel(qt_video, BC_YUV420P, 0)) {
+ if (quicktime_reads_cmodel(qt_video, BC_YUVJ420P, 0)) {
+ /* stolen from import_ffmpeg */
+ /* load levels filter */
+ if (!tc_filter_add("levels", "output=16-240:pre=1")) {
+ tc_log_warn(MOD_NAME, "cannot load levels filter. Try -V rgb24.");
+ }
+ } else {
+ tc_log_error(MOD_NAME,"unable to handle colormodel. Try -V rgb24.");
+ return(TC_IMPORT_ERROR);
+ }
+ }
- quicktime_set_cmodel(qt_video, BC_YUV420P); qt_cm = BC_YUV420P;
- break;
+ quicktime_set_cmodel(qt_video, BC_YUV420P); qt_cm = BC_YUV420P;
+ break;
case CODEC_YUV422:
- /* allocate buffer for row pointers */
- row_ptr = tc_malloc(3*sizeof(char *));
- if(row_ptr==0) {
- tc_log_error(MOD_NAME,"can't alloc row pointers");
- return(TC_IMPORT_ERROR);
- }
+ /* allocate buffer for row pointers */
+ row_ptr = tc_malloc(3*sizeof(char *));
+ if(row_ptr==0) {
+ tc_log_error(MOD_NAME,"can't alloc row pointers");
+ return(TC_IMPORT_ERROR);
+ }
+
+ if (!quicktime_reads_cmodel(qt_video, BC_YUV422P, 0)) {
+ tc_log_error(MOD_NAME,"unable to handle colormodel. Try -V rgb24.");
+ return(TC_IMPORT_ERROR);
+ }
- quicktime_set_cmodel(qt_video, BC_YUV422P); qt_cm = BC_YUV422P;
- break;
+ quicktime_set_cmodel(qt_video, BC_YUV422P); qt_cm = BC_YUV422P;
+ break;
case CODEC_YUY2:
quicktime_set_cmodel(qt_video, BC_YUV422); qt_cm = BC_YUV422;