Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 6th July 2005, 22:20   #1  |  Link
Zak Kingston
Registered User
 
Join Date: Jun 2005
Posts: 20
x264-MP4 that is playable in Quicktime 7, completely via CLI!

Hi there,

In many threads of this forum I've read about creating mp4-files with x264 that are playable in Quicktime 7. Some guys seem to have found a solution already, but I've never seen a complete "workflow". So, I'd like to publish mine. It works entirely via Windows command-line. Basic video is a dv-avi.

What is needed:

-x264.exe (I've used the latest build 270)
-faac.exe for the sound (version 1.24.1)
-avi2wavcmd.exe (to create an intermediate wav-file)
-mp4creator.exe (to mux, version 1.2.8)
-avisynth (for x264 input)

What to do:

1. Prepare an avs-file as our input with the following code:

Code:
avisource("c:\INPUTFILE.avi")
ConvertToYV12()
2. Create a batch file with these parameters:

Code:
avi2wavcmd c:\INPUTFILE.avi c:\sound_temp.wav

faac -q 75 -c 32000 --mpeg-vers 4 -o c:\sound_done.aac c:\sound_temp.wav

x264.exe -q 30 --bitrate 650 -I 250 -i 25 --bframes 0 --no-b-adapt -r 5 -w --analyse all --subme 6 --no-psnr --progress --fps 25 -o "c:\raw.264" "c:\INPUTSCRIPT.avs" 720x576

mp4creator -c c:\raw.264 -rate=25 c:\h264.mp4
mp4creator -c c:\sound_done.aac -aac-profile=4 -hint -interleave c:\h264.mp4
mp4creator -optimize c:\h264.mp4
mp4creator -list c:\h264.mp4
That's it. Unfortunately due to the lack of money I couldn't test it on a Mac - maybe you can?

Bugs:

- Hinting doesn't work yet (If I do so, mp4creator produces a huge and worthless file)
- I can't mux with mp4box, if I try it always says "h264-file is truncated"

I hope you have some suggestions for me!
Zak Kingston is offline   Reply With Quote
Old 6th July 2005, 23:27   #2  |  Link
DeeGee
Registered User
 
DeeGee's Avatar
 
Join Date: May 2004
Location: Finland
Posts: 102
Hmm... I myself would do things little bit different, but basically I need AAC-audio (non HE), and H.264 with no b-frames, no psnr, no 8x8dct and no adaptive b-frame desicion?

[edit] And what's with the raw outputs? At least x264 can output nice .mp4 which should work with mp4box just fine (although raw h.264 should too).
DeeGee is offline   Reply With Quote
Old 6th July 2005, 23:30   #3  |  Link
Sirber
retired developer
 
Sirber's Avatar
 
Join Date: Oct 2002
Location: Canada
Posts: 8,978
Could you explain more what avi2wavcmd does?
__________________
Detritus Software
Sirber is offline   Reply With Quote
Old 6th July 2005, 23:42   #4  |  Link
DeeGee
Registered User
 
DeeGee's Avatar
 
Join Date: May 2004
Location: Finland
Posts: 102
Seems like program to extract the audio. I'd myself use mplayer as i have it already installed with "mplayer -ao pcm -vo null input.avi".
DeeGee is offline   Reply With Quote
Old 7th July 2005, 09:24   #5  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,226
Urgh....

If you're interested, I've just finished creating a whole (preliminary) web site full of TV commercials for use with QuickTime7 player. All have been generated in X264 (no B-VOP etc, etc) with AAC-HE audio. They've even be re-muxed from .MP4 to .MOV, so they can stream better for people with 512Kbps ISP connections or higher...

Here, please, see what you think: -

http://www.stuartgraham.homechoice.co.uk/


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 7th July 2005, 09:34   #6  |  Link
madoka
Registered User
 
madoka's Avatar
 
Join Date: Feb 2002
Location: Syracuse, NY
Posts: 179
This is what I use:
Code:
x264 -r 5 -A p8x8,b8x8,i4x4 -w --me umh -m 6
B-frames will work only if the clip is short (~2000 frames or so). I'm guessing that's a bug. Also, for some reason the mp4 output from x264 won't play unless I re-mux it with mp4box.

For AAC audio, I just use iTunes. QT7 doesn't seem to support mp3-in-mp4. Moreover, it'll bork if there are any unsupported streams in the mp4 (for example, TTXT), instead of just ignoring them.

Maybe the Mac version is more capable and less buggy...
__________________
When a man sits with a pretty girl for an hour, it seems like a minute. But let him sit on a hot stove for a minute--and itís longer than any hour. Thatís relativity.
-- Albert Einstein
madoka is offline   Reply With Quote
Old 7th July 2005, 10:27   #7  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
I wonder why ppl still use QT...
Sharktooth is offline   Reply With Quote
Old 7th July 2005, 11:31   #8  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,226
Quote:
Originally Posted by Sharktooth
I wonder why ppl still use QT...
For me, the choice is simple... The QuickTime player looks very slick and uncluttered when incorporated into web pages, the .MOV is very stream flexible, it's Win and Mac OS compatible, and it works very well indeed


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 7th July 2005, 12:07   #9  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
... and it's proprietary ...
Sharktooth is offline   Reply With Quote
Old 7th July 2005, 12:37   #10  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,226
Quote:
Originally Posted by Sharktooth
... and it's proprietary ...
If somebody else can create a web page compatible player that looks and works as well as QT7, I'll give it a try with pleasure


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 7th July 2005, 13:00   #11  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,641
Quote:
Originally Posted by SeeMoreDigital
If somebody else can create a web page compatible player that looks and works as well as QT7, I'll give it a try with pleasure
Since QT7 is not available on Linux, people have already come up with something better:
http://mplayerplug-in.sourceforge.net/

Mplayer works quite well on Windows and Mac OS X, so I'd imagine the piece of code
required to make a browser plugin for IE and Safari would not be a huge deal.
Of course, since mplayer lacks corporate support and MPEG4 licences, it would
not catch on among the ordinary people, but at least the tinkerers would have
decent video playback in their browsers.
nm is offline   Reply With Quote
Old 7th July 2005, 13:17   #12  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
Quote:
Originally Posted by SeeMoreDigital
If somebody else can create a web page compatible player that looks and works as well as QT7, I'll give it a try with pleasure


Cheers
VLC or Mplayer web plugin.
Sharktooth is offline   Reply With Quote
Old 7th July 2005, 13:31   #13  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,226
Quote:
Originally Posted by Sharktooth
VLC or Mplayer web plugin.
Do you know whether the VLC or Mplayer plug-ins display the video player in the same way as QuickTime ie: within the web page. Or do they launch a separate player?


Cheers
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |
SeeMoreDigital is offline   Reply With Quote
Old 7th July 2005, 14:05   #14  |  Link
nm
Registered User
 
Join Date: Mar 2005
Location: Finland
Posts: 2,641
Oh, I forgot the news about the Google Video Viewer (http://video.google.com/) based on VLC. It is designed to only work with the Google Video service, but Jon Johansen already hacked the player to work generally.
See http://www.pcworld.com/resource/arti...RSS,RSS,00.asp and Jon's page: http://www.nanocrew.net/?p=114 for more detail.

And yes, it displays the video within the browser window. I don't know about fullscreen capabilities though. At least the mplayer plug-in allows one to zoom the video to full screen which I think is great (although personally I prefer command line to browser plugins

Last edited by nm; 7th July 2005 at 14:11.
nm is offline   Reply With Quote
Old 7th July 2005, 23:57   #15  |  Link
Zak Kingston
Registered User
 
Join Date: Jun 2005
Posts: 20
well, well...just want to reply...

Quote:
Originally Posted by SeeMoreDigital
Urgh....
Is it so bad Your examples work quite well on my side.

But I'd like to know if you're able to produce an aac HE via command-line...and were you able to hint the files? And how did you put it into a .mov-container? So many questions

-avi2wav2cmd is indeed a tool that just extracts an uncompressed wav-file out of an avi. This step wouldn't be necessary if I'd know how to create an aac directly of an avi-sound...you know a solution?

- the x264 parameter -A p8x8,b8x8,i4x4 doesn't work on my side...it does well on Mac, but on PC the video is stuttering...same with using b-frames...but quality is still great, in my opinion

- I tried exporting an mp4 from x264 and mux it with mp4box...it worked, but the file is not playable in qt7, not even in vlc...
Zak Kingston is offline   Reply With Quote
Old 8th July 2005, 07:07   #16  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
Quote:
But I'd like to know if you're able to produce an aac HE via command-line.
how about BeSweet using the Nero DLLs?

Quote:
if I'd know how to create an aac directly of an avi-sound
how about besweet again?
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 8th July 2005, 13:08   #17  |  Link
Zak Kingston
Registered User
 
Join Date: Jun 2005
Posts: 20
No success with encoding via BeSweet...the aac-file was playable in Winamp, but not with QT...

And I wanted to avoid proprietary software like nero.

For straight avi-aac-converting in BeSweet I tried the VOBInput.dll, but it also didn't work...BeSweet just says that it cannot load the input file...but it should work with avi's shouldn't it?

But thanks anyway!
Zak Kingston is offline   Reply With Quote
Old 8th July 2005, 13:53   #18  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
it makes no sense to use he-aac when you aim at playing the file in qt, as qt cant decode the sbr part -> crappy quality
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 8th July 2005, 14:00   #19  |  Link
Doom9
clueless n00b
 
Join Date: Oct 2001
Location: somewhere over the rainbow
Posts: 10,579
Quote:
And I wanted to avoid proprietary software like nero.
Uh, and QT is open source or what? In many ways QT is a lot worse than what Nero offers.
__________________
For the web's most comprehensive collection of DVD backup guides go to www.doom9.org
Doom9 is offline   Reply With Quote
Old 8th July 2005, 16:26   #20  |  Link
Zak Kingston
Registered User
 
Join Date: Jun 2005
Posts: 20
Well, it's for the production part...if the published file is done using open source-soft, I'm satisfied. The player is the problem of the user. But the only spreaded player right now is Quicktime 7, and it will be even more in the future. So I have to take care to do the right settings that the file is playable in Quicktime.

I'd be glad, too, if one day everybody has VLC as the default player. But I'm afraid that won't happen so soon.

Sorry, I didn't know that QT isn't able to decode AAC HE.

Cheers!
Zak Kingston is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:43.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.