View Full Version : Demuxing/Encoding .pmf (PSP) video files
Cyber Akuma
14-08-2006, 23:43
Now, I know these are Linux tools, but im using Windows 2000. Also, this is my first time using mplayer and mencoder (normally I use vdub mod).
Ok, this one is driving me crazy, im trying to encode the intro of a PSP game, I got the video file off the disk but I am having trouble converting it.
It appears to be a h264 video stream and an (by my best guess) ATRAC3 audio stream (AAAARRRGGGHHH) muxed within some type of modified mpeg-2 container.
Using mplayer I was able to attempt to dump the video data successfully, problem is it was dumped as a raw h264 stream. I have tried my best to mess around with mencoder and try to put it in an avi container, but while it works if I use raw output or re-encode, it dosent work if I just attempt to put the raw stream into an AVI container. The original h264 quality is already pretty much perfect and the filesize is decent as well, how can I just put this stream into an avi container? I don't want to re-encode it.
As for the audio, I am COMPLETELY clueless. To be honest, im not even 100% sure if it is AC3, or if it is that its being extracted correctly. I have had problems like this before with the PS2's MPEG-2 format (.pss) where video streams werent a problem to extract but audio was a real pain. Regardless, nothing I tried seems to be able to play it or even analyze it, and mplayer crashes attempting to play the muxed version, but has no trouble palying the video if I extract it, audio it can't even touch however.
Joe Forster/STA
15-08-2006, 07:13
If you managed to play it with MPlayer then contact me. I already made up a small batch file that, when given the correct command line parameters, converts any video (that MPlayer can play) into an XviD+MP3 codec AVI, with MEncoder's help. ;)
Cyber Akuma
15-08-2006, 17:11
Err, I already said that I have no problem re-encoding it into a playable AVI, but that would lead to quality loss, the video is already h264 and very high quality for a small file, I dont want to re-encode it.
Joe Forster/STA
16-08-2006, 04:38
Then you can use the "-ovc copy" option of MEncoder to keep the video stream as is.
Cyber Akuma
16-08-2006, 16:49
I tried that
"mencoder.exe raw.264 -of avi -ovc copy -noskip -ofps 29.97"
The resulting AVI is unplayable in just about everything but mplayer.
Joe Forster/STA
16-08-2006, 17:04
Can you send me a sample (at most, a few Megabytes) in a (zipped!) E-mail attachment?
Cyber Akuma
17-08-2006, 02:03
Of what? The original, the raw extracted 264 stream, or the avi?
And how will I only rar a few kb of it? Copy and paste with a hex editor?
Joe Forster/STA
17-08-2006, 04:09
A sample of the original stream that you wanted to convert with MEncoder (but the result was not playable on most media players, as you wrote). Yeah, I guess, a copy & paste of the first, say, 2 Megabytes would be fine. (Hopefully, it's streamable: it's not a problem if it's end is missing, unlike e.g. AVI's!) Make sure that the sample is also playable with MPlayer! ;)
Joe Forster/STA
19-08-2006, 17:32
I used the following command line to re-package the raw H.264 stream, you sent, into an AVI container:
<path>\mencoder -of avi -ovc copy -o copyrawxclip.avi copyrawxclip.264
And then I manually edited the resulting AVI in a hexa editor because it had a weird FourCC. At offset 0x0070, the bytes 0x05 0x00 0x00 0x10 were changed to the string "h264"; at offset 0x00BC, the same four bytes were changed to "H264".
I didn't find a properly working general Video for Windows or DirectShow filter (video codec) for H.264 streams:
- The download at http://www.free-codecs.com/x264_Video_Codec_download.htm is not a codec, rather the the encoder software.
- The latest ffdshow at http://ffdshow.sourceforge.net/tikiwiki/tiki-index.php?page=Getting+ffdshow simply doesn't work for this media type.
So I tried VLC player 0.8.5 (see a download at http://www.versiontracker.com/dyn/moreinfo/win/27193 ), with its built-in H.264 decoder; the AVI sample played fine. I hope this helps!
[Edit] Ohhh, as for AC3 streams:
- Get the WinAMP AC3 input plugin from http://winampac3.sourceforge.net to be able to play AC3 audio (and check if a particular file is indeed in AC3 format).
- Get BeSweet from http://dspguru.doom9.net to convert among all kinds of audio formats: WAV, MP3, AC3, OGG, DTS. If you like, I can give you batch files that help with converting any audio format (that BeSweet can handle as input) to WAV, MP3, AC3 or OGG format.
Cyber Akuma
20-08-2006, 00:05
Hmm, well, first of all I needed to add two more switches to mencoder, "-noski"p and "-ofps 29.97"
Without -noskip I just get a useless 4k junk file.
I had tried using the FourCC changer included with the Xvid codec to change it before I had posted this problem here, but it didnt work.
So, I tried what you said about manually editing it with a hex editor.
It still would not play in MPC (yes, I can play other h264 video in it) but worked in VLC. Id really want this file to be playable in just about anything that supports AVI and the h264 codec, which is just about every player I know of except for WMP, so I can't have an AVI file that only works in VLC, since the file is likely still slightly corrupt.
Also, the file was filled with instances of this text "[= MPlayer junk data! =]", any idea why that is there?
Ill look into that plugin and program for converting the audio.
Joe Forster/STA
20-08-2006, 02:27
As for the need for those extra two command line options, perhaps, you're using a different version of MEncoder than I do. I'm using version "dev-CVS-050928-16:38-3.4.2" (the 1.0 pre8 release).
I do rip DVD's myself but I always use the XviD codec. I have no idea about where an official, usable H.264 codec exists for Windows, if at all. (Do you know a definitive download location for such a codec?!) If there's no such package, it shouldn't be a surprise that you can't play H.264 video in any media player, only ones that explicitly support it, with some custom DLL of their own... :(
Don't mind the junk data; yes, MPlayer adds that to the unused parts of the header, but that's just garbage, it's not there instead of anything useful!
Cyber Akuma
20-08-2006, 09:28
I do rip DVD's myself but I always use the XviD codec. I have no idea about where an official, usable H.264 codec exists for Windows, if at all. (Do you know a definitive download location for such a codec?!) If there's no such package, it shouldn't be a surprise that you can't play H.264 video in any media player, only ones that explicitly support it, with some custom DLL of their own... :(
Theres two ways.
You can use FFdshow, it sorta is an all in one codec, but its not a codec pack. But ill admit that it's decoder isnt that great, itll do the job. FFdshow is actually integrated into VLC, thats what VLC uses to decode video.
You can also get the CoreAVC codec, but it recnetly went pay, its pretty much the best one though.
Im sure theres others that can decode h264 video, but ive never tried them, I heard quicktime installs one too but im not about to install quicktime on my system to try it.
I have had no trouble playing h264 video in MPC before..... other than the fact that my crappy old pentium 3 CPU can barely handle it if its too high bitrate/resolution XD
As for my mencoder version, this is what I got when I ran it:
MEncoder 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team
Joe Forster/STA
20-08-2006, 09:32
As I wrote above, the latest ffdshow doesn't play this video. (Or it could play it if it was registered itself to the "H264" FourCC?!)
Cyber Akuma
20-08-2006, 10:18
As I wrote above, the latest ffdshow doesn't play this video. (Or it could play it if it was registered itself to the "H264" FourCC?!)
FFDshow is what VLC uses, so if VLC can play it, then FFdshow cant, its MPC thats unable to read the AVI file correctly. I can play other .avi and .mp4 files encoded with a h264 video stream fine in MPC.
Hmm, strange. FFdshow's homepage hasent been updated since 2004, but there are websites on the net that have a version that was released on September 3, 2006.
Anyway, I am certain that ffdshow has a h264 decoder, ive seen it. I dont know why this file isn't playing in MPC but I doubt its an h264 codec issue. Every other player that isnt VLC or mplayer was unable to play this file either, it didnt create a correctly formatted AVI, vlc just manages to ignore the errors.
Joe Forster/STA
20-08-2006, 11:54
Again, no matter if any codec can decode H.26 video streams if that codec is not registered onto the "H264" FourCC in the Windows registry! I think this is one of the major problems why you can't play the video with any media player: it tries to open the file, with the help of the registered codec, but finds none, so it displays "unknown format" or similar and gives up. However, if a media player - notably MPlayer - uses its own database or codec registration system then it may be able to find the correct decoder for such streams...
As for ffdshow, the link I wrote above does give you a quite recent download, even if the main page, http://sourceforge.net/projects/ffdshow/ , is damn old, for some weird reason... (Erm, 2006 September? Do those web pages come from the future?! ;))
Cyber Akuma
20-08-2006, 14:33
As for ffdshow, the link I wrote above does give you a quite recent download, even if the main page, http://sourceforge.net/projects/ffdshow/ , is damn old, for some weird reason... (Erm, 2006 September? Do those web pages come from the future?! ;))
Fairly sure it does register as a h264 decoder.
Sorry, I meant August.
http://www.afterdawn.com/software/video_software/codecs_and_filters/ffdshow.cfm
http://www.free-codecs.com/download/FFDShow.htm
Thats just two of them, that version was all over google when I searched for ffdshow.
noirelion
18-05-2007, 17:52
My question is- why do people use these bizarre file formats for audio and video? I mean -for crying out loud- convert it for us- you know we are leeching script kiddies!
Cyber Akuma
18-05-2007, 18:15
Umm..... thats the format that the game itself uses......
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.