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
Register FAQ Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
Old 15th June 2006, 01:14   #21  |  Link
Zero1
Two bit encoder
 
Zero1's Avatar
 
Join Date: May 2005
Location: England, UK
Posts: 157
Hmm, what would be ideal then as suggested by a friend of mine (Coderjoe), would be direct nhml output from DeDup.

Or maybe a high accuracy (neutral) timecode format that isn't specific to MKV or MP4 but can be converted to either format without any inaccuracies.
Zero1 is offline   Reply With Quote
Old 15th June 2006, 11:16   #22  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
Quote:
Originally Posted by Zero1
Hmm, what would be ideal then as suggested by a friend of mine (Coderjoe), would be direct nhml output from DeDup.
i thought about that too, but the problem is that nhml needs some strange .info and .media (which is not a raw stream) as input set, and those can only be created by mp4box
so dedup on its own cant really create this i think

Quote:
Or maybe a high accuracy (neutral) timecode format that isn't specific to MKV or MP4 but can be converted to either format without any inaccuracies.
well if i get it right its possible to convert mkv -> nhml "losslessly", the only problem is that the mkv timecode files already contain inaccuracies because of their structure
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 15th June 2006, 12:04   #23  |  Link
Drachir
Teetrinker
 
Drachir's Avatar
 
Join Date: Jan 2002
Posts: 258
Quote:
Originally Posted by bond
i thought about that too, but the problem is that nhml needs some strange .info and .media (which is not a raw stream) as input set, and those can only be created by mp4box
so dedup on its own cant really create this i think
*.info is the Decoder Specific Info Descriptor -> header of the RAW Stream, isn't it?

*.media elementary stream without header of the raw stream?
__________________
Play GO ( http://en.wikipedia.org/wiki/Go_(board_game))
Drachir is offline   Reply With Quote
Old 21st July 2006, 22:26   #24  |  Link
Zero1
Two bit encoder
 
Zero1's Avatar
 
Join Date: May 2005
Location: England, UK
Posts: 157
Is there any reason why this might fail with ASP?

I have been getting a division by zero error. This is the first time I've tried with ASP (I've tried with one encode of the source and got the error, deleted all my files and started again).

I have muxed a few files containing H.264 and they are fine, but it seems it doesn't like ASP, unless anyone else does not got an error, then it's a problem on my part somewhere.

Here's the relevant info.

Batch for encoding/VFR/muxing
Code:
xvid_encraw.exe -i Video1.avs -type 2 -w 720 -h 576 -o "pass1.m4v" -max_bframes 2 -bquant_ratio 150 -bquant_offset 100 -bitrate 631 -pass1 "xvidstats.log" -full1pass -max_key_interval 480 -quality 6 -vhqmode 4 -bvhq -qtype 0 -nopacked -imin 2 -imax 31 -bmin 2 -bmax 31 -pmin 2 -pmax 31 -progress 25
xvid_encraw.exe -i Video1.avs -type 2 -w 720 -h 576 -o "pass2.m4v" -max_bframes 2 -bquant_ratio 150 -bquant_offset 100 -bitrate 631 -pass2 "xvidstats.log" -max_key_interval 480 -kboost 10 -kthresh 1 -kreduction 20 -ostrength 0 -oimprove 5 -odegrade 5 -chigh 0 -clow 0 -quality 6 -vhqmode 4 -bvhq -qtype 0 -nopacked -imin 2 -imax 31 -bmin 2 -bmax 31 -pmin 2 -pmax 31 -progress 25
mp4box.exe -add pass2.m4v:par=64:45 in.mp4
tc2mp4.exe -i in.mp4 -t times.txt -o out.mp4
mp4box.exe -add hackaud.mp3:lang=jpn:name="MPEG-1 Layer 3 2.0 (Stereo)" -chap Chapter.chp -name 1="MPEG-4 Advanced Simple Profile @ Level 5 - 16/9" -lang 1=jpn out.mp4
pause
Output in CMD
Code:
C:\Documents and Settings\Michael\Desktop\enc>xvid_encraw.exe -i Video1.avs -typ
e 2 -w 720 -h 576 -o "pass1.m4v" -max_bframes 2 -bquant_ratio 150 -bquant_offset
 100 -bitrate 631 -pass1 "xvidstats.log" -full1pass -max_key_interval 480 -quali
ty 6 -vhqmode 4 -bvhq -qtype 0 -nopacked -imin 2 -imax 31 -bmin 2 -bmax 31 -pmin
 2 -pmax 31 -progress 25
xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003


Input colorspace is YV12
xvidcore build version: xvid-1.2.0-dev
Bitstream version: 1.2.-127
Detected CPU flags: ASM MMX MMXEXT SSE SSE2 3DNOW 3DNOWEXT TSC
Detected 1 cpus, using 1 threads.
  21876 frames( 99%) encoded,  13.96 fps, Average Bitrate =  1323kbps
Tot: enctime(ms) =1567377.00,               length(bytes) = 151071363
Avg: enctime(ms) =  71.62, fps =  13.96, length(bytes) =    6902
I frames:    322 frames, size =   36095/11622701, quants =  2 / 2.00 /  2
P frames:   8083 frames, size =   13573/109712744, quants =  2 / 2.00 /  2
B frames:  13479 frames, size =    2206/29735918, quants =  4 / 4.00 /  4

C:\Documents and Settings\Michael\Desktop\enc>xvid_encraw.exe -i Video1.avs -typ
e 2 -w 720 -h 576 -o "pass2.m4v" -max_bframes 2 -bquant_ratio 150 -bquant_offset
 100 -bitrate 631 -pass2 "xvidstats.log" -max_key_interval 480 -kboost 10 -kthre
sh 1 -kreduction 20 -ostrength 0 -oimprove 5 -odegrade 5 -chigh 0 -clow 0 -quali
ty 6 -vhqmode 4 -bvhq -qtype 0 -nopacked -imin 2 -imax 31 -bmin 2 -bmax 31 -pmin
 2 -pmax 31 -progress 25
xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003


Input colorspace is YV12
xvidcore build version: xvid-1.2.0-dev
Bitstream version: 1.2.-127
Detected CPU flags: ASM MMX MMXEXT SSE SSE2 3DNOW 3DNOWEXT TSC
Detected 1 cpus, using 1 threads.
  21876 frames( 99%) encoded,  15.95 fps, Average Bitrate =   665kbps
Tot: enctime(ms) =1372638.00,               length(bytes) = 75895490
Avg: enctime(ms) =  62.72, fps =  15.94, length(bytes) =    3467
I frames:    322 frames, size =   24370/7847320, quants =  2 / 3.39 /  4
P frames:   8083 frames, size =    6458/52202983, quants =  3 / 4.23 /  5
B frames:  13479 frames, size =    1175/15845187, quants =  5 / 7.13 /  9

C:\Documents and Settings\Michael\Desktop\enc>mp4box.exe -add pass2.m4v:par=64:4
5 in.mp4
MPEG-4 Video import - 720 x 576 @ 25.0000 FPS
Indicated Profile: Advanced Simple Profile @ Level 5
Has B-Frames (2 max consecutive B-VOPs)
Import results: 21884 VOPs (322 Is - 8083 Ps - 13479 Bs)
Converting to ISMA Audio-Video MP4 file...
Saving to in.mp4: 0.500 secs Interleaving

C:\Documents and Settings\Michael\Desktop\enc>tc2mp4.exe -i in.mp4 -t times.txt
-o out.mp4
mp4box -nhml 1 in.mp4
[Timecode info]
  Timecode format(v2)
  Total frames(21884), Timescale(1000000)
[NHML info]
  Timebase(0)
Illegal division by zero at script/tc2mp4.pl line 94, <SRC_NHML> line 3.

C:\Documents and Settings\Michael\Desktop\enc>mp4box.exe -add hackaud.mp3:lang=j
pn:name="MPEG-1 Layer 3 2.0 (Stereo)" -chap Chapter.chp -name 1="MPEG-4 Advanced
 Simple Profile @ Level 5 - 16/9" -lang 1=jpn out.mp4
MP3 import - sample rate 48000 - MPEG-1 audio - 2 channels
Saving to out.mp4: 0.500 secs Interleaving
I can provide the timecode file if needed; in theory it should be the same as the one I used when muxing the H.264, but I can't remember if I changed any filtering settings (which would alter detection).

Last edited by Zero1; 22nd July 2006 at 14:52.
Zero1 is offline   Reply With Quote
Old 24th July 2006, 20:51   #25  |  Link
bond
Registered User
 
Join Date: Nov 2001
Posts: 9,770
a description for the nhnt and nhml format:
http://gpac.sourceforge.net/doc_nhnt.php
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau)
I know, that I know nothing (Socrates)

MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide)
Ogg Theora | Ogg Vorbis
use WM9 today and get Micro$oft controlling the A/V market tomorrow for free
bond is offline   Reply With Quote
Old 3rd August 2006, 07:12   #26  |  Link
leiming2006
Registered User
 
leiming2006's Avatar
 
Join Date: Mar 2006
Location: Shanghai, China
Posts: 203
A tool that quite useful
I search for this for a long time but finally I find none.

Great work.

Edit: It can't work here.

By the way, I think it's easier to converting timecodes v2 to v1 than converting timecodes v1 to v2 XD
The total frame number seems to be not offered in timecodes v1.

Last edited by leiming2006; 4th August 2006 at 06:13.
leiming2006 is offline   Reply With Quote
Old 1st November 2006, 12:42   #27  |  Link
chros
Registered User
 
chros's Avatar
 
Join Date: Mar 2002
Posts: 2,323
Thanks for this tool, too !!!
chros is offline   Reply With Quote
Old 10th November 2006, 02:23   #28  |  Link
giandrea
Registered User
 
Join Date: Sep 2004
Location: Italy
Posts: 154
Is it possible to do something like this with OpenSource tool available on Linux or Mac OS X, like ffmpeg or mplayer/mencoder?
giandrea is offline   Reply With Quote
Old 13th November 2006, 00:20   #29  |  Link
giandrea
Registered User
 
Join Date: Sep 2004
Location: Italy
Posts: 154
Quote:
Originally Posted by Zero1 View Post
Is there any reason why this might fail with ASP?

I have been getting a division by zero error. This is the first time I've tried with ASP (I've tried with one encode of the source and got the error, deleted all my files and started again).

I have muxed a few files containing H.264 and they are fine, but it seems it doesn't like ASP, unless anyone else does not got an error, then it's a problem on my part somewhere.

Here's the relevant info.

Batch for encoding/VFR/muxing
Code:
xvid_encraw.exe -i Video1.avs -type 2 -w 720 -h 576 -o "pass1.m4v" -max_bframes 2 -bquant_ratio 150 -bquant_offset 100 -bitrate 631 -pass1 "xvidstats.log" -full1pass -max_key_interval 480 -quality 6 -vhqmode 4 -bvhq -qtype 0 -nopacked -imin 2 -imax 31 -bmin 2 -bmax 31 -pmin 2 -pmax 31 -progress 25
xvid_encraw.exe -i Video1.avs -type 2 -w 720 -h 576 -o "pass2.m4v" -max_bframes 2 -bquant_ratio 150 -bquant_offset 100 -bitrate 631 -pass2 "xvidstats.log" -max_key_interval 480 -kboost 10 -kthresh 1 -kreduction 20 -ostrength 0 -oimprove 5 -odegrade 5 -chigh 0 -clow 0 -quality 6 -vhqmode 4 -bvhq -qtype 0 -nopacked -imin 2 -imax 31 -bmin 2 -bmax 31 -pmin 2 -pmax 31 -progress 25
mp4box.exe -add pass2.m4v:par=64:45 in.mp4
tc2mp4.exe -i in.mp4 -t times.txt -o out.mp4
mp4box.exe -add hackaud.mp3:lang=jpn:name="MPEG-1 Layer 3 2.0 (Stereo)" -chap Chapter.chp -name 1="MPEG-4 Advanced Simple Profile @ Level 5 - 16/9" -lang 1=jpn out.mp4
pause
Output in CMD
Code:
C:\Documents and Settings\Michael\Desktop\enc>xvid_encraw.exe -i Video1.avs -typ
e 2 -w 720 -h 576 -o "pass1.m4v" -max_bframes 2 -bquant_ratio 150 -bquant_offset
 100 -bitrate 631 -pass1 "xvidstats.log" -full1pass -max_key_interval 480 -quali
ty 6 -vhqmode 4 -bvhq -qtype 0 -nopacked -imin 2 -imax 31 -bmin 2 -bmax 31 -pmin
 2 -pmax 31 -progress 25
xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003


Input colorspace is YV12
xvidcore build version: xvid-1.2.0-dev
Bitstream version: 1.2.-127
Detected CPU flags: ASM MMX MMXEXT SSE SSE2 3DNOW 3DNOWEXT TSC
Detected 1 cpus, using 1 threads.
  21876 frames( 99%) encoded,  13.96 fps, Average Bitrate =  1323kbps
Tot: enctime(ms) =1567377.00,               length(bytes) = 151071363
Avg: enctime(ms) =  71.62, fps =  13.96, length(bytes) =    6902
I frames:    322 frames, size =   36095/11622701, quants =  2 / 2.00 /  2
P frames:   8083 frames, size =   13573/109712744, quants =  2 / 2.00 /  2
B frames:  13479 frames, size =    2206/29735918, quants =  4 / 4.00 /  4

C:\Documents and Settings\Michael\Desktop\enc>xvid_encraw.exe -i Video1.avs -typ
e 2 -w 720 -h 576 -o "pass2.m4v" -max_bframes 2 -bquant_ratio 150 -bquant_offset
 100 -bitrate 631 -pass2 "xvidstats.log" -max_key_interval 480 -kboost 10 -kthre
sh 1 -kreduction 20 -ostrength 0 -oimprove 5 -odegrade 5 -chigh 0 -clow 0 -quali
ty 6 -vhqmode 4 -bvhq -qtype 0 -nopacked -imin 2 -imax 31 -bmin 2 -bmax 31 -pmin
 2 -pmax 31 -progress 25
xvid_encraw - raw mpeg4 bitstream encoder written by Christoph Lampert 2002-2003


Input colorspace is YV12
xvidcore build version: xvid-1.2.0-dev
Bitstream version: 1.2.-127
Detected CPU flags: ASM MMX MMXEXT SSE SSE2 3DNOW 3DNOWEXT TSC
Detected 1 cpus, using 1 threads.
  21876 frames( 99%) encoded,  15.95 fps, Average Bitrate =   665kbps
Tot: enctime(ms) =1372638.00,               length(bytes) = 75895490
Avg: enctime(ms) =  62.72, fps =  15.94, length(bytes) =    3467
I frames:    322 frames, size =   24370/7847320, quants =  2 / 3.39 /  4
P frames:   8083 frames, size =    6458/52202983, quants =  3 / 4.23 /  5
B frames:  13479 frames, size =    1175/15845187, quants =  5 / 7.13 /  9

C:\Documents and Settings\Michael\Desktop\enc>mp4box.exe -add pass2.m4v:par=64:4
5 in.mp4
MPEG-4 Video import - 720 x 576 @ 25.0000 FPS
Indicated Profile: Advanced Simple Profile @ Level 5
Has B-Frames (2 max consecutive B-VOPs)
Import results: 21884 VOPs (322 Is - 8083 Ps - 13479 Bs)
Converting to ISMA Audio-Video MP4 file...
Saving to in.mp4: 0.500 secs Interleaving

C:\Documents and Settings\Michael\Desktop\enc>tc2mp4.exe -i in.mp4 -t times.txt
-o out.mp4
mp4box -nhml 1 in.mp4
[Timecode info]
  Timecode format(v2)
  Total frames(21884), Timescale(1000000)
[NHML info]
  Timebase(0)
Illegal division by zero at script/tc2mp4.pl line 94, <SRC_NHML> line 3.

C:\Documents and Settings\Michael\Desktop\enc>mp4box.exe -add hackaud.mp3:lang=j
pn:name="MPEG-1 Layer 3 2.0 (Stereo)" -chap Chapter.chp -name 1="MPEG-4 Advanced
 Simple Profile @ Level 5 - 16/9" -lang 1=jpn out.mp4
MP3 import - sample rate 48000 - MPEG-1 audio - 2 channels
Saving to out.mp4: 0.500 secs Interleaving
I can provide the timecode file if needed; in theory it should be the same as the one I used when muxing the H.264, but I can't remember if I changed any filtering settings (which would alter detection).
The message is old, but I will answer anyway. It's giving that error because the script will imply that the video track ID is 1, while it's not always 1. For example if you have ASP muxed by MP4Box, it could be 201. I have modified the script so that I can specify the videeo track ID on the command line, if you want I can post it.
In any case you can make the script work by modifying the lines 15,16 and 18. Replace "1" with your video track ID.
giandrea is offline   Reply With Quote
Old 22nd November 2006, 22:38   #30  |  Link
Zero1
Two bit encoder
 
Zero1's Avatar
 
Join Date: May 2005
Location: England, UK
Posts: 157
Hey, thanks for that. It's much appreciated.

I shall try that out at some point
Zero1 is offline   Reply With Quote
Old 26th November 2006, 15:56   #31  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
The message is old, but I will answer anyway. It's giving that error because the script will imply that the video track ID is 1, while it's not always 1. For example if you have ASP muxed by MP4Box, it could be 201. I have modified the script so that I can specify the videeo track ID on the command line, if you want I can post it.
In any case you can make the script work by modifying the lines 15,16 and 18. Replace "1" with your video track ID.
I got the same problem, but i get the same error message after changing 1 to 201 (in tc2mp4.pl):
Code:
$srcNHML = "${basename}_track201.nhml";
$tcNHML = "${basename}_track201_tc.nhml";

doCmd("mp4box -nhml 201 $srcMP4");
Accordingly to mp4box the video id is indeed 201:
Code:
Track # 1 Info - TrackID 201 - TimeScale 24000 - Duration 00:01:38.348
Media Info: Language "Undetermined" - Type "vide" - Sub Type "mp4v" - 2358 samples
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x20
MPEG-4 Visual Size 848 x 352 - Advanced Simple Profile @ Level 5
Pixel Aspect Ratio 1:1 - Indicated track size 848 x 352
Synchronized on stream 1
Wilbert is offline   Reply With Quote
Old 9th December 2006, 15:28   #32  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
I got the same problem, but i get the same error message after changing 1 to 201 (in tc2mp4.pl):
(...)
bump Nobody?

Is it possible to change the video id of a mp4 file to 1?
Wilbert is offline   Reply With Quote
Old 13th December 2006, 01:56   #33  |  Link
giandrea
Registered User
 
Join Date: Sep 2004
Location: Italy
Posts: 154
Quote:
Originally Posted by Wilbert View Post
bump Nobody?

Is it possible to change the video id of a mp4 file to 1?
Sorry, don't know... try to double check your inputs and outputs. Anyway the only time I tried this script on a full length movie, it started to slow down after 40% of the process, and then slowed down to halt at around 50%. I had to force quit the process. I think it's a bug or a memory leak...
giandrea is offline   Reply With Quote
Old 16th December 2006, 20:57   #34  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Ok. I hope you find out the problem one day.
Quote:
The message is old, but I will answer anyway. It's giving that error because the script will imply that the video track ID is 1, while it's not always 1. For example if you have ASP muxed by MP4Box, it could be 201. I have modified the script so that I can specify the videeo track ID on the command line, if you want I can post it.
Could you post this modified script?
Wilbert is offline   Reply With Quote
Old 16th January 2007, 22:21   #35  |  Link
martino
masktools2 (ab)user
 
martino's Avatar
 
Join Date: Oct 2006
Location: PAL-I :(
Posts: 235
I keep getting an error:

Code:
C:\Program Files\video creation\video tools\tc2mp4>tc2mp4 -i "y:\02_30fps.mp4" -
t "y:\2.txt" -o "y:\02_vfr_correct.mp4"
mp4box -nhml 1 "y:\02_30fps.mp4"
[Timecode info]
  Timecode format(v1)
  Total frames(8650), LCM Timescale(120000)
  NTSC, Factors(120000/24000/30000)
y:\02_30fps_track1.nhml[NHML info]
  Timebase(0)
Illegal division by zero at script/tc2mp4.pl line 96, <SRC_NHML> line 3.
UPDATE: After some reading it looks like I wasn't the first one with this error, therefore I second a request for that script please.

Last edited by martino; 17th January 2007 at 22:58. Reason: updated
martino is offline   Reply With Quote
Old 19th February 2007, 07:50   #36  |  Link
ballofsnow
Registered User
 
Join Date: Oct 2005
Posts: 6
Can someone upload tc2mp4 again? The rapidshare links have expired.
ballofsnow is offline   Reply With Quote
Old 12th March 2007, 17:55   #37  |  Link
zmi
Registered User
 
Join Date: May 2006
Location: Yokohama, Japan
Posts: 6
Sorry for the long absence.
I posted an updated script to http://forum.doom9.org/showthread.php?t=112199

thank you.
zmi is offline   Reply With Quote
Old 6th November 2009, 14:53   #38  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
Not sure if there is much interest in this anymore, but I've recently wanted to create a VFR MP4 with MKV V2 timecodes. I tried your script zmi, but as people here have noted, it seem inaccurate. So I created my own version which seems to be accurate. The outputed timecodes once I converted to VFR MP4 back to MKV were practically the same (minor rounding errors). I don't think it's ready to be posted yet as it isn't very modular code yet and I write crappy code , but I was wondering if anyone has samples they could provide for me so that I can test to see if I got it down correct.

I need both video and audio nhml since VRF in the video will introduce a big CTS offset that also needs to be applied to the audio in order to be synced. I also need to know the original CFR.

Also, thanks a lot, zmi, for your script as that is what my version was based off of.

Last edited by Aktan; 6th November 2009 at 16:13.
Aktan is offline   Reply With Quote
Old 15th August 2010, 02:02   #39  |  Link
stitchix
Registered User
 
Join Date: Aug 2010
Posts: 1
Please re-upload archive tc2mp4_20070124.rar
Thanks.
stitchix is offline   Reply With Quote
Old 15th August 2010, 02:45   #40  |  Link
Aktan
Registered User
 
Join Date: Feb 2002
Posts: 303
Quote:
Originally Posted by stitchix View Post
Please re-upload archive tc2mp4_20070124.rar
Thanks.
[shameless advertise]
you can try out my version of his script here:
http://forum.doom9.org/showthread.php?t=150890
[/shameless advertise]
Aktan is offline   Reply With Quote
Reply


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 17:11.


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