chenyunecjtu / coreavc-for-linux

Automatically exported from code.google.com/p/coreavc-for-linux
GNU General Public License v2.0
0 stars 1 forks source link

Black with play Youtube's H264 files #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It can not work with Youtube's H264 Version MP4 file.  http://
www.youtubemp4.com/
newest one (1280x720p H.264) is ok.

Original issue reported on code.google.com by wan0...@gmail.com on 26 Nov 2008 at 6:36

GoogleCodeExporter commented 8 years ago
wan0eve,

May I know your...
1. mplayer version
2. coreavc-for-linux version
3. coreavc version
4. linux distribution you are using

I am having the same problem...
mplayer: r28344
coreavc-for-linux: r82
coreavc: 1.8.5
linux: ubuntu 8.10

Thank you.

Original comment by dhanar.a...@gmail.com on 3 Feb 2009 at 12:27

GoogleCodeExporter commented 8 years ago
I found the reasons for this problem. In DS_VideoDecoder.c, mp2vi->dwFlags 
must assigned to 2 for Youtube's H264 files. but other must be 4.

Original comment by wan0...@gmail.com on 22 Apr 2009 at 9:44

GoogleCodeExporter commented 8 years ago
wan0eve,

Nice :)

Could you post a patch for it?

Thank you.

Original comment by dhanar.a...@gmail.com on 22 Apr 2009 at 12:17

GoogleCodeExporter commented 8 years ago
Sorry, I can not provide the patch. The dwFlags need to get from the MP4 file 
header. So must patch to mplayer too.

Original comment by wan0...@gmail.com on 23 Apr 2009 at 8:58

GoogleCodeExporter commented 8 years ago
I see....

Anyway, I want to clarify one thing....

The DS_VideoDecoder.c that needs to be modified, is it in coreavc-for-linux 
source
code or in mplayer source code?

If you cannot provide the patch, could you post the modified DS_VideoDecoder.c 
here?
Maybe I can learn something from it :)

Thanks.

Original comment by dhanar.a...@gmail.com on 23 Apr 2009 at 9:12

GoogleCodeExporter commented 8 years ago
I have no idea about how coreavc-for-linux get the MP4 file header now. 
The dwFlags can be get by patched mplayer, but i do not know how to send it to  
dshowserver.

Original comment by wan0...@gmail.com on 24 Apr 2009 at 6:11

GoogleCodeExporter commented 8 years ago
Patch against r101 for dwFlags setting. I tested it with: 
mkv muxed eith NALU size 2 
mkv muxed with NALU size 4
mp4 muxed eith NALU size 4

Original comment by kjchmiel...@gmail.com on 6 Jan 2010 at 9:44

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the patch.  It all looks fine except for this part:
{{{
-  this->m_sOurType.subtype = MEDIATYPE_Video;
+  this->m_sOurType.subtype = MEDIASUBTYPE_H264;
}}}
The DS_VideoDecoder can't be H264 specific, since there is nothing about it that
limits it to coreAVC.
If you can add a check for H264 here, I'll apply the patch.
Alternatively, supply some test streams and I'll fix it up

Original comment by alannis...@gmail.com on 8 Jan 2010 at 2:14

GoogleCodeExporter commented 8 years ago
I made wrong assumption. Here's patch with checks (I think so). I'm not able to
provide samples right now, I'll try to do it later. 

Original comment by kjchmiel...@gmail.com on 9 Jan 2010 at 4:28

Attachments:

GoogleCodeExporter commented 8 years ago
Original r101 code sets proper mediasubtype. This check is not needed. I 
removed it.
Sorry for a mess.

Original comment by kjchmiel...@gmail.com on 9 Jan 2010 at 5:08

Attachments:

GoogleCodeExporter commented 8 years ago
I applied your latest patch in R102, as it appears correct, but it doesn't 
actually
let me play Youtube files.  I assume the mplayer demux is still not sending 
proper
info to CoreAVC.  If you have a configuration which works, I'd be interested in
adding it to the Wiki

Original comment by alannis...@gmail.com on 9 Jan 2010 at 6:13

GoogleCodeExporter commented 8 years ago
I can play attached video downloadad from youtube. MOV demuxer reports "nal 
length 
size 2". I also use attached patch for mplayer but nothing else. I just don't 
want 
type "-demuxer mov" on command line nor in config file, and with this patch 
format is 
auto-detected.
dshowserver is cross-compiled with mingw32 shipped with fedora core 12. I had 
to do 
tweaks in Makefile and some __MINGW32__ conditionals to get rid of compilation 
warnings. Full patch attached.
I also attach full diff for mplayer sources from svn r30118
I attach my mplayer config file.

codecs.conf coreserve section:

videocodec coreserve
  info "CoreAVC DShow H264 decoder"
  status working
  format 0x10000005
;  fourcc H264,h264 AVC1
  fourcc H264,h264 H264
  fourcc X264,x264
  fourcc avc1,AVC1 AVC1
  fourcc davc,DAVC
  fourcc VSSH
  driver dshowserver
  dll "CoreAVCDecoder.ax"
  guid 0x09571a4b, 0xf1fe, 0x4c60, 0x97, 0x60, 0xde, 0x6d, 0x31, 0x0c, 0x7c, 0x31
  out YV12,IYUV,I420,YUY2

mplayer output:

[krzysiek@mephik Youtube]$ mplayer -vc coreserve, -v video.mp4 
MPlayer SVN-r30118-4.4.2 (C) 2000-2009 MPlayer Team
CPU vendor name: GenuineIntel  max cpuid level: 2
CPU: Intel(R) Pentium(R) 4 CPU 2.53GHz (Family: 15, Model: 2, Stepping: 7)
extended cpuid-level: 4
Detected cache-line size is 64 bytes
Testing OS support for SSE... yes.
Tests of OS support for SSE passed.
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNowExt: 0 SSE: 1 SSE2: 1 SSSE3: 0
Compiled with runtime CPU detection.
get_path('codecs.conf') -> '/home/krzysiek/.mplayer/codecs.conf'
Reading /home/krzysiek/.mplayer/codecs.conf: 141 audio & 314 video codecs
Configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/mplayer --
mandir=/usr/share/man --confdir=/etc/mplayer --libdir=/usr/lib --
codecsdir=/usr/lib/codecs --target=i686-pc-linux-gnu --language=all --disable-
joystick --enable-largefiles --disable-lirc --enable-menu --enable-runtime-
cpudetection --enable-unrarexec --disable-dvdread-internal --disable-libdvdcss-
internal --disable-nemesi --disable-smb --disable-faac-lavc 
--disable-mp3lame-lavc --
enable-x264-lavc --disable-x264 --disable-libopencore_amrnb --disable-
libopencore_amrwb --disable-faad-internal --disable-mad 
--disable-tremor-internal --
disable-xmms --disable-bitmap-font --disable-directfb --disable-svga --disable-
termcap --with-fribidi-config=pkg-config fribidi --disable-arts --disable-esd --
disable-pulse --disable-jack --disable-openal --enable-mencoder --disable-dxr3 
--
disable-v4l2 --disable-dvb --disable-dvbhead --disable-tv --disable-live 
--disable-
gui --enable-real --realcodecsdir=/opt/real/RealPlayer/codecs --enable-win32dll 
--
win32codecsdir=/usr/lib/codecs --yasm=/usr/bin/yasm --enable-mp3lib 
--enable-mp3lame 
--disable-liba52 --enable-liba52-internal --enable-ass --disable-xvmc 
--disable-vdpau 
--disable-dga1 --disable-dga2 --disable-sdl
CommandLine: '-vc' 'coreserve,' '-v' 'video.mp4'
init_freetype
Using MMX (with tiny bit MMX2) Optimized OnScreenDisplay
get_path('fonts') -> '/home/krzysiek/.mplayer/fonts'
Using nanosleep() timing
get_path('input.conf') -> '/home/krzysiek/.mplayer/input.conf'
Can't open input config file /home/krzysiek/.mplayer/input.conf: No such file 
or 
directory
Parsing input config file /etc/mplayer/input.conf
Input config file /etc/mplayer/input.conf parsed: 90 binds
get_path('video.mp4.conf') -> '/home/krzysiek/.mplayer/video.mp4.conf'

Playing video.mp4.
get_path('sub/') -> '/home/krzysiek/.mplayer/sub/'
[file] File size is 9481024 bytes
STREAM: [file] video.mp4
STREAM: Description: File
STREAM: Author: Albeu
STREAM: Comment: based on the code from ??? (probably Arpi)
CACHE_PRE_INIT: 0 [0] 507904  pre:1677721  eof:0  
Cache fill:  6.05% (507904 bytes)   
LAVF_check: QuickTime/MPEG-4/Motion JPEG 2000 format
Checking for YUV4MPEG2
ASF_check: not ASF guid!
Checking for REAL
Checking for SMJPEG
SUB: opened iconv descriptor.
SUB: closed iconv descriptor.
Searching demuxer type for filename video.mp4 ext: .mp4
Checking for Nullsoft Streaming Video
Checking for MOV
ISO: File Type Major Brand: ISO/IEC 14496-1 (MPEG-4 system) v2
ISO: File Type Minor Version: 0
ISO: File Type Compatible Brand #0: isom
ISO: File Type Compatible Brand #1: avc1
ISO: File Type Compatible Brand #2: mp42
MOV: Movie header found!
MOV: Movie DATA found!
Quicktime/MOV file format detected.
MOV: Movie header (100 bytes): tscale=600  dur=99012
MOV: unknown chunk: iods 13
--------------
MOV: Track #0:
MOV:  Track header!
tkhd len=84 ver=0 flags=0x0 id=1 dur=99000 lay=0 vol=256
MOV:  Media stream!
MOV:   Media header!
MOV:   Handler header: /soun () C) 2007 Google Inc. v06.24.2007.
MOV: unknown handler class: 0x0 ()
MOV:   Media info!
MOV:    Sound header!
MOV: unknown chunk: dinf 28
MOV:    Sample info!
MOV:     Description list! (cnt:1)
MOV:      desc #0: mp4a  (59 bytes)
MOV:     Sample duration table! (1 blocks)
MOV:     Sample->Chunk mapping table!  (3 blocks) (ver:0,flags:0)
MOV:     Sample size table! (entries=7106 ss=0) (ver:0,flags:0)
MOV:     Chunk offset table! (339 chunks)
MOV track #0: 339 chunks, 7106 samples
pts=7276544  scale=44100  time=165.001
==> Found audio stream: 0
[mov] Audio stream found, -aid 0
Audio bits: 16  chans: 2  rate: 44100
MOV: Found MPEG4 audio Elementary Stream Descriptor atom (39)!
ESDS MPEG4 version: 0  flags: 0x000000
ESDS MPEG4 ES Descriptor (25Bytes):
 -> ESId: 0
 -> streamPriority: 0
ESDS MPEG4 Decoder Config Descriptor (17Bytes):
 -> objectTypeId: 64
 -> streamType: 0x15
 -> bufferSizeDB: 0x000288
 -> maxBitrate: 152.552kbit/s
 -> avgBitrate: 125.280kbit/s
ESDS MPEG4 Decoder Specific Descriptor (2Bytes)
ESDS MPEG4 Sync Layer Config Descriptor (1Bytes)
 -> predefined: 2
Fourcc: mp4a
--------------
MOV: Track #1:
MOV:  Track header!
tkhd len=84 ver=0 flags=0x0 id=2 dur=99012 lay=0 vol=0
MOV:  Media stream!
MOV:   Media header!
MOV:   Handler header: /vide () C) 2007 Google Inc. v06.24.2007.
MOV: unknown handler class: 0x0 ()
MOV:   Media info!
MOV:    Video header!
MOV: unknown chunk: dinf 28
MOV:    Sample info!
MOV:     Description list! (cnt:1)
MOV:      desc #0: avc1  (129 bytes)
MOV:     Sample duration table! (1 blocks)
MOV:     Syncing samples (keyframes) table! (66 entries) (ver:0,flags:0)
MOV:     Sample->Chunk mapping table!  (3 blocks) (ver:0,flags:0)
MOV:     Sample size table! (entries=3878 ss=0) (ver:0,flags:0)
MOV:     Chunk offset table! (353 chunks)
MOV track #1: 353 chunks, 3878 samples
pts=3878000  scale=23500  time=165.021
==> Found video stream: 1
[mov] Video stream found, -vid 1
MOV: AVC decoder configuration record atom (39)!
MOV: avcC version: 1
MOV: avcC profile: 66
MOV: avcC profile compatibility: 0
MOV: avcC level: 21
MOV: avcC nal length size: 2
MOV: avcC number of sequence param sets: 1
MOV: avcC sps 0 have length 15
MOV: avcC number of picture param sets: 1
MOV: avcC pps 0 have length 5
MOV: Found unknown movie atom btrt (20)!
Image size: 480 x 270 (24 bpp)
Display size: 480 x 270
Fourcc: avc1  Codec: ''
--------------
Quicktime Clip Info:
MOV: longest streams: A: #0 (7106 samples)  V: #1 (3878 samples)
VIDEO:  [avc1]  480x270  24bpp  23.500 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:7  fourcc:0x31637661  size:480x270  fps:23.500  ftime:=0.0426
get_path('sub/') -> '/home/krzysiek/.mplayer/sub/'
[gl] using extended formats. Use -vo gl:nomanyfmts if playback fails.
[gl] Using 0 as slice height (0 means image height).
X11 opening display: :0.0
vo: X11 color mask:  FFFFFF  (R:FF0000 G:FF00 B:FF)
vo: X11 running at 1280x1024 with depth 24 and 32 bpp (":0.0" => local display)
[x11] Detected wm supports NetWM.
[x11] Detected wm supports FULLSCREEN state.
[x11] Detected wm supports ABOVE state.
[x11] Detected wm supports BELOW state.
[x11] Current fstype setting honours FULLSCREEN ABOVE BELOW X atoms
==========================================================================
Forced video codec: coreserve
Opening video decoder: [dshowserver] DirectShowServer video codecs
dshowserver --codec CoreAVCDecoder.ax --size 480x270 --guid 09571a4b-f1fe-4c60-
9760de6d310c7c31 --fourc 0x31637661 --bits 12 --outfmt 0x32315659 --pid 742 
--id 
b76fe950 --numpages 10 --port 1244 &
Opening device (port is 1244)
len: 992
ProductVersion: 2.0.0
Decoder supports the following YUV formats: YUY2 UYVY YV12 I420 
Decoder is capable of YUV output (flags 0x2b)
Setting fmt
Starting
Initialization is complete
Using socket based mutex
VDec: vo config request - 480 x 270 (preferred colorspace: Packed YUY2)
[PP] Using codec's postprocessing, max q = 4.
Trying filter chain: vo
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO Config (480x270->480x270,flags=0,'MPlayer',0x32315659)
VO: [gl] 480x270 => 480x270 Planar YV12 
VO: Description: X11 (OpenGL)
VO: Author: Arpad Gereoffy <arpi@esp-team.scene.hu>
EINPROGRESS in connect() - selecting
Dshowserver Connected to host
[gl] GLX chose visual with ID 0x2f
[gl] Settings after autodetection: ati-hack = 0, force-pbo = 1, rectangle = 0
[gl] Creating 512x512 texture...
[gl] Resize: 480x270
Found DirectShow filterSelected video codec: [coreserve] vfm: dshowserver 
(CoreAVC 
DShow H264 decoder)
==========================================================================
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
dec_audio: Allocating 6144 bytes for input buffer.
dec_audio: Allocating 65536 + 65536 = 131072 bytes for output buffer.
FAAD: Decoder init done (0Bytes)!
FAAD: Negotiated samplerate: 44100Hz  channels: 2
FAAD: got 125kbit/s bitrate from MP4 header!
AUDIO: 44100 Hz, 2 ch, s16le, 125.3 kbit/8.88% (ratio: 15660->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
Building audio filter chain for 44100Hz/2ch/s16le -> 0Hz/0ch/??...
[libaf] Adding filter dummy 
[dummy] Was reinitialized: 44100Hz/2ch/s16le
[dummy] Was reinitialized: 44100Hz/2ch/s16le
Trying preferred audio driver 'oss', options '[none]'
ao2: 44100 Hz  2 chans  s16le
audio_setup: using '/dev/dsp' dsp device
audio_setup: using '/dev/mixer' mixer device
audio_setup: using 'pcm' mixer device
audio_setup: sample format: s16le (requested: s16le)
audio_setup: using 2 channels (requested: 2)
audio_setup: using 44100 Hz samplerate (requested: 44100)
audio_setup: frags:  32/32  (1884 bytes/frag)  free:  59392
AO: [oss] 44100Hz 2ch s16le (2 bytes per sample)
AO: Description: OSS/ioctl audio output
AO: Author: A'rpi
Building audio filter chain for 44100Hz/2ch/s16le -> 44100Hz/2ch/s16le...
[dummy] Was reinitialized: 44100Hz/2ch/s16le
[dummy] Was reinitialized: 44100Hz/2ch/s16le
Starting playback...
Increasing filtered audio buffer size from 0 to 62336
*** [vo] Allocating mp_image_t, 480x270x12bpp YUV planar, 194400 bytes
Unicode font: 5025 glyphs.
Unicode font: 5025 glyphs.
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: audio)  
ds_fill_buffer: EOF reached (stream: video)  
EOF code: 1  

Uninit audio filters...
[libaf] Removing filter dummy 
Uninit audio: faad
FAAD: Closing decoder!
Uninit video: dshowserver
************
in-frames: 3878 out-frames: 3878
************
Destroying filtervo: uninit ...

Exiting... (End of file)

Original comment by kjchmiel...@gmail.com on 9 Jan 2010 at 7:45

Attachments:

GoogleCodeExporter commented 8 years ago
I will not apply any patches to mplayer that modify the codecs or the order 
that they 
are applied.  The latter can generally be accomplished using codecs.conf.  The 
former 
is too much maintenance to support with the speed that mplayer code changes

Original comment by alannis...@gmail.com on 12 Mar 2010 at 4:21