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. |
8th February 2010, 16:03 | #1 | Link |
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 :) |
8th February 2010, 16:54 | #4 | Link |
Registered User
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 _ |
8th February 2010, 17:01 | #5 | Link |
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 |
9th February 2010, 10:46 | #7 | Link |
Registered User
Join Date: Mar 2008
Posts: 7
|
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 |
11th March 2010, 20:14 | #10 | Link |
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.
|
11th March 2010, 20:32 | #11 | Link |
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. |
14th May 2010, 09:55 | #12 | Link |
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 |
17th May 2010, 19:55 | #13 | Link |
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. |
Thread Tools | Search this Thread |
Display Modes | |
|
|