MKV to MPG2 NTSC DVD Compliant files - How?
Posted: Wed Nov 14, 2007 5:16 pm
To the experts... I have after many attempts been unable to output an NTSC DVD Compliant mpg file. I have used Extensions, have changed values in Settings and done everything I can find to do after about 12 attempts. I have searched and read all the Forum posts and Tips, as well as googled for answers. I have around 30 hours into this now, so I feel justified in asking for help.
My last attempt was directly after a fresh install of 3945, the latest version.
The video, audio and subtitles of the output file are of decent quality. The file format is non-compliant. It will play in VLC, but will not play in Media Player Classic (hangs). When I import to DVD Architect, the aspect ratio is incorrect until I force the settings in the project, however, it does display it properly
afterwards.
Please look at the information provided below and tell me what needs to be changed, or provide a list of settings in MediaCoder that will result in DVD Compliant files. I really want to use MediaCoder because it is the only app that can hardcode subs directly from MKV to MPG, and if the files were compliant, it would save my having to encode from MKV to AVI and then re-encode the subs before creating the mpgs, adding 1.5 hours to burning every episode.
I have been using DVDFlick for about 3 months and have burned about 300 anime episodes, and every output file was DVD Compliant. In fact, I never even knew the term DVD Compliant until I tried MediaCoder. DVDFlick of course front ends FFMPEG as does MediaCoder, so the encoder is not the issue. It is just a matter of FFMPEG switches (I can provide the DVDFlick log entry with command line if desired, that produces compliant files).
My system is WinXP SP2, and all other information is listed below.
INFO PROVIDED
===========
Settings
Tabs (Right, Left)
Expert Tabs (ffmpeg command lines for video and audio)
Input File Details
Output File Details
Logger (since app initiation)
Note: Bug on Frame Rate in New Version
Settings > Video Encoders > FFMPEG
------------------------------------------
Target format dvd
Extra Options String -r 29.976 (Frame Rate setting in tabs no longer works in current version*)
Left Tabs
-----------
Summary
-----------
Container: MPEG2
Video: MPEG2
Bitrate: 3200 Kbps
Resolution: Original
Audio: FFMPEG Audio Codecs
Audio: 192 Kbps
Estimated Size: 608 MB
Audio
-------
Source: (selected) Auto Select
Encoder: FFPMEG
Resample: Original
Channel: Stereo
Gain: 0 dB
Audio ID: 0
(selected) Enable Audio
(unselected) Copy Audio
(unselected) Normalize
Video
------
Mode: Bitrate Based (selected) Enable Video
3200 Kbps
Format: MPEG2
Container: MPEG2
Source MEncoder
Backend: FFMPEG
(unselected) all other options
Muxer
-------
(selected) Auto Select
(MP4Box)
Picture
--------
Resize: 720x480 (unselected) Global
Crop: disabled
Frame Rate (unselected) (setting no longer works in new version, set manually in Settings*)
Aspect Ratio: 16:9
(unselected) all other options
Subtitles
----------
Language: en
ID: 0
Font: Lexia (TrueType)
Scale: Movie Height
Right Tabs
------------
FFMPEG
---------
Audio Format: AC3
Bitrate: 192 Kbps
Expert Tabs > Audio Options
---------------------------------
".\codecs\ffmpeg.exe" -i - -acodec ac3 -ab 192000 "$(DestFile)"
Expert Tabs > Video Options
---------------------------------
[1] ".\codecs\ffmpeg.exe" -y -f s16le -ar 48000 -ac 2 -i pipe:0 -f yuv4mpegpipe -i - -f dvd -vcodec mpeg2video -me full -me_range 16 -mbd 1 -qmin 2 -qmax 31 -b $(VideoBitrate*1K) -s 720x480 -aspect 16:9 -r 29.976 -refs 5 -ac 2 -ab 192000 -acodec ac3 "$(DestFile)"
INPUT FILE Details (MediaCoder > Properties)
-----------------------------------------------------
General #0
Complete name :
G:\VIDEO_TEMP\[AnY-Nanashi]_Ichigo_Mashimaro_OVA_-_01_[H264_AAC_Softsubs][F5087A7B].mkv
Format : Matroska
File size : 168 MiB
PlayTime : 25mn 4s
Bit rate : 936 Kbps
Encoded date : UTC 2007-04-08 21:37:45
Writing application : mkvmerge v2.0.2 ('You're My Flame') built on Feb 21 2007 23:40:55
Writing library : libebml v0.7.7 + libmatroska v0.8.1
Cover : Main Font / Main Font
Video #0
Codec : MPEG-4 AVC
Codec/Info : MPEG4 ISO advanced profile
PlayTime : 25mn 2s
Width : 768 pixels
Height : 432 pixels
Aspect ratio : 16/9
Frame rate : 23.976 fps
Title : Main Video
Language : Japanese
Audio #0
Codec : A_AAC
Channel(s) : 2 channels
Sampling rate : 48 KHz
Title : Main Audio
Language : Japanese
Text #0
Codec : ***
Codec/Info : Advanced Sub Station Alpha
Title : Subtitles
Language : English
Chapters #0
Language : Japanese
1 : 00:00:00.000 Opening Start
2 : 00:01:40.058 Part A
3 : 00:12:24.035 Eyecatch
4 : 00:12:35.004 Part B
5 : 00:23:03.966 Ending
6 : 00:24:37.142 Preview
OUTPUT FILE Details (MediaInfo)
-------------------------------------
General #0
Complete name : G:\VIDEO_TEMP\TEMP
mediacoder\[AnY-Nanashi]_Ichigo_Mashimaro_OVA_-_01_[H264_AAC_Softsubs][F5087A7B].mpg
Format : MPEG-2 Program
Format/Family : MPEG-2
File size : 422 MiB
PlayTime : 24mn 59s
Bit rate : 2361 Kbps
Video #0
Codec : MPEG-2 Video
Codec profile : Main@Main
Codec settings/Matri : Standard
PlayTime : 24mn 59s
Bit rate : 2123 Kbps
Bit rate mode : VBR
Width : 720 pixels
Height : 480 pixels
Display Aspect ratio : 16/9
Frame rate : 29.970 fps
Standard : NTSC
Chroma : 4:2:0
Interlacement : Progressive
Bits/(Pixel*Frame) : 0.205
Audio #0
Codec : AC3
PlayTime : 24mn 59s
Bit rate : 192 Kbps
Bit rate mode : CBR
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48 KHz
Menu #0
Codec : DVD-Video
LOGGER OUTPUT
-------------------
[10-13 22:57:26] [HTTPd] Attempting to start built-in HTTPd on port 19819
[10-13 22:57:26] [HTTPd] Built-in HTTPd started on port 19819
[10-13 22:57:26] Scanning plugins
[10-13 22:57:26] Initialized
[10-13 23:00:23] [httpd] 'videoenc.ffmpeg.format' set to 'dvd'
[10-13 23:09:18] [httpd] 'videofilter.frame.fps' set to '29.97'
[10-13 23:14:08] [httpd] 'videoenc.ffmpeg.options' set to '-r 29.976'
[10-13 23:15:18] Start transcoding job for
G:\VIDEO_TEMP\[AnY-Nanashi]_Ichigo_Mashimaro_OVA_-_01_[H264_AAC_Softsubs][F5087A7B].mkv
[10-14 00:15:36] Encoder terminated unexpectedly.
[10-14 00:15:36] FFMPEG unloaded
[10-14 00:15:36] Finished transcoding job for
G:\VIDEO_TEMP\[AnY-Nanashi]_Ichigo_Mashimaro_OVA_-_01_[H264_AAC_Softsubs][F5087A7B].mkv
*Note: Bug on Framerate in New Version
-----------------------------------------------
In the previous version I was using, 3905, setting the frame rate in the Picture tab would update the Summary tab to the same value. The value was 29.97. In the new version, selecting a Frame Rate in Picture does not update the Summary. Also, the Frame Rate is given as 29.970, which is a
non-standard frame rate.
Apparently, the framerate does get entered on the command line, but it is the non-standard value of 29.970, requiring that the frame rate be manually overriden in Settings. It is unknown to me which value ffmpeg uses, although if the Target Format is set to "dvd", it should choose the standard rate in any case.
I didn't document it, but I believe if you look at the data, you'll see that the Resolution also no longer updates in the Summary tab in the new version.
My last attempt was directly after a fresh install of 3945, the latest version.
The video, audio and subtitles of the output file are of decent quality. The file format is non-compliant. It will play in VLC, but will not play in Media Player Classic (hangs). When I import to DVD Architect, the aspect ratio is incorrect until I force the settings in the project, however, it does display it properly
afterwards.
Please look at the information provided below and tell me what needs to be changed, or provide a list of settings in MediaCoder that will result in DVD Compliant files. I really want to use MediaCoder because it is the only app that can hardcode subs directly from MKV to MPG, and if the files were compliant, it would save my having to encode from MKV to AVI and then re-encode the subs before creating the mpgs, adding 1.5 hours to burning every episode.
I have been using DVDFlick for about 3 months and have burned about 300 anime episodes, and every output file was DVD Compliant. In fact, I never even knew the term DVD Compliant until I tried MediaCoder. DVDFlick of course front ends FFMPEG as does MediaCoder, so the encoder is not the issue. It is just a matter of FFMPEG switches (I can provide the DVDFlick log entry with command line if desired, that produces compliant files).
My system is WinXP SP2, and all other information is listed below.
INFO PROVIDED
===========
Settings
Tabs (Right, Left)
Expert Tabs (ffmpeg command lines for video and audio)
Input File Details
Output File Details
Logger (since app initiation)
Note: Bug on Frame Rate in New Version
Settings > Video Encoders > FFMPEG
------------------------------------------
Target format dvd
Extra Options String -r 29.976 (Frame Rate setting in tabs no longer works in current version*)
Left Tabs
-----------
Summary
-----------
Container: MPEG2
Video: MPEG2
Bitrate: 3200 Kbps
Resolution: Original
Audio: FFMPEG Audio Codecs
Audio: 192 Kbps
Estimated Size: 608 MB
Audio
-------
Source: (selected) Auto Select
Encoder: FFPMEG
Resample: Original
Channel: Stereo
Gain: 0 dB
Audio ID: 0
(selected) Enable Audio
(unselected) Copy Audio
(unselected) Normalize
Video
------
Mode: Bitrate Based (selected) Enable Video
3200 Kbps
Format: MPEG2
Container: MPEG2
Source MEncoder
Backend: FFMPEG
(unselected) all other options
Muxer
-------
(selected) Auto Select
(MP4Box)
Picture
--------
Resize: 720x480 (unselected) Global
Crop: disabled
Frame Rate (unselected) (setting no longer works in new version, set manually in Settings*)
Aspect Ratio: 16:9
(unselected) all other options
Subtitles
----------
Language: en
ID: 0
Font: Lexia (TrueType)
Scale: Movie Height
Right Tabs
------------
FFMPEG
---------
Audio Format: AC3
Bitrate: 192 Kbps
Expert Tabs > Audio Options
---------------------------------
".\codecs\ffmpeg.exe" -i - -acodec ac3 -ab 192000 "$(DestFile)"
Expert Tabs > Video Options
---------------------------------
[1] ".\codecs\ffmpeg.exe" -y -f s16le -ar 48000 -ac 2 -i pipe:0 -f yuv4mpegpipe -i - -f dvd -vcodec mpeg2video -me full -me_range 16 -mbd 1 -qmin 2 -qmax 31 -b $(VideoBitrate*1K) -s 720x480 -aspect 16:9 -r 29.976 -refs 5 -ac 2 -ab 192000 -acodec ac3 "$(DestFile)"
INPUT FILE Details (MediaCoder > Properties)
-----------------------------------------------------
General #0
Complete name :
G:\VIDEO_TEMP\[AnY-Nanashi]_Ichigo_Mashimaro_OVA_-_01_[H264_AAC_Softsubs][F5087A7B].mkv
Format : Matroska
File size : 168 MiB
PlayTime : 25mn 4s
Bit rate : 936 Kbps
Encoded date : UTC 2007-04-08 21:37:45
Writing application : mkvmerge v2.0.2 ('You're My Flame') built on Feb 21 2007 23:40:55
Writing library : libebml v0.7.7 + libmatroska v0.8.1
Cover : Main Font / Main Font
Video #0
Codec : MPEG-4 AVC
Codec/Info : MPEG4 ISO advanced profile
PlayTime : 25mn 2s
Width : 768 pixels
Height : 432 pixels
Aspect ratio : 16/9
Frame rate : 23.976 fps
Title : Main Video
Language : Japanese
Audio #0
Codec : A_AAC
Channel(s) : 2 channels
Sampling rate : 48 KHz
Title : Main Audio
Language : Japanese
Text #0
Codec : ***
Codec/Info : Advanced Sub Station Alpha
Title : Subtitles
Language : English
Chapters #0
Language : Japanese
1 : 00:00:00.000 Opening Start
2 : 00:01:40.058 Part A
3 : 00:12:24.035 Eyecatch
4 : 00:12:35.004 Part B
5 : 00:23:03.966 Ending
6 : 00:24:37.142 Preview
OUTPUT FILE Details (MediaInfo)
-------------------------------------
General #0
Complete name : G:\VIDEO_TEMP\TEMP
mediacoder\[AnY-Nanashi]_Ichigo_Mashimaro_OVA_-_01_[H264_AAC_Softsubs][F5087A7B].mpg
Format : MPEG-2 Program
Format/Family : MPEG-2
File size : 422 MiB
PlayTime : 24mn 59s
Bit rate : 2361 Kbps
Video #0
Codec : MPEG-2 Video
Codec profile : Main@Main
Codec settings/Matri : Standard
PlayTime : 24mn 59s
Bit rate : 2123 Kbps
Bit rate mode : VBR
Width : 720 pixels
Height : 480 pixels
Display Aspect ratio : 16/9
Frame rate : 29.970 fps
Standard : NTSC
Chroma : 4:2:0
Interlacement : Progressive
Bits/(Pixel*Frame) : 0.205
Audio #0
Codec : AC3
PlayTime : 24mn 59s
Bit rate : 192 Kbps
Bit rate mode : CBR
Channel(s) : 2 channels
Channel positions : L R
Sampling rate : 48 KHz
Menu #0
Codec : DVD-Video
LOGGER OUTPUT
-------------------
[10-13 22:57:26] [HTTPd] Attempting to start built-in HTTPd on port 19819
[10-13 22:57:26] [HTTPd] Built-in HTTPd started on port 19819
[10-13 22:57:26] Scanning plugins
[10-13 22:57:26] Initialized
[10-13 23:00:23] [httpd] 'videoenc.ffmpeg.format' set to 'dvd'
[10-13 23:09:18] [httpd] 'videofilter.frame.fps' set to '29.97'
[10-13 23:14:08] [httpd] 'videoenc.ffmpeg.options' set to '-r 29.976'
[10-13 23:15:18] Start transcoding job for
G:\VIDEO_TEMP\[AnY-Nanashi]_Ichigo_Mashimaro_OVA_-_01_[H264_AAC_Softsubs][F5087A7B].mkv
[10-14 00:15:36] Encoder terminated unexpectedly.
[10-14 00:15:36] FFMPEG unloaded
[10-14 00:15:36] Finished transcoding job for
G:\VIDEO_TEMP\[AnY-Nanashi]_Ichigo_Mashimaro_OVA_-_01_[H264_AAC_Softsubs][F5087A7B].mkv
*Note: Bug on Framerate in New Version
-----------------------------------------------
In the previous version I was using, 3905, setting the frame rate in the Picture tab would update the Summary tab to the same value. The value was 29.97. In the new version, selecting a Frame Rate in Picture does not update the Summary. Also, the Frame Rate is given as 29.970, which is a
non-standard frame rate.
Apparently, the framerate does get entered on the command line, but it is the non-standard value of 29.970, requiring that the frame rate be manually overriden in Settings. It is unknown to me which value ffmpeg uses, although if the Target Format is set to "dvd", it should choose the standard rate in any case.
I didn't document it, but I believe if you look at the data, you'll see that the Resolution also no longer updates in the Summary tab in the new version.