View Single Post
Old 19th July 2018, 22:16   #6  |  Link
Perenista
Registered User
 
Join Date: Oct 2013
Posts: 205
Quote:
Originally Posted by sneaker_ger View Post
The video has been recorded upside-down but a flag in the MP4 container tells players to rotate the video by 180° upon display (so that display is corrected). When mkvtoolnix remuxes the mp4 file this flag is lost because such a flag doesn't exist for mkv. Nothing you can do except re-encode the video or stick to mp4.
Yamb is also failing to do the same, so sticking with MP4 and doing any lossless change is not an option.

If this was an AVI I could easily open VirtualDUB and use directstream copy to save without reencode.

I need to edit this MP4 in this way:

- I recorded with the iPAD, however I used a tape recorder which then saved the ambient audio as a MP3. (this is way better than the audio recorded from the iPAD)

What I need to do:

1) Remove the audio stream from the MP4 recorded by the iPAD.

2) Add the MP3 from the tape recorder, which is now synchronized.

I did this:

- Extracted the video as RAW (Yamb option). I did this with the MP4 taken from the iPAD. Resulting file: IMG_1513_track1.h264

Then I used Yamb to join the video and audio streams.

Again upside down. Why Apple continues to do this sort of c.rap to force users into reencodes is beyond me.

In a 2013/14 PC it takes several hours to reencode in 4K quality, using Sony Vegas. And the final result, even if it's good, it's not as good as the original MP4 file (and there was a reduction from 6.82 to 3.63 GB).

I'll see if there's something that can be done... It makes no sense to say this was recorded upside down since I only used landscape mode and while I was looking at the iPAD camera the image was not upside down.

*****
Edit: I did it! Problem solved! There was no need to reencode.

https://stackoverflow.com/questions/...ut-re-encoding

This is what should be done:

Look at that part...

True lossless rotation of MP4:

open mp4 with hex editor and search for vide to find the metadata of the video track
some rows above (for my files mostly 9, sometimes 12) you should see trak...\tkhd
in between there should be an @ sign (HEX 40)
in the two rows before it the rotation matrix is stored

(...)

Last edited by Perenista; 20th July 2018 at 04:43.
Perenista is offline   Reply With Quote