asbonasty
8th February 2010, 16:03
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
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