Opened 13 years ago

Closed 12 years ago

#3053 closed enhancement (wontfix)

Adds support for DirectShow filters for the frontend

Reported by: alannisota@… Owned by: Isaac Richards
Priority: minor Milestone: unknown
Component: mythtv Version: head
Severity: low Keywords: h264 directshow coreavc
Cc: Ticket locked: no

Description

This patch adds support for using directshow filters with mythfrontend. It currently only supports CoreAVC w/ H.264, but can be easily changed to support others as needed. We use CoreAVC because it is significantly faster than the h264 decoder in ffmpeg, it supports PAFF which ffmpleg doesn't, as well as MPAFF+PAFF streams. It has only been tested against myth HEAD but should compile against fixes as well.

The code is from mplayer's directshow filter loader, but has been modified to support CoreAVC which needed some tricks.

CoreAVC 0.0.4 through 1.2.0 are supported.

You will need to have a valid CoreAVCDecoder.ax CoreAVC is NOT free, and must be purchased from www.coreavc.com, and it is quite reasonably priced.

You will likely need a real Windows machine to install it, as I don't think the installation will work on Wine as of version 1.2.0

To use follow these instructions:

  1. Install the patch and run 'make && make install'
  2. Create $HOME/.mythtv/dshowcodecs and add this line:
         CoreAVCDecoder.ax:h264:0x09571a4b, 0xf1fe, 0x4c60, 0x97, 0x60, 0xde, 0x6d, 0x31, 0x0c, 0x7c, 0x31
    
    3 .Copy your CoreAVCDecoder.ax file from your windows installation to /usr/lib/win32/ (it can likely be found under C:\Program Files\CoreCodec?\CoreAVC Professional\
  3. Create your registry entries You now need to create a registry for the CoreAVC codec. for each of the following keys, locate them in windows, and then run:
         mythregistercodec -r $HOME/.mythtv/registry -k <key> -v <value>
    
    For example for the windows key:

HKEY_CURRENT_USER\Microsoft\Windows\CurrentVersion?\ProductID

You would enter something like:

    mythregistercodec -r $HOME/.mythtv/registry -k "HKEY_CURRENT_USER\\Microsoft\\Windows\\CurrentVersion\\ProductID' -v "55555-333-7777777-55555"

To find the keys in Windows, you can use 'regedit'.

  • For CoreAVC 1.2.0 you need:
         HKEY_LOCAL_MACHINE\Microsoft\Windows\CurrentVersion\ProductID
         HKEY_CURRENT_USER\Software\CoreCodec\CoreAVC Pro\Serial
    
  • For CoreAVC 1.0 and 1.1 you need:
         HKEY_CURRENT_USER\SOFTWARE\Licenturion GmbH\0000032D\Product Key
         HKEY_CURRENT_USER\SOFTWARE\Licenturion GmbH\0000032D\User ID
    
  1. Start up mythfrontend, and try to watch an h264 channel/recording and you should see something like:
    Decoder supports the following YUV formats: YUY2 IYUV YV12 I420 
    Decoder is capable of YUV output (flags 0x27)
    Found DirectShow filter (1440x1088)
    

NOTE: You can view the contents of the registry using:

mythregistercodec -r $HOME/.mythtv/registry -l

But there is currently no way to remove a single element. You would need to remove the registry file and regenerate it if you need to do this for some reason.

Attachments (6)

directshow-1.0.patch.gz (248.3 KB) - added by alannisota@… 13 years ago.
Version 1.0
directshow-1.1.patch.gz (246.9 KB) - added by alannisota@… 13 years ago.
Version 1.1 with several bug fixes
directshow-1.2.patch.bz2 (243.7 KB) - added by alannisota@… 13 years ago.
Version 1.2
directshow-1.3.patch.bz2 (206.6 KB) - added by alannisota@… 13 years ago.
Version 1.3
directshow-1.4.patch.bz2 (209.5 KB) - added by alannisota@… 13 years ago.
Version 1.4
coreavc.patch (13.8 KB) - added by stuartm 11 years ago.
Update Coreavc patch to compile against trunk

Download all attachments as: .zip

Change History (16)

Changed 13 years ago by alannisota@…

Attachment: directshow-1.0.patch.gz added

Version 1.0

comment:1 Changed 13 years ago by alannisota@…

There were several issues with 1.0, so here is 1.1. Adds support for multiple CPUs fixes mythregisterconfig to work properly fixes build to use myth configurations

Also, note that the registry is case-sensitive, (and there is a typo above) so the correct keys for CoreAVC 1.2 are:

     HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ProductID
     HKEY_CURRENT_USER\Software\CoreCodec\CoreAVC Pro\Serial

Changed 13 years ago by alannisota@…

Attachment: directshow-1.1.patch.gz added

Version 1.1 with several bug fixes

comment:2 Changed 13 years ago by anonymous

Compiled w/o problems, however I'm getting segfault when trying to watch h264 recording

2007-02-09 22:09:15.919 TV: Attempting to change from None to WatchingPreRecorded? [h264 @ 0xb72d9408]PAFF interlacing is not implemented 0: start_time: 3920.225 duration: 153.431 1: start_time: 3920.074 duration: 153.502 stream: start_time: 43556.373 duration: 1706.470 bitrate=5909 kb/s Trying DirectShow? Destroying filter! FindModule?: Module CoreAVCDecoder.ax request Trying native dll 'CoreAVCDecoder.ax' Failed to load module 'CoreAVCDecoder.ax'; error=0x00000002, Trying native dll '/usr/lib/win32/CoreAVCDecoder.ax' Dump of segment table

Name VSz Vaddr SzRaw? Fileadr *Reloc *Lineum #Reloc #Linum Char .text: b7000 00001000 00029800 00000400 32434550 00004f17 0000 0000 e2000060 .rsrc: 2000 000b8000 00001a00 00029c00 00000000 00000000 0000 0000 e0000020

.reloc: 0200 000ba000 00000200 0002b600 00000000 00000000 0000 0000 c0000040

Load addr is 10000000 (base 10000000), range ba200 Loading /usr/lib/win32/CoreAVCDecoder.ax at 10000000, range ba200 /usr/lib/win32/CoreAVCDecoder.ax: mmaping section .text at 0x10001000 off 400 size 29800/b7000 clearing 0x1002a800 - 0x1002b000 /usr/lib/win32/CoreAVCDecoder.ax: mmaping section .rsrc at 0x100b8000 off 29c00 size 1a00/2000 clearing 0x100b9a00 - 0x100ba000 /usr/lib/win32/CoreAVCDecoder.ax: mmaping section .reloc at 0x100ba000 off 2b600 size 200/200 Security directory ignored *EXPORT DATA* Module name is , 5 functions, 5 names

Ord RVA Addr Name

1 00004430 0x10004430 Configure 2 000809f0 0x100809f0 DllCanUnloadNow? 3 00080a70 0x10080a70 DllGetClassObject? 4 00001500 0x10001500 DllRegisterServer? 5 00001510 0x10001510 DllUnregisterServer?

Dumping imports list Loading imports for kernel32.dll.dll Microsoft style imports used tid:ab791bb0 External func kernel32.dll:LoadLibraryA tid:ab791bb0 External func kernel32.dll:GetProcAddress tid:ab791bb0 External func kernel32.dll:VirtualAlloc tid:ab791bb0 External func kernel32.dll:VirtualFree Loading imports for VERSION.dll.dll Microsoft style imports used tid:ab791bb0 External func VERSION.dll:GetFileVersionInfoA Loading imports for USER32.dll.dll Microsoft style imports used tid:ab791bb0 External func USER32.dll:GetWindowLongW Loading imports for GDI32.dll.dll Microsoft style imports used tid:ab791bb0 External func GDI32.dll:TextOutW Loading imports for ADVAPI32.dll.dll Microsoft style imports used tid:ab791bb0 External func ADVAPI32.dll:RegEnumKeyExW Loading imports for ole32.dll.dll Microsoft style imports used tid:ab791bb0 External func ole32.dll:CoTaskMemAlloc Loading imports for OLEAUT32.dll.dll Microsoft style imports used tid:ab791bb0 External func OLEAUT32.dll:417 Loaded module '/usr/lib/win32/CoreAVCDecoder.ax' at 0x10000000, (/usr/lib/win32/CoreAVCDecoder.ax,(nil)) - START (/usr/lib/win32/CoreAVCDecoder.ax,PROCESS_ATTACH,(nil)) - CALL (DllMain?) CallTo32(entryproc=0x100b8875,module=10000000,type=1,res=(nil)) Entering DllMain?(DLL_PROCESS_ATTACH) for /usr/lib/win32/CoreAVCDecoder.ax Segmentation fault

comment:3 Changed 13 years ago by alannisota@…

Here is version 1.2 It should fix the color issues some have reported (worked for me at least) It fixes support for CoreAVC 1.0 and 1.1 you can now use 'mythfrontend --verbose playback' to get (very) verbose logs in the case of a crash. Please send those to me or to the dev list It should build properly

Changed 13 years ago by alannisota@…

Attachment: directshow-1.2.patch.bz2 added

Version 1.2

comment:4 Changed 13 years ago by alannisota@…

Here is version 1.3 It resolves all issues reported on the mailing list, as well as just about all of the hacks. I don't know if devs are interested in including this code or not, but if so, it should be basically good to go. I didn't add any menu configuration, as the menus are complicated enough as-is, and the existance of the dshocodecs file is sufficient to enable its use, but I'll be happy to make any changes requested.

Changed 13 years ago by alannisota@…

Attachment: directshow-1.3.patch.bz2 added

Version 1.3

comment:5 Changed 13 years ago by alannisota@…

Adding version 1.4 It resyncs my latest patches against a more recent mplayer Also, it adds support for CoreAVC1.3.0 Using this patch with CoreAVC 1.3.0, PAFF streams should play correctly

NOTE: CoreAVC uses a different key than 1.2.0, so if you upgrade, you'll need to reset the following key to the correct value:

HKEY_CURRENT_USER\Software\CoreCodec\CoreAVC Pro\Serial

Changed 13 years ago by alannisota@…

Attachment: directshow-1.4.patch.bz2 added

Version 1.4

comment:6 Changed 12 years ago by Janne Grunau

Version: 0.20head

comment:7 Changed 12 years ago by adeffs.mythtv@…

with SVN 13551, # patch -Np0 <directshow-1.4.patch patching file libs/libmythtv/avformatdecoder.cpp Hunk #1 succeeded at 1 with fuzz 2. Hunk #2 FAILED at 40. Hunk #3 succeeded at 91 (offset 2 lines). Hunk #4 succeeded at 408 (offset 2 lines). Hunk #5 succeeded at 1109 (offset 5 lines). Hunk #6 succeeded at 1527 (offset 19 lines). Hunk #7 succeeded at 3320 (offset 48 lines). 1 out of 7 hunks FAILED -- saving rejects to file libs/libmythtv/avformatdecoder.cpp.rej

comment:8 Changed 12 years ago by frahm.markus@…

Hi, i cannot compile libdshowloader on an amd64 architecture. Is this not possible? I would like to have coreavc support to be able to see HDTV (H264) content. I get the following error: In file included from wine/winbase.h:5,

from win32.h:13, from driver.c:19:

wine/winnt.h:626:2: error: #error You need to define a CONTEXT for your CPU In file included from wine/winbase.h:5,

from win32.h:13, from driver.c:19:

wine/winnt.h:629: error: expected '=', ',', ';', 'asm' or 'attribute' before '*' token wine/winnt.h:755:2: error: #error You need to define DEFINE_REGS_ENTRYPOINT macros for your CPU wine/winnt.h:766:3: error: #error You must define GET_IP for this CPU wine/winnt.h:1022: error: expected specifier-qualifier-list before 'PCONTEXT' wine/winnt.h:1035: error: expected declaration specifiers or '...' before 'PCONTEXT' In file included from win32.h:13,

from driver.c:19:

wine/winbase.h:1342: error: expected declaration specifiers or '...' before 'CONTEXT' wine/winbase.h:1481: error: expected ';', ',' or ')' before '*' token make[2]: * [driver.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/media-tv/mythtv-0.20.1_p13783/work/mythtv-0.20.1/libs/libdshowloader' make[1]: * [sub-libdshowloader] Error 2 make[1]: Leaving directory `/var/tmp/portage/media-tv/mythtv-0.20.1_p13783/work/mythtv-0.20.1/libs' make: * [sub-libs] Error 2

comment:9 Changed 12 years ago by AlanNisota@…

I have created a project related to using CoreAVC in linux which should make it easier for me to update the code, add more documentation, and help people with issues than trying to deal with issues via the dev list and a ticket which no developers have any interest in.

The project is here: http://code.google.com/p/coreavc-for-linux/ And contains instructions on installation for MythTV. Both ia32 and x86_64 distros can be used with CoreAVC now too.

I can't close this ticket, but I will not post any further updates here.

comment:10 Changed 12 years ago by Janne Grunau

Resolution: wontfix
Status: newclosed

libavcodec supports since [14800] PAFF. coreavc is no loneger needed

Changed 11 years ago by stuartm

Attachment: coreavc.patch added

Update Coreavc patch to compile against trunk

Note: See TracTickets for help on using tickets.