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 > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 8th February 2010, 16:03   #1  |  Link
asbonasty
Registered User
 
Join Date: Mar 2008
Posts: 7
MP4 (mp4v vfr) to MP4 H264 Variable Framerate (vfr)

Hey,

Ive been trying to get an MP4/mp4v that has a variable frame rate converted to an mp4/h264 with a variable frame rate. Simple enough I thought.....

Using mediainfo (on linux) I can see that my source mp4 has a variable frame rate.

---snip 8<---
Frame rate mode : Variable
Frame rate : 28.152 fps
Minimum frame rate : 14.706 fps
Maximum frame rate : 57.692 fps
---snip 8<---

So using MP4Box I extracted the nhml...heres a sample from the top of the file.

---snip 8<---
<?xml version="1.0" encoding="UTF-8" ?>
<NHNTStream version="1.0" timeScale="30000" streamType="4" objectTypeIndication="32" specificInfoFile="n97-mini_track1.info" width="640" height="480" trackID="1" baseMediaFile="n97-mini_track1.media" >
<NHNTSample DTS="0" dataLength="21156" isRAP="yes" />
<NHNTSample DTS="520" dataLength="14410" />
<NHNTSample DTS="1040" dataLength="18135" />
<NHNTSample DTS="1560" dataLength="15857" />
<NHNTSample DTS="2580" dataLength="19907" />
<NHNTSample DTS="3570" dataLength="15480" />
<NHNTSample DTS="4590" dataLength="15733" />
<NHNTSample DTS="5610" dataLength="16543" />
<NHNTSample DTS="6630" dataLength="15778" />
<NHNTSample DTS="7650" dataLength="15599" />
<NHNTSample DTS="8670" dataLength="15866" />
<NHNTSample DTS="9690" dataLength="16246" />
---snip 8<---

As you can see there are no CTS offsets and there are none in the rest of the file.

I did the usual process of extracting audio and video, transcoded the video and then created a new mp4, added the nhml and video.

..create the mp4
/usr/local/bin/MP4Box -add n97-mini_track1.nhml -new test.mp4

..add the tracks
/usr/local/bin/MP4Box -add out.264 -add audio.m4a test.mp4

...and I get horrible out of sync video. mediainfo reports the video as having a fixed video frame rate.

--- snip 8<---
Frame rate mode : Constant
Frame rate : 30.000 fps
Original frame rate : 100.000 fps
--- snip 8<---

If I apply the ntml **after** adding the video I do get CTS values in my nhml, but again the video is out of sync and media info still reports the video of having a fixed frame rate.

Can anyone put any light onto this situation as Ive run out of things to try.

If Ive missed anything out that might help please just ask and Ill provide whatever is needed.

I can also provide the video if needed.

Cheers,
Tom

Last edited by asbonasty; 8th February 2010 at 16:05. Reason: forgot some info :)
asbonasty is offline   Reply With Quote
Old 8th February 2010, 16:41   #2  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,907
Quote:
Originally Posted by asbonasty View Post
If Ive missed anything out that might help please just ask and Ill provide whatever is needed.
What is the content and where did you get it?
Guest is offline   Reply With Quote
Old 8th February 2010, 16:44   #3  |  Link
asbonasty
Registered User
 
Join Date: Mar 2008
Posts: 7
Quote:
Originally Posted by neuron2 View Post
What is the content and where did you get it?
I have several source files. They are filmed using Nokia n900's and also N97 minis. I took some sample footage to do some testing with.

EDIT: the content is me going round the office annoying people

Cheers,
Tom
asbonasty is offline   Reply With Quote
Old 8th February 2010, 16:54   #4  |  Link
b66pak
Registered User
 
b66pak's Avatar
 
Join Date: Aug 2008
Location: The Land Of Dracula (Romania - EU)
Posts: 934
if you have windows machine on hand you can deal with your situation very easy with these special x264 build:

Direct264 - special x264 CLI build that supports input from DirectShow

http://forum.doom9.org/showthread.php?t=141441
_
b66pak is offline   Reply With Quote
Old 8th February 2010, 17:01   #5  |  Link
asbonasty
Registered User
 
Join Date: Mar 2008
Posts: 7
Thanks for the info. Ive just tried getting the timecodes out of my source mp4 using dtsedit, and then setting the timecodes back using dtsedit to me target mp4. It works (under windows).

Unfortunately the workflow requires I use tools on linux, so I need a method of extracting the timecodes under linux. I could then use tc2mp4 and mp4box.

Thanks for the reply..I should have mentioned this to begin with.

Cheers,
Tom
asbonasty is offline   Reply With Quote
Old 8th February 2010, 17:20   #6  |  Link
roozhou
Registered User
 
Join Date: Apr 2008
Posts: 1,181
Try ffmpeg.
roozhou is offline   Reply With Quote
Old 9th February 2010, 10:46   #7  |  Link
asbonasty
Registered User
 
Join Date: Mar 2008
Posts: 7
Quote:
Originally Posted by roozhou View Post
Try ffmpeg.
Thanks for the reply but thats as useful as "use a computer"

ffmpeg doesnt allow me to extract the timecodes I need. FFMpegsource does...but this isnt any use to me.

Or does it?

Im currently using wine and dtsedit to do what I need. This is not ideal. MP4Box should really be able to generate an nhml from a file and then reuse its own content. If it can already then Id love to know what Im doing wrong.

Anyone else??

Cheers,
Tom
asbonasty is offline   Reply With Quote
Old 9th February 2010, 14:05   #8  |  Link
Ritsuka
Registered User
 
Join Date: Mar 2007
Posts: 74
Can't you transcode it directly? HandBrake, x264, QuickTime and many others can work directly with your vfr file.
Ritsuka is offline   Reply With Quote
Old 10th February 2010, 14:50   #9  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,766
Problem isn't the vfr input it's the vfr output,...
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 11th March 2010, 20:14   #10  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
This is quite late, but you're transcoding to H.264 with what, x264? I've written a java utility that converts a NHML to VFR with MKV v2 timecodes, but using NHML DTS times could work also especially since there is no CTS offsets. I could quickly modify it to do this, if you're still interested and could give me 2 sample NHML files. One the original source NHML and the other the new NHML from the transcoded file. I've only worked with modifying NHML files from x264 encode, hence why I asked how you are transcoding.
Aktan is offline   Reply With Quote
Old 11th March 2010, 20:32   #11  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
A couple of more details. Since your source NHML didn't have any offsets, basically the source had no B-frames. Since you transcoded to H.264, I assumed you used a transcoder that does use B-frames, thus requiring CTS offsets and also making the source NHML invalid. So I guess a workaround is to transcode to H.264 without B-frames.

Last edited by Aktan; 11th March 2010 at 20:35.
Aktan is offline   Reply With Quote
Old 14th May 2010, 09:55   #12  |  Link
asbonasty
Registered User
 
Join Date: Mar 2008
Posts: 7
An even later response but I really apprecaite the reply

Ok I use mencoder to encode the video stream. Im no expert with all this to CTS offsets etc doesnt really mean that much to me so please be gentle

What exactly do I need to do?

Cheers,
Tom
asbonasty is offline   Reply With Quote
Old 17th May 2010, 19:55   #13  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
Sorry for the late response as somehow the notification of a message posted in this thread was counted as spam. Well I need a sample files. Maybe a sample source NHML and the final encode MP4 that needs to have it applied.

Last edited by Aktan; 17th May 2010 at 20:00.
Aktan 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 01:10.


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