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 2nd December 2005, 16:43   #1  |  Link
cast42
Registered User
 
Join Date: May 2005
Location: Belgium
Posts: 22
Atomchanger ini file for x264 avc ipod video movies

i tried to fix .mp4 after muxing with MP4Box.exe... Therefore I adapt the AtomAVC.ini file of this QT guide. This is my current .ini file (without succes so far) I'm trying:
[Config]
Title=Ipod MPEG-4 AVC
MQV=2
CODEC=2

[DeleteAtom]
Item0=ftyp
Item1=iods

[InsertAtom]
Item0=ftypM4V%20%00%00%00%01M4V%20M4A%20mp42isom
Item1=/moov/trak/edts%00%00%00%1celst%00%00%00%00%00%00%00%01%00%00%6F%c8%00%00%00%00%00%01%00%00

Atomchanger.exe refuses to execute the .ini file (no errors reported!) and hence my ipod video is not playing the video. Does somebody now what is the exact syntax and semantics of the atomchanger ini file ? (I do not read japonese...)
cast42 is offline   Reply With Quote
Old 2nd December 2005, 17:17   #2  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
Quote:
Originally Posted by cast42
i tried to fix .mp4 after muxing with MP4Box.exe
there is no need to "fix" the mp4 files created by mp4box, as they are not borken

does the ipod have problems with mp4 files other than those related to codec settings?

split from the qt thread, as this has nothing to do with qt
__________________
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

Last edited by bond; 2nd December 2005 at 17:20.
bond is offline   Reply With Quote
Old 2nd December 2005, 17:30   #3  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
ehhr.... atom changer is needed for PSP only.
Sharktooth is offline   Reply With Quote
Old 2nd December 2005, 21:18   #4  |  Link
cast42
Registered User
 
Join Date: May 2005
Location: Belgium
Posts: 22
Atomchanger needed for Ipod Video!

AVC video of 320x240 pixels, encoded with x264, muxed together with AAC audio using MP4Box.exe (as in Randall's guide) play succesfully with Quicktime player, Itunes, VLC or MPC. But they do not play on Ipod Video. (Itunes refuses to sync them on the Ipod video) The only way I got video on the Ipod was by exporting from Quicktime 7 Pro using "Ipod Video" setting. Therefore I was trying to adapt .mp4 files with Atomchanger so that they look similar as those produced by Quicktime's "export to Ipod". All help from the community is appreciated. Could somebody explain why the "iods" and "uuid" atoms are not removed by:
[DeleteAtom]
Item0=ftyp
Item1=iods
Item2=uuid

The script:
start /belownormal /b /w x264.exe --progress --bitrate 650 --analyse p8x8,b8x8,i4x4 --output video.264 video.avs
start /belownormal /b /w MP4Box.exe -add video.264 output.mp4
start /belownormal /b /w MP4Box.exe -add audio.mp4 output.mp4
start /belownormal /b /w ATOMChanger.exe output.mp4 output_for_ipod.m4v AtomAVCIpod.ini

The AtomAVCIpod.ini file:
[Config]
Title=Ipod MPEG-4 AVC
MQV=2
CODEC=2

[DeleteAtom]
Item0=ftyp
Item1=iods
Item2=uuid

[InsertAtom]
Item0=ftypM4V%20%00%00%00%01M4V%20M4A%20mp42isom
Item1=/moov/trak/edts%00%00%00%1celst%00%00%00%00%00%00%00%01%00%00%6F%c8%00%00%00%00%00%01%00%00

Thx
cast42 is offline   Reply With Quote
Old 3rd December 2005, 02:46   #5  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
cast42, search for sharktooths ipod x264 profile for megui before f*ing up the mp4 files...
__________________
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

Last edited by bond; 23rd August 2006 at 17:41.
bond is offline   Reply With Quote
Old 4th December 2005, 12:21   #6  |  Link
cast42
Registered User
 
Join Date: May 2005
Location: Belgium
Posts: 22
trying Ipod video with MeGui Ipod profile

Bond, thx for the advice!
I tried :
./x264 --bitrate 650 --no-cabac --analyse p8x8,b8x8 --qpmin 22 --me umh --progress --no-psnr --output video_ipod.mp4 video_ipod.avs

Encode starts from 25fps anamorphic 16:9 PAL with video_ipod.avs:
Code:
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
MPEG2Source("pal_video_720x576.d2v")
LanczosResize(320,180)
AddBorders(0,30,0,30)
The file video_ipod.mp4 does not appear on the Ipod video and does not play with Itunes or Quicktime 7. VLC and MPC do play the video without problems.

As far as I can see, the .mp4 files produced by x264 or MP4box comply to ISO/IEC 14496 - Part 12: ISO base media file format http://standards.iso.org/ittf/Public...12_2005(E).zip . All atoms are registered by http://www.mp4ra.org/ (that is operated by Apple )

I see that the level of QT export to ipod generated .mp4 is lower then default level by x264. I 'll experiment with --level parameter (but do not find Annex A for the moment)
cast42 is offline   Reply With Quote
Old 4th December 2005, 12:31   #7  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
Quote:
Originally Posted by cast42
I see that the level of QT export to ipod generated .mp4 is lower then default level by x264. I 'll experiment with --level parameter (but do not find Annex A for the moment)
interesting point!

you can find info about the levels here

edit: your height is not mod16...
__________________
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

Last edited by bond; 4th December 2005 at 12:33.
bond is offline   Reply With Quote
Old 4th December 2005, 14:22   #8  |  Link
cast42
Registered User
 
Join Date: May 2005
Location: Belgium
Posts: 22
--level 1.3 added, Ipod Video 5G refuses to play

I added --level 1.3:
./x264 --level 1.3 --bitrate 650 --no-cabac --analyse p8x8,b8x8 --qpmin 22 --me umh --progress --no-psnr --output video_ipod.mp4 video_ipod.avs

Size is QVGA 320x240, width 320 (0x0140)) is 20x16, height 240 (0x00f0) is 15x16.
In the resulting x264 video_ipod.mp4 file:
Code:
      type avc1
        reserved1 = <6 bytes> 00 00 00 00 00 00
        dataReferenceIndex = 1 (0x0001)
        reserved2 = <16 bytes> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
        width = 320 (0x0140)
        height = 240 (0x00f0)
        reserved3 = <14 bytes> 00 48 00 00 00 48 00 00 00 00 00 00 00 01
        compressorName =
        reserved4 = <4 bytes> 00 18 ff ff
        type avcC
         configurationVersion = 1 (0x01)
         AVCProfileIndication = 66 (0x42)
         profile_compatibility = 0 (0x00)
         AVCLevelIndication = 13 (0x0d)
which is now equal to the avc settings in QT Pro exported Ipod file.

Default x264 level is 40 (0x28). Hence --level 1.3 can be usefull.

But even with --level 1.3 QT plays no video, Itunes does not play nor sync to the video Ipod (5G). I fear will have to ressort to AtomChanger.
cast42 is offline   Reply With Quote
Old 4th December 2005, 14:43   #9  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
also try --nf and --analyse none
__________________
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 4th December 2005, 18:21   #10  |  Link
cast42
Registered User
 
Join Date: May 2005
Location: Belgium
Posts: 22
Got x264 encoded video sync to ipod video 5g

As suggested by bond, a video encoded with:
Code:
x264.exe --level 1.3 --bitrate 650 --no-cabac --analyse p8x8,b8x8 --qpmin 22 --me umh --progress --no-psnr --output "video.264" "video_ipod.avs" 
MP4Box.exe -add video.264 video_ipod.mp4
got synced to the ipod video 5G. Altough the video plays with QT, the ipod video screen stays black during play on the ipod.

I start playing with the option mentioned by bond
cast42 is offline   Reply With Quote
Old 4th December 2005, 18:26   #11  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
Quote:
Originally Posted by bond
also try --nf and --analyse none
you didnt use these options in your cmdl
__________________
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 4th December 2005, 18:26   #12  |  Link
cast42
Registered User
 
Join Date: May 2005
Location: Belgium
Posts: 22
nope, with "--nf" and "--analyse none" added to the x264 encoding options, the video got tranfered to the ipod 5g but the screen stays black during playing
cast42 is offline   Reply With Quote
Old 15th December 2005, 17:06   #13  |  Link
GregerG
Registered iPod User
 
Join Date: Dec 2005
Posts: 2
My working x264 commandline for ipod

Hi!

I have be following this thread as i wanted to encode my own videos for my Ipod. It took a while before a got a working commandline when using x264.

My first tests where done with the MeGUI, but I realized that MeGUI is not supporting some of the needed switches in x264 like, --level

Im using the lastest version of x264 build 385 which has support for AviSynth. I let the aviSynth script do the re-scaling down to 320x240

This is the line i used to encode:
x264.exe --bitrate 600 --no-cabac --analyse p8x8,b8x8 --qpmin 22 --vbv-bufsize 2000 --vbv-maxrate 768 --me umh --progress --no-psnr --level 1.3 --output temp_video.mp4 temp_avs.avs 320x240

Audio was encoded with BeSweet from the AVI to AAC like this:
BeSweet.exe -core( -input test.avi -output "temp_audio.mp4" -logfile "temp_audio.log" ) -bsn( -2ch -cbr 128 -codecquality_fast -aacprofile_lc ) -ota( -d 0 -g max )

Then everything was muxed togheter with MP4Box, adding the language (dont know if its needed).

MP4Box.exe -keepsys -add "temp_video.mp4:lang=eng" -add "temp_audio.mp4:lang=eng" temp_muxed.mp4

This worked fine and could be imported into iTunes and then transfered to my Ipod.
Good luck!
/G
GregerG is offline   Reply With Quote
Old 15th December 2005, 21:34   #14  |  Link
cast42
Registered User
 
Join Date: May 2005
Location: Belgium
Posts: 22
Ipod G5 thinks its an audio file, version MP4box ?

Waw, thanks for sharing this. Last profile of MeGUI do include level 1.3. I tried your settings, but I had less success. I tried:
Code:
x264.exe --bitrate 600 --no-cabac --analyse p8x8,b8x8 --qpmin 22 --vbv-bufsize 2000 --vbv-maxrate 768 --me umh
 --progress --no-psnr --level 1.3 --output temp_video.mp4 source_320x240.avs 320x240

MP4Box.exe -keepsys -add "temp_video.mp4:lang=eng" -add "audio48.mp4:lang:eng" "movie.mp4"
IsoMedia import - track ID 1 - Video (size 320 x 240)
IsoMedia import - track ID 1 - Audio (SR 48000 - 2 channels)
Saving to movie.mp4: 0.500 secs Interleaving
x264 : x264 core:42 svn-387
MP4box: MP4Box - GPAC version 0.4.1-DEV
Audio: exported from audio.wav with QT Pro 7 to MPEG-4 Audio ACC-LC 48Khz 128 Kbps

The file plays with Quictime 7, MPC and iTunes, syncs to the Ipod but only audio is heard, no video is played.

What version of MP4Box do you recommend ? Or is the mp4 file from besweet essential for a good final result?
cast42 is offline   Reply With Quote
Old 15th December 2005, 22:33   #15  |  Link
cast42
Registered User
 
Join Date: May 2005
Location: Belgium
Posts: 22
Also with Besweet audio mp4, Ipod thinks its an audio file

The following bat file:
Code:
start /belownormal /b /w  x264.exe --bitrate 600 --no-cabac --analyse p8x8,b8x8 --qpmin 22 --vbv-bufsize 2000 --vbv-maxrate 768 --me umh --progress --no-psnr --level 1.3 --output temp_video.mp4 source_320x240.avs 320x240
start /belownormal /b /w  "C:/Program Files/BeSweet/BeSweet.exe" -core( -input audio48.wav -output "C:\videos\audio.mp4" -logfile "temp_audio.log" ) -bsn( -2ch -cbr 128 -codecquality_fast -aacprofile_lc ) -ota( -d 0 -g max )
start /belownormal /b /w MP4Box.exe -keepsys -add "temp_video.mp4:lang=eng" -add "audio.mp4:lang:eng" "result.mp4"
This is the screen output:
c:\videos\de_rpde_loper>REM start /belownormal /b /w x264.exe --bitrate 600 --no-cabac --analyse p8x8,b8x8 --qpmin 22 --vbv-bufsize 2000 --vbv-maxrate 768 --me umh --progress --no-psnr --level 1.3 --output temp_video.mp4 DRL_02-12_320x240.avs 320x240

c:\videos>"C:/Program Files/BeSweet/BeSweet.exe" -core( -input aud
io48.wav -output "C:\videos\audio.mp4" -logfile "temp_audio.log" )
-bsn( -2ch -cbr 128 -codecquality_fast -aacprofile_lc ) -ota( -d 0 -g max )
BeSweet v1.5b31 by DSPguru.
--------------------------

[00:18:54:229] Conversion Completed !

Visit DSPguru's Homepage at :
http://DSPguru.doom9.net/

c:\videos>start /belownormal /b /w MP4Box.exe -keepsys -add "temp_
video.mp4:lang=eng" -add "audio.mp4:lang:eng" "result.mp4"
IsoMedia import - track ID 1 - Video (size 320 x 240)
IsoMedia import - track ID 1 - Audio (SR 44100 - 2 channels)
IsoMedia import - track ID 2 - media type "odsm:mp4s"
IsoMedia import - track ID 3 - media type "sdsm:mp4s"
Saving to result.mp4: 0.500 secs Interleaving

It is strange that the audio in result is 44Khz (source is 48KHz). And two track Id's (audio and video) have ID 1???
The result plays with QT7, Itunes and syncs to Ipod G5 but still plays like an audio file (no video shown)
cast42 is offline   Reply With Quote
Old 16th December 2005, 00:53   #16  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,779
Quote:
Originally Posted by cast42
It is strange that the audio in result is 44Khz (source is 48KHz).
probably besweet does the downscaling to 44

Quote:
And two track Id's (audio and video) have ID 1???
both input video and audio .mp4 files have the streams with id 1
the output doesnt
__________________
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 16th December 2005, 17:17   #17  |  Link
GregerG
Registered iPod User
 
Join Date: Dec 2005
Posts: 2
Im using the following versions of the essential tools:

X264: x264 core:40 svn-375M (built by Sharktooth)
BeSweet: BeSweet v1.5b31 by DSPguru.
Mp4Box: MP4Box - GPAC version 0.4.1-DEV
and AviSynth 2.5.6

And that is working fine. If someone want my whole batfile I can post it here. I have for for AVIs (1 and 2pass) and one for MPEG using DGIndex.
GregerG is offline   Reply With Quote
Old 17th December 2005, 16:24   #18  |  Link
cast42
Registered User
 
Join Date: May 2005
Location: Belgium
Posts: 22
No video yet

I tried with Sharktooth's build but no luck:
X264: x264 core:42 svn-387 (build by Sharktooth) (x264-Full_r387C)
BeSweet: BeSweet v1.5b31 by DSPguru.
Mp4Box: MP4Box - GPAC version 0.4.1-DEV
and AviSynth 2.5.6

Code:
x264.exe --bitrate 600 --no-cabac --analyse p8x8,b8x8 --qpmin 22 --vbv-bufsize 2000 --vbv-maxrate 768 --me umh --progress --no-psnr --level 1.3 -o "temp_video.mp4" "source_320x240.avs" 320x240
"C:/Program Files/BeSweet/BeSweet.exe" -core( -input audio48.wav -output "audio.mp4" -logfile "temp_audio.log" ) -bsn( -2ch -cbr 128 -codecquality_fast -aacprofile_lc ) -ota( -d 0 -g max )
MP4Box.exe -keepsys -add "temp_video.mp4:lang=eng" -add "audio.mp4:lang=eng" "result.mp4"
Results plays with QT7, MPC and Itunes 6.1, syncs on ipod G5 but no video yet (only audio)

Is Sharktooths build "core:40 svn-375M" that GregerG is using still available somewhere ? Is it crucial ?

This is data in the mdat atom:
x264 - core 42 svn-387 - H.264/MPEG-4 AVC codec - Copyleft 2005 - http://www.videolan.org/x264.html - options: cabac=0 ref=1 deblock=1:0:0 analyse=0x1:0x110 me=umh subme=5 brdo=0 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 cqm=0 chroma_qp_offset=0 slices=1 bframes=0 keyint=250 keyint_min=25 scenecut=40 pass=1 bitrate=600 ratetol=1.0 rceq='blurCplx^(1-qComp)' qcomp=0.60 qpmin=22 qpmax=51 qpstep=4 vbv_maxrate=768 vbv_bufsize=2000 ip_ratio=1.40<bh:00>

This is the data in the free atom at the end of the file:
freeIsoMedia File Produced with GPAC 0.4.1-DEV
cast42 is offline   Reply With Quote
Old 18th December 2005, 20:58   #19  |  Link
cast42
Registered User
 
Join Date: May 2005
Location: Belgium
Posts: 22
x264 encoded video works on Ipod video!

I finally figured out why I got no video on the Ipod G5 with GregerG's approach. I had the TV-out switched on Sorry for the misinformation.

So now we are sure, AtomChanger is not needed at all. A standard ISO/IEC MPEG-4 file encoded with x264 following GregerG's approach (and probably others) can be decoded by the video Ipod! Thanks to everybody who contributed to this result. No reason to use Quicktime Pro's encoder anymore except for convience.
cast42 is offline   Reply With Quote
Old 19th December 2005, 16:01   #20  |  Link
Sharktooth
Mr. Sandman
 
Sharktooth's Avatar
 
Join Date: Sep 2003
Location: Haddonfield, IL
Posts: 11,768
... Omg ...
Sharktooth 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 18:00.


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