Re: [PATCH] cleanup option handling export_mov
Stefan Scheffler <[email protected]> Sat, 27 Dec 2008 13:32:44 +0100
| Newsgroups | gmane.comp.video.transcode.devel |
|---|---|
| Message-ID | <[email protected]> |
Am Wed, 24 Dec 2008 10:59:36 +0100 schrieb Francesco Romani <[email protected]>: > On Tue, 2008-12-16 at 17:54 +0100, Stefan Scheffler wrote: > > > 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. > > CVS was pretty cold during last week (except for fixes), so this is is > surprising for me. > > Anyway, 1.1.0 final is scheduled for December the 29, if we can root > out the cause of troubles, it will be nice (I'll happily support and > take part of any effort on that, the only problem being quicktime > isn't my playfield) Otherwise, no big deal: fixes will be committed > in 1.1.1 > > Bests, > It was actually a problem with my libdvdcss. Upgrading that fixed it. No idea why it only crashed with quicktime files. I made a pretty stupid mistake in the precious patch. So much for not testing changes... The attached patch should work though. I successfully transcoded a jpeg quicktime file and also a couple of other files. stefan
import_mov_jyuv3.diff
(text/x-patch, 3.1 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 27 Dec 2008 12:08:30 -0000
@@ -226,29 +226,52 @@
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.");
+ }
+ quicktime_set_cmodel(qt_video, BC_YUVJ420P);
+
+ } else {
+ tc_log_error(MOD_NAME,"unable to handle colormodel. Try -V rgb24.");
+ return(TC_IMPORT_ERROR);
+ }
+ } else {
+ quicktime_set_cmodel(qt_video, BC_YUV420P);
+ }
- quicktime_set_cmodel(qt_video, BC_YUV420P); qt_cm = BC_YUV420P;
- break;
+ 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;