Log in

View Full Version : H.264 in .MOV -> AVI/MP4


Pages : [1] 2

LoRd_MuldeR
30th October 2005, 23:27
I got a H.264 movie stored in a Quicktime (.MOV) file. Is there a way to convert that to AVI or MP4? I don *not* want to re-encode. I need direct stream copy. AVI would be best, but MP4 would be okay anyway.

Muxing the streams into AVI or MP4 shouldn't be that hard, but how to extract them form MOV ???

acidsex
30th October 2005, 23:35
what is your audio, aac? If so, avi wont work unless you convert audio to mp3. I dont believe avi will accept aac audio.

If you could pull your audio and video streams out of the mov, you could use YAMB to remux it to the mp4 container.

You would probably get more response in the container forum.

bond
30th October 2005, 23:37
quicktime does it

:search: next time

moved

LoRd_MuldeR
31st October 2005, 00:10
okay...

Problem: I don't have a Pro version of QT

I already tried to do the job with GraphEdit but no success! There are several Filters for demuxing the MOV (for example 3ivx or something) but there is no filter that can mux this data or write the raw data to file! For example the 3ivx Muxer does *not* connect to it's own Demuxer, at least not for the video node (the audio node does). The FileWriter doesn't connect to Demuxer, too. I was able to mux the data with the OGG-Muxer (only Muxer that did connect so far) but the resulting OGG files was crap...

Any more ideas ???

Audionut
31st October 2005, 00:28
Rename the .mov to .mp4

LoRd_MuldeR
31st October 2005, 00:55
Rename the .mov to .mp4

This doesn't change a thing, except I don't see a demuxer-filter any longer. GraphEdit seems to use Haali Media Splitter for demuxing the MOV (which now has a .mp4 extension), but it does not display the demuxer in the graph. But still the same problem: No way to mux the streams or to extract them as raw data...

MKV-Muxer connects the streams, but the resulting file is crap. All MP4 or AVI Muxers do *not* connect to the streams, so I cannot mux!


Isn't there a simple tool that is able to extract raw streams from the MOV container, so I can mux them to MP4 later ???

foxyshadis
31st October 2005, 01:09
You could try ffmpeg, sometimes it works pretty well for remuxing mov (and other times not).

ffmpeg -i <input> -acodec copy -vcodec copy <output>

-vn or -an to null video/audio if you only want one stream.

bond
31st October 2005, 03:03
renaming mov to mp4 doesnt work out really

muxing avc to mp4 with ffmpeg doesnt work out correctly

you have to demux the avc stream from mov with mplayer for example and than remux the raw avc stream to .mp4 with either mp4creator or mp4box

LoRd_MuldeR
31st October 2005, 13:36
I'm not used to MPlayer. How to extract streams with MPlayer?

:thanks:

Elias
31st October 2005, 13:49
Would it be possible with MP4Box to add extract track support for mov files (AAC, mp4v and avc1)? That way, no one would need QTPro anymore for demuxing the streams out of the mov's to get an mp4 from them.

In my opinion, this ought to be a top priority update for MP4Box. I can understand though that it's not easy, because mov is certainly more restricted than mp4, and not as open either.

bond
31st October 2005, 14:25
mplayer -dumpvideo -dumpfile output.264 input.mov

Would it be possible with MP4Box to add extract track support for mov files (AAC, mp4v and avc1)? That way, no one would need QTPro anymore for demuxing the streams out of the mov's to get an mp4 from them.

In my opinion, this ought to be a top priority update for MP4Box. I can understand though that it's not easy, because mov is certainly more restricted than mp4, and not as open either.mp4box is a mp4 tool, the last thing i want to see is mov officially sneaking into that project

quicktime allows people to encode with avc to mp4 directly, there is no need to store avc in mov after all (unless you want to use some additional mov specific stuff of course)

Elias
31st October 2005, 14:32
mp4box is a mp4 tool, the last thing i want to see is mov officially sneaking into that project

quicktime allows people to encode with avc to mp4 directly, there is no need to store avc in mov after all (unless you want to use some additional mov specific stuff of course)Well of course I don't want that either. I just meant that it could have a demux option for mov files to effectively get rid of mov files by turning them into mp4, not create mov files. Or just a direct stream copy (like VirtualDub) from mov to mp4 directly, without extracting.

I mean, the mov architecture is very similar to mp4, would it be that difficult to do this?

LoRd_MuldeR
31st October 2005, 15:57
Extracting the Video stream with MPlayer worked fine :)

However MP4Box won't mux. Any ideas ???

D:\YAMB>mp4box -add C:\video.264 c:\out.mp4

Cannot find H264 start code
Error: BitStream Not CompliantError importing C:\video.264: BitStream Not Compliant

bond
31st October 2005, 17:01
mplayer and ffmpeg dont seem to produce valid streams when demuxing

mp4creator --extract=trackidofavcstream input.movseems to work tough

you have to rename the output file to *.264 by hand

LoRd_MuldeR
31st October 2005, 22:05
Thanks! Extracting the streams from the MOV with mp4creator workes fine. And I was also able to mux the H.264 stream in MP4Box.

But now there's another problem: MP4Box doesn't want to mux the AAC stream. And a video without it's audio stream isn't fun :(

Audio isn't MPEG-2/4 AAC with ADTS
Error importing E:\ViDeOz\Trailer\trailer.aac: BitStream Not Compliant


Also tried to mux with mp4creator. Same thing: H.264 can be muxed, AAC does *not* mux. But I'm sure it is AAC. When I play the original MOV in VLCPlayer it says "mp4a" for the audio stream...

Kurtnoise
31st October 2005, 22:41
Try to change header with this tool (http://www.rarewares.org/files/aac/AACPatch.zip)...

LoRd_MuldeR
31st October 2005, 22:49
Try to change header with this tool (http://www.rarewares.org/files/aac/AACPatch.zip)...

Doesn't work...

D:\aacpatch>aacpatch e:\videoz\trailer\trailer.aac e:\videoz\trailer\trailer2.aac
Failed (sync bits not found)...exiting!

bond
1st November 2005, 04:17
well who knows what sucking things apple does with its streams in mov...

i can only recommend you to test all available mov demuxers. you might want to give 3ivx a try

LoRd_MuldeR
1st November 2005, 20:04
I finally managed to export the audio-track via GraphEdit (3ivx Media Splitter + Elecard MP4 Mux). The resulting file was MP4. Extrcating a valid AAC-Track from that MP4 was easy (MP4Box). Finally I muxed the AAC-Track together with the H.264-Stream (again MP4Box). Now I got a "complete" MP4 with Video *and* Audio track.

So far it seems to work and plays back. But: Now I got A/V sync problems! :confused:
Sync is 100% okay in the original MOV...

bond
1st November 2005, 21:30
mp4box by default uses 25fps for the video, if your video has a different framerate you have to specify it

LoRd_MuldeR
1st November 2005, 21:56
mp4box by default uses 25fps for the video, if your video has a different framerate you have to specify it

Thanks. I'll check that...

LoRd_MuldeR
1st November 2005, 22:17
Yeah, great that works. I had to change FPS from 25 to 23,97. Now the resulting MP4 plays perfect. Finally! :D

We definitely need a tool for making this conversion more easy!

SeeMoreDigital
1st November 2005, 22:35
Actually, it would seem MP4Box supports MPEG-4/AVC with AAC audio streams in MOV :eek:

Currently, all you have to do is change the .MOV file extension to .MP4, load/import/add the file into YAMB and hit the "Mux" button..... And you'll end up with a perfectly re-muxed (and seemingly) compliant MP4 file!

So I guess it might be prudent for Kurtnoise13 to add recognition of MOV files to YAMB, in much the same way it does now with AVI files ;)

I have to say I was absolutely astonished when I found this out :D


Cheers

LoRd_MuldeR
1st November 2005, 23:09
Why you didn't tell me that earlier ???????????????????????????????

;)

bond
1st November 2005, 23:15
there are differences between mov and mp4, renaming is always a bad idea

SeeMoreDigital
1st November 2005, 23:22
Why you didn't tell me that earlier ???????????????????????????????I did not know about the MOV parsing myself until the 17th October (http://forum.doom9.org/showthread.php?p=725393#post725393)!

It looks as though Jean added MOV support to the newer versions of MP4Box, because it was not their in the older versions :confused:

there are differences between mov and mp4, renaming is always a bad ideaMP4Box can read other streams in MOV too, such as MP3, WAV, Sorenson 3 video, MPEG-4/SP/ASP etc, etc...



Cheers

LoRd_MuldeR
2nd November 2005, 20:55
there are differences between mov and mp4, renaming is always a bad idea

Sure. But MP4Box can mux MOV directly into MP4. It works fine!

bond
2nd November 2005, 21:09
yeah its a good tool :D

SeeMoreDigital
2nd November 2005, 21:11
yeah its a good tool :DI second that ;)

And it's getting better all the time :D

Elias
2nd November 2005, 21:19
Sure. But MP4Box can mux MOV directly into MP4. It works fine!Holy shit! This was the only thing I lacked with MP4Box. /me will never install QT again!

vlix
4th November 2005, 13:04
OK, confused mp4 noob here. I'd like to remux apple HD trailers so that I can play them properly in MP Classic, and I tried the trick mentioned above (rename file to .mov, add in YAMB, mux). So, I push the 'mux' button in YAMB, and within a fraction of a second, it tells me this:

[13:01:07] : Muxing started...
[13:01:07] : Importing & Writing streams...
[13:01:07] : Muxing finished completely.

But nothing has actually happened. No muxing, no new file, nothing.
Am I possibly using the wrong version of MP4Box or something? I use 0.4.0-DEV, along with YAMB 1.3.1.

A little help anyone? Thanks very much!

vlix
4th November 2005, 13:21
Never mind, I fixed it. Seems I needed version 0.4.1.

SeeMoreDigital
4th November 2005, 13:23
Try using this new test build (http://kurtnoise.free.fr/Yamb/Yamb-1.3.1_20051102.zip) of YAMB, with this version of MP4Box (http://kurtnoise.free.fr/mp4tools/MP4Box_20051103.zip).

Just to let you know... after using YAMB to de-mux the QuickTime AVC+AAC trailers from .MOV files to .MP4, you'll find some of them will work better than others.... And it makes no difference if you use QuickTime 7 to do the de-muxing either.... I think the video streams are slightly b0rked :eek:


Cheers

vlix
4th November 2005, 13:33
Try using this new test build (http://kurtnoise.free.fr/Yamb/Yamb-1.3.1_20051102.zip) of YAMB, with this version of MP4Box (http://kurtnoise.free.fr/mp4tools/MP4Box_20051103.zip).

Just to let you know... after using YAMB to de-mux the QuickTime AVC+AAC trailers from .MOV files to .MP4, you'll find some of them will work better than others.... And it makes no difference if you use QuickTime 7 to do the de-muxing either.... I think the video streams are slightly b0rked :eek:


Cheers

Cheers! In any case, the remuxed 1080p King Kong trailer plays absolutely fine now on my computer, while the original .mov was a disaster. So I'm happy.

bond
4th November 2005, 13:37
ok i now tried remuxing with mp4box from mov to mp4 on the apple clip nasa_shuttle_m420p.mov and it did NOT work
mp4box reports an error "isomedia file is trunctated"

so this tells me that renaming mov to mp4 is not always possible as is remuxing mov to mp4 in mp4box

SeeMoreDigital
4th November 2005, 13:59
ok i now tried remuxing with mp4box from mov to mp4 on the apple clip nasa_shuttle_m420p.mov and it did NOT work
mp4box reports an error "isomedia file is trunctated"

so this tells me that renaming mov to mp4 is not always possible as is remuxing mov to mp4 in mp4boxHi Bond,

Is the NASA clip still available? If so I will try and de-mux the streams using QT7, to see if it fairs any better!

Like I mentioned before hand.... not all the QT AVC+AAC samples work properly :(


Cheers

Elias
4th November 2005, 14:01
The mov files MIGHT be locked.

bond
4th November 2005, 14:14
The mov files MIGHT be locked.the one i tried is not

btw you can download the clip yourself here (http://images.apple.com/movies/us/hd_gallery/gl1800/480p/nasa_shuttle_m420p.mov)

SeeMoreDigital
4th November 2005, 14:41
btw you can download the clip yourself here (http://images.apple.com/movies/us/hd_gallery/gl1800/480p/nasa_shuttle_m420p.mov)As I suspected.... this just happens to be one of those QT files than can't be played using Nero's (current) direct-show decoder filters, even when de-muxed to MP4.

None of these files can be de-muxed corectly in YAMB :(

Plus, when playing the MOV or MP4 in VLC player or with FFdshow's filters, the image appears to judder, quite badly at the beginning and then slightly through-out the rest of the sample. Ironically in QT7, the de-muxed files play perfectly.... Weird

bond
4th November 2005, 16:22
As I suspected.... this just happens to be one of those QT files than can't be played using Nero's (current) direct-show decoder filters, even when de-muxed to MP4.how did you create that mp4?

Plus, when playing the MOV or MP4 in VLC player or with FFdshow's filters, the image appears to judder, quite badly at the beginning and then slightly through-out the rest of the sample. Ironically in QT7, the de-muxed files play perfectly.... Weird mplayer handles it fine

SeeMoreDigital
4th November 2005, 16:35
how did you create that mp4?I used QuickTime 7's "pass through" mode.

mplayer handles it fineWhat decoder filters is mplayer using?

bond
4th November 2005, 19:36
I used QuickTime 7's "pass through" mode.hm maybe its borken :D

What decoder filters is mplayer using? libavodec with its own mov/mp4 parser

Elias
4th November 2005, 21:00
As I suspected.... this just happens to be one of those QT files than can't be played using Nero's (current) direct-show decoder filters, even when de-muxed to MP4.

None of these files can be de-muxed corectly in YAMB :(

Plus, when playing the MOV or MP4 in VLC player or with FFdshow's filters, the image appears to judder, quite badly at the beginning and then slightly through-out the rest of the sample. Ironically in QT7, the de-muxed files play perfectly.... WeirdCould it be that Apple has updated the mov specs for QT7? I mean, they never used AAC/AVC before, and now that they do, they may have changed something with their mov container? Just a guess.

SeeMoreDigital
4th November 2005, 21:08
Could it be that Apple has updated the mov specs for QT7? I mean, they never used AAC/AVC before, and now that they do, they may have changed something with their mov container? Just a guess.Dunno mate!

But it does appear the newer AVC in MOV encodes can be de-muxed to MP4 more successfully!

It's not just early QT7 AVC encodes that appear to be b0rked.... Some of my early Sorenson AVC tests show signs of b0rkness too.... Now there's a thing.... If ever there was... a thing!


Cheers

chros
16th January 2006, 21:14
Elias told that it's possible.
I have tried mp4box with Yamb, and it's do the trick.
But there's 1 trailer when this remuxing is not working:
http://movies.apple.com/movies/sony_pictures/da_vinci_code/da_vinci_code-tsr2_h480p.mov

I have tried everything but there isn't picture in the resulted file or the sound is delayed.

So the question: how to convert properly ?

Thanks

hellfred
16th January 2006, 23:10
Elias told that it's possible.
I have tried mp4box with Yamb, and it's do the trick.
But there's 1 trailer when this remuxing is not working:
http://movies.apple.com/movies/sony_pictures/da_vinci_code/da_vinci_code-tsr2_h480p.mov

I have tried everything but there isn't picture in the resulted file or the sound is delayed.

So the question: how to convert properly ?

Thanks
Could you please share your knowledge, how to extract and remux the streams from the mov-container with me? I tryed to get it working with mencoder and Yamb/MP4Box, but I failed to extract a h264 stream that was readable by my mp4box binary.

Hellfred

EDIT:
OK, found the thread (http://forum.doom9.org/showthread.php?t=102064&highlight=remux+mov) where they say, just rename the mov to mp4 and remux with yamb/mp4box. That did not work for me, as I do want to remux the nasa_spaceshuttle clipt that is one of those that are not to remux that easily.

chros
17th January 2006, 10:14
That did not work for me, as I do want to remux the nasa_spaceshuttle clipt that is one of those that are not to remux that easily.

Can you give me a link, so I can try it.

hellfred
17th January 2006, 10:33
The samples are here (http://www.apple.com/quicktime/guide/hd/).
The direct addresses of the two movs are hidden in the html-code of this side (http://www.apple.com/quicktime/guide/hd/nasaspaceshuttle.html).
http://images.apple.com/movies/us/hd_gallery/gl1800/480p/nasa_shuttle_m420p.mov
http://images.apple.com/movies/us/hd_gallery/gl1800/nasa_shuttle_m720p.mov
Hellfred

chros
17th January 2006, 11:03
The samples are here (http://www.apple.com/quicktime/guide/hd/).
The direct addresses of the two movs are hidden in the html-code of this side (http://www.apple.com/quicktime/guide/hd/nasaspaceshuttle.html).
http://images.apple.com/movies/us/hd_gallery/gl1800/480p/nasa_shuttle_m420p.mov
http://images.apple.com/movies/us/hd_gallery/gl1800/nasa_shuttle_m720p.mov
Hellfred

I have managed to create a perfect mp4 file from the 420p version only in QuickTime Pro player:
- load the mov
- File -> export
- Use : Lan/Internet
- Export: Movie to MPEG-4
- options:
- File format: MP4
- video: pass through
- audio: pass through
Save

And it creates a perfect mp4 file (you can check it in YAMB on the Export tab).

But this doesn't work with the mentioned da_vinci_code trailer ... :(

bond
17th January 2006, 12:21
But this doesn't work with the mentioned da_vinci_code trailer ... passtrough in qt works fine on the trailer here

OK, found the thread (http://forum.doom9.org/showthread.php?t=102064&highlight=remux+mov) where they say, just rename the mov to mp4 and remux with yamb/mp4box. That did not work for meof course this doesnt work for you because .mov is not the same as .mp4 and therefore you cant simply rename the extension and expect .mp4 tools to handle the .mov

that said renaming .mov to .mp4 is plain nonsense, you cant create a valid mp4 file that way