Compile from the code

Discuss about generic usage of MediaCoder.

Moderator: HuggiL

ojacques
Amateur
Amateur
Posts: 19
Joined: Wed Aug 09, 2006 6:48 am

Compile from the code

Post by ojacques » Tue Aug 22, 2006 6:06 am

Hi Stanley,

as I wanted to experience and help a bit, I wanted to compile mediacoder from the source.
First, I didn't found a solution (sln) that got all the projects.
Try to compile projects individually, I'm missing a "wmencode.h" file. What are the pre-requisites? Do we need to install anything like an SDK to get mc to compile?

Thanks again...
btw: I saw that you added vdr as a supported media file. Cool :)

ojacques
Amateur
Amateur
Posts: 19
Joined: Wed Aug 09, 2006 6:48 am

Post by ojacques » Sun Aug 27, 2006 4:27 pm

Hello Stanley,

from the latest svn [SVN 320], I still can't compile mediacoder. It seems that some files have not been checked in.

Code: Select all

wmconfig.cpp
c:\transfer\mediacoder.svn\mcgui\src\wmconfig.h(1) : fatal error C1083: Cannot open include file: 'wmencode.h': No such file or directory{/code]
Also, in mccore:
[code]c:\transfer\mediacoder.svn\mccore\src\preference.h(12) : fatal error C1083: Cannot open include file: 'xmlaccessor.h': No such file or directory
videoencoders.cpp
Thanks,
Olivier.

stanley
Site Admin
Site Admin
Posts: 4135
Joined: Mon May 15, 2006 7:43 pm
Location: Sydney

Post by stanley » Mon Aug 28, 2006 12:09 pm

wmencode.h is from Windows Media Encoder SDK. It's can be freely downloaded from M$'s website.
I'll be grateful if you can help to do some work.
When things work together, things work.

ojacques
Amateur
Amateur
Posts: 19
Joined: Wed Aug 09, 2006 6:48 am

Post by ojacques » Tue Aug 29, 2006 8:55 am

Ok, I got it to compile. Here is my first patch :)
Fixes:
- common.c: When retrieving saved item list (.m3u), strings parameters where not retrieved (this included disc-root).
- mediatools.cpp: Allow 5 seconds for the DVD drive to spin-off before while reading on mplayer's pipe. The previous setting was 20*50ms=1s and this was definitely not enough for my drive, thus preventing mc to retrieve media information like video width and height, thus preventing easy cropping. 5s might not be enough for all systems anyway...
- mencoderopts.cpp: -dvd-device as an mplayer/mencoder parameter is now in the form of "DISK:" and no more "DISK:\VIDEO_TS\". The format changed from an older mplayer version and needed to evolve. This removes the message about "libdvdcss" that cannot read the DVD (false warning anyway).

I can now add DVDs or DVD chapters in my transcoding list without problems and use the easy crop feature.
Not quite there yet, as my transcoding to PMP videos fails: wrong parameters are passed to lame (-s 48000 instead of -s 44100) which makes pmpmuxer to complain (it expects 44100). Forcing to 44100 is not enough: it goes through the pmpmuxer, but I get a slow-motion audio when playing... I'll look at that later this week...

On top of SVN 327:

Code: Select all

Index: common/common.c
===================================================================
--- common/common.c    (revision 327)
+++ common/common.c    (working copy)
@@ -122,7 +122,7 @@
             s = (char*)malloc(len + 1);
             memcpy(s, p, len);
             s[len] = 0;
-            *(char**)data = s;
+            *(char**)data[i] = s;
             } break;
         default:
             *(int*)data[i] = atoi(p);
Index: mccore/src/mediatools.cpp
===================================================================
--- mccore/src/mediatools.cpp    (revision 327)
+++ mccore/src/mediatools.cpp    (working copy)
@@ -157,7 +157,7 @@
             goto exit;
         }
     }
-    for (int i = 0; (!PeekNamedPipe(hPipeRead,0,0,0,&bytes,0) || bytes == 0) && i < 20; i++)
+    for (int i = 0; (!PeekNamedPipe(hPipeRead,0,0,0,&bytes,0) || bytes == 0) && i < 100; i++)
         Sleep(50);
     if (bytes == 0) {
         CloseHandle(hPipeRead);
Index: mccore/src/mencoderopts.cpp
===================================================================
--- mccore/src/mencoderopts.cpp    (revision 327)
+++ mccore/src/mencoderopts.cpp    (working copy)
@@ -321,7 +321,11 @@
     if (mcinst.startpos) str.AppendFormat(" -ss %d", mcinst.startpos / 1000);
 
     if (item && item->info.discroot) {
-        str.AppendFormat(" -dvd-device \"%s\"", item->info.discroot);
+        char *buf;
+        buf = strdup(item->info.discroot);
+        *strchr(buf, '\\') = '\0';
+        str.AppendFormat(" -dvd-device \"%s\"", buf);
+        free(buf);
     }
     if (item && item->info.chapter) {
         str.AppendFormat(" -chapter %d", item->info.chapter);


stanley
Site Admin
Site Admin
Posts: 4135
Joined: Mon May 15, 2006 7:43 pm
Location: Sydney

Post by stanley » Fri Sep 01, 2006 2:05 pm

Thanks for the patch! I'll test it.
When things work together, things work.

stanley
Site Admin
Site Admin
Posts: 4135
Joined: Mon May 15, 2006 7:43 pm
Location: Sydney

Post by stanley » Sat Sep 02, 2006 1:56 pm

I've applied the patch, except for the place where stripping "VIDEO_TS" string. In my place, with "VIDEO_TS" in -dvd-device just works.

PS: If you are finding more bugs and want MediaCoder's SVN write permission, just tell me. :wink:

EDIT: I've also checked in the missing VS solution file.
When things work together, things work.

ojacques
Amateur
Amateur
Posts: 19
Joined: Wed Aug 09, 2006 6:48 am

Post by ojacques » Sat Sep 02, 2006 4:44 pm

This video_ts thing look strange. I think that the behaviour changed between versions of mplayer... I will double check what version of mplayer I use and what version comes with mc. (I know I had to find a version that didn't crashed on me for my Athlonx XP)...

In any case, I'm ok with getting svn access :) My Sourceforge unix account: ojacques (already maintening 2 sourceforge projects: http://sipp.sf.net/ and http://gull.sf.net/).

Thanks!

stanley
Site Admin
Site Admin
Posts: 4135
Joined: Mon May 15, 2006 7:43 pm
Location: Sydney

Post by stanley » Sat Sep 02, 2006 8:48 pm

I've added you to the develop group. Finally I'm no longer alone. :lol:
When things work together, things work.

ojacques
Amateur
Amateur
Posts: 19
Joined: Wed Aug 09, 2006 6:48 am

Post by ojacques » Tue Sep 05, 2006 8:07 am

stanley wrote:I've applied the patch, except for the place where stripping "VIDEO_TS" string. In my place, with "VIDEO_TS" in -dvd-device just works.
Really? I mean for me, it "works", but in the console, I get error messages about libdvdread complaining. I think this has been reported by another user in this post: http://mediacoder.sourceforge.net/forum ... .php?t=545

Do you allow me to check that change on -dvd-device in?

ojacques
Amateur
Amateur
Posts: 19
Joined: Wed Aug 09, 2006 6:48 am

Post by ojacques » Tue Sep 05, 2006 8:28 am

stanley wrote:I've applied the patch, except for the place where stripping "VIDEO_TS" string. In my place, with "VIDEO_TS" in -dvd-device just works.
Really? I mean for me, it "works", but in the console, I get error messages about libdvdread complaining. I think this has been reported by another user in this post: http://mediacoder.sourceforge.net/forum ... .php?t=545

Do you allow me to check that change on -dvd-device in?

Also, in SVN 342, I increased mplayer dialogs (pipe reading) max timeouts to 10s. This fixed all dvd reading problems I had.

Still something I'd like to take care of: in PSP plugin, the framerate is always set to 29.97. This is wrong as PSP can support 23.976 and 25fps too.

Post Reply