View Full Version : possible mp4 issues?
neo75903
16th November 2004, 01:37
Hi,
I have written a simple batch file to transcode my avi files to mp4 files. It uses mp4box and ffmpeg to do this.
avi files are XVID encodes SP@level 3 and audio is done is mp3.
mp4 files are hinted for use with Darwin Streaming Server.
I have ran some succesful samples.
Files play fine in Quicktime and VideoLan0.8 locally as remotely through RTSP.
Note that 3ivx is not installed.
Here is a sample of my test bat file:
rem demux video:
ffmpeg.exe -y -i simpsons.avi -vcodec copy -f avi -an video.avi
rem demux audio:
ffmpeg.exe -y -i simpsons.avi -vn -acodec copy audio.mp3
rem avi video to mp4:
mp4box.exe -import "video.avi" -nodrop -flat "video.mp4"
rem mp3 to mp4 with aac at 128kbps:
ffmpeg.exe -y -i "audio.mp3" -acodec aac -ab 64 -f mp4 "audio.mp4"
rem mux audio and video:
mp4box.exe -merge "audio.mp4" "video.mp4" "simpsons.mp4"
rem hinting:
mp4box.exe -isma -hint "simpsons.mp4"
rem cleanup temp files:
del simpsons.mp4
del video.avi
del audio.mp4
del video.mp4
del audio.mp3
rem final name:
ren out_simpsons.mp4 simpsons.mp4
Question is are there other things I have to pay attention to before i start transcoding?
Any suggestion may be welcome.
pogo stick
16th November 2004, 07:05
Are you sure you need to reencode mp3 to aac? mp4 can handle both.
Then it would be much simpler:
mp4box -import simpsons.avi simpsons.mp4
Or Darwin Streaming Server can not use mp3?
neo75903
16th November 2004, 12:45
i know that mp3 is part of the mpeg4 specs, but Quicktime neither VideoLan is able to play a mp4 file with mp3, yet.
Or i have to wait until next Quicktime comes out and see whether it supports mp3 in mp4 container.
Cosmo and surprise ... Real player played the file.
gotaserena
16th November 2004, 14:08
Any reason not to call ffmpeg only once to process both audio and video and create the mp4 directly? You can always run MP4Box -isma on the resulting .mp4 file.
neo75903
16th November 2004, 16:33
i dont think it will works and have no clue how the syntax will looks like.
encoding, merging and hinting are separated processes dont think you can mix them.
gotaserena
16th November 2004, 16:40
well, ffmpeg -y -i infile.avi -acodec aac -ab 64 -ac 2 -vcodec copy -f mp4 outfile.mp4 && MP4Box -isma -hint outfile.mp4 worked here.
SeeMoreDigital
16th November 2004, 17:01
Originally posted by neo75903
i know that mp3 is part of the mpeg4 specs, but Quicktime neither VideoLan is able to play a mp4 file with mp3, yet.
Or i have to wait until next Quicktime comes out and see whether it supports mp3 in mp4 container.
Cosmo and surprise ... Real player played the file. The lastest release of Nero's ShowTime player also supports MP3 in MP4 (some of the newer previous versions did not)...
It would be kinda handy if VideoLAN could support this feature... Has anybody told them/do they know, it does not work?
Cheers
neo75903
16th November 2004, 18:12
@gotaserena:
idd i was to fixed in demuxing my avi file first.
edit: tried your syntax, Quicktime could not play the file with following error:
----------------------------------------
"test.mp4" is not a valid MPEG-4 file
For more details, see below...
----------------------------------------
Errors occur when parsing "test.mp4"
The file may be corrupted
----------------------------------------
My general experience is that ffmpeg created mp4 files are not playable in Quicktime. videoLan did play the file. Is it possible that the muxer is also based on mp4creator's source?
@SeeMoreDigital:
I tried to do same thing with VideoLan as i did with ffmpeg. The result file was played by videolan, but it didnt for ffmpeg created one.
Does anyone whether Quicktime will support mp3 in mp4? they have been talking about he-aac, but are very silent about mp3 support in it.
SeeMoreDigital
16th November 2004, 19:39
Originally posted by neo75903
Does anyone whether Quicktime will support mp3 in mp4? they have been talking about he-aac, but are very silent about mp3 support in it. No it can't... the file b0rks from the "get-go" :(
http://img132.exs.cx/img132/6060/QT6x_MP3_in_MP4_error_report.gif.
Bizarrely, the QuickTime player is able to open Mpeg4+MP3 in MOV but will eventually crash!
The only sure fire way of being able to play Mpeg4+MP3 in either MP4 and MOV is by installing 3ivx's filters...
Cheers
neo75903
16th November 2004, 21:41
Thx i will wait until the next Quicktime release and see if support for XVID+mp3.mp4 will be available and decide from then what to do.
SeeMoreDigital
16th November 2004, 22:14
Originally posted by neo75903
Thx i will wait until the next Quicktime release and see if support for XVID+mp3.mp4 will be available and decide from then what to do. I'm sure if you persevere at trying to successfully convert MP3 to AAC you'll get what you want ;).
That said (as I've posted before), Mpeg4+AAC streams have to be muxed properly, otherwise the QuickTime player b0rks (unless you have 3ivx's filters installed). And not everybody wants to have 3ivx installed...
Cheers
gotaserena
17th November 2004, 00:11
I've just checked that ffmpeg does not include the MPEG-4 profile of the video in the .mp4 if it is just copying it. If you do encode the video using ffmpeg, be sure to use h.263 and keep it simple (profile) and the resulting .mp4 will play in quicktime. At least this is what I've seen here.
neo75903
17th November 2004, 01:24
I think mp4box mp4 muxing is currently more reliable. Actually the one i have best results so far.
Video is ok, i only use h263 and SP@level 3 for Quicktime compability, only screwed once last year when i encoded a small batch to discover 3ivx was doing the job resulting a error when 3ibx was removed.
That is also i am not installing 3ivx atm. Not to be said playback performance is much better with 3ivx installed.
My last 'important' desicion is the choice of aac or just wrap mp3 into mp4. I prefer last option if Quicktime do support mp3 in a mp4 container. I think the problem is in mp4 parser cause Quicktime can play mp3 files :)
btw some screenshots of Quicktime can be found here:
http://www.appleinsider.com/article.php?id=655
gotaserena
17th November 2004, 01:31
if it works for you, great. I just wanted to say that, provided the video encoding is done with ffmpeg, you should not have any trouble playing the result file in qt.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.