News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: [Technical] [PS2] Modifying .mpg cut-scene files to add subtitles  (Read 1241 times)

Risae

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Hi!

i am currently trying to add subtitles to .mpg files which contain the cut-scenes of the game "Growlanser 6: Precarious World".

I looked at the information of the files and got the following:

Code: [Select]
General
Complete name                            : 00000012.mpg
Format                                   : MPEG-PS
File size                                : 63.7 MiB
Duration                                 : 1 min 6 s
Overall bit rate mode                    : Variable
Overall bit rate                         : 8 091 kb/s
Writing library                          : encoded by TMPGEnc (ver. 2.524.63.181)

Video
ID                                       : 224 (0xE0)
Format                                   : MPEG Video
Format version                           : Version 2
Format profile                           : Main@Main
Format settings                          : CustomMatrix / BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : Variable
Duration                                 : 1 min 6 s
Bit rate mode                            : Variable
Bit rate                                 : 6 394 kb/s
Maximum bit rate                         : 15.0 Mb/s
Width                                    : 640 pixels
Height                                   : 448 pixels
Display aspect ratio                     : 1.429
Frame rate                               : 29.970 (30000/1001) FPS
Standard                                 : NTSC
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.744
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
Stream size                              : 50.4 MiB (79%)
Writing library                          : TMPGEnc 2.524.63.181
Color primaries                          : BT.601 NTSC
Transfer characteristics                 : BT.601
Matrix coefficients                      : BT.601

Audio
ID                                       : 189 (0xBD)
Format                                   : PCM
Muxing mode                              : PS2
Duration                                 : 1 min 6 s
Bit rate                                 : 1 536 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Stream size                              : 12.1 MiB (19%)

I tried to use FFmpeg to slip-stream the .ass/srt file that i created with Aegisub into .mpg with the following command:

Code: [Select]
ffmpeg -i 00000012.mpg -vf ass=00000012.ass -b:v 6000k -target ntsc-dvd sub00000012.mpg

pause

But after re-inserting the file into the game, i only got a black screen while the game tried to play the video file.

Does anybody have an idea how i could add subtitles to the .mpg file?

Naldrag

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: [Technical] [PS2] Modifying .mpg cut-scene files to add subtitles
« Reply #1 on: April 02, 2020, 10:59:20 am »
If you could send me over the .mpg files I could try to convert your subs into PNGs and try to render it with similar settings in VEGAS.  I can't guarantee that'll make them work in the ISO but, it could be worth a shot.

Risae

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: [Technical] [PS2] Modifying .mpg cut-scene files to add subtitles
« Reply #2 on: April 03, 2020, 06:52:29 pm »
Hi Naldrag,

thank you very much for your assistance, i will send you a PM later with the file!

Naldrag

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: [Technical] [PS2] Modifying .mpg cut-scene files to add subtitles
« Reply #3 on: April 03, 2020, 07:37:22 pm »
Alright sounds good.

Gemini

  • Hero Member
  • *****
  • Posts: 2022
  • 時を越えよう、そして彼女の元に戻ろう
    • View Profile
    • Apple of Eden
Re: [Technical] [PS2] Modifying .mpg cut-scene files to add subtitles
« Reply #4 on: April 04, 2020, 01:47:43 am »
Make sure to investigate the file with ffprobe to see the exact format of the video source. The back screen could be either an incorrect decoding or a variation of mp2.
I am the lord, you all know my name, now. I got it all: cash, money, and fame.

Risae

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: [Technical] [PS2] Modifying .mpg cut-scene files to add subtitles
« Reply #5 on: April 04, 2020, 06:28:22 am »
Make sure to investigate the file with ffprobe to see the exact format of the video source. The back screen could be either an incorrect decoding or a variation of mp2.


Hi Gemini,

thank you for your reply, i didn't know about ffprobe yet.
Using

Code: [Select]
ffprobe -v quiet -print_format json -show_format -show_streams "00000012.mpg" > "00000012.mpg.json"

i got the following Information:

Code: [Select]
{
    "streams": [
        {
            "index": 0,
            "codec_name": "mpeg2video",
            "codec_long_name": "MPEG-2 video",
            "profile": "Main",
            "codec_type": "video",
            "codec_time_base": "1001/30000",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 640,
            "height": 448,
            "coded_width": 0,
            "coded_height": 0,
            "has_b_frames": 1,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "10:7",
            "pix_fmt": "yuv420p",
            "level": 8,
            "color_range": "tv",
            "color_space": "smpte170m",
            "color_transfer": "smpte170m",
            "color_primaries": "smpte170m",
            "chroma_location": "left",
            "field_order": "progressive",
            "refs": 1,
            "id": "0x1e0",
            "r_frame_rate": "30000/1001",
            "avg_frame_rate": "30000/1001",
            "time_base": "1/90000",
            "start_pts": 3452,
            "start_time": "0.038356",
            "duration_ts": 5945940,
            "duration": "66.066000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            },
            "side_data_list": [
                {
                    "side_data_type": "CPB properties"
                }
            ]
        }
    ],
    "format": {
        "filename": "00000012.mpg",
        "nb_streams": 1,
        "nb_programs": 0,
        "format_name": "mpeg",
        "format_long_name": "MPEG-PS (MPEG-2 Program Stream)",
        "start_time": "0.038356",
        "duration": "66.066000",
        "size": "66813956",
        "bit_rate": "8090570",
        "probe_score": 26
    }
}

How would you go about using that provided information in modifying that file?
I have very limited knowledge regarding video editing.
« Last Edit: April 04, 2020, 07:21:04 am by Risae »

tvtoon

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: [Technical] [PS2] Modifying .mpg cut-scene files to add subtitles
« Reply #6 on: April 05, 2020, 09:58:15 pm »
I don't know about working with JSON files, but there are 2 things you should be aware, when using ffmpeg: options come before input files, and the conversion is really picky about the minor details. It is important to keep them in mind because stuff that nobody will mention, like Screen Aspect Ratio, is critical to any conversion purpose, so setting something for output when it should be for input files will give the wrong result to you, so check them carefully and try them with ffplay (not mplayer, VLC etc) to get the most accurate result. ;)

Risae

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: [Technical] [PS2] Modifying .mpg cut-scene files to add subtitles
« Reply #7 on: April 09, 2020, 06:47:53 am »
I don't know about working with JSON files, but there are 2 things you should be aware, when using ffmpeg: options come before input files, and the conversion is really picky about the minor details. It is important to keep them in mind because stuff that nobody will mention, like Screen Aspect Ratio, is critical to any conversion purpose, so setting something for output when it should be for input files will give the wrong result to you, so check them carefully and try them with ffplay (not mplayer, VLC etc) to get the most accurate result. ;)

Hi tvtoon!

Thank you for the explanation about options on ffmpeg. I didn't know that it was very picky about that.
Did i do something wrong with my command? I don't believe i put the options in the wrong place, or?

April 09, 2020, 07:23:47 am - (Auto Merged - Double Posts are not allowed before 7 days.)
I wanted to give an update on the progress:

Naldrag managed to do the following:

Quote
I'm using GIMP to make an image file with no background at 640 x 448 and using it's text tool to make the subtitles and I'm using VEGAS 14.

Using the following encoding options:

Spoiler:

Spoiler:

Spoiler:

The video file successfully displays the subtitles ingame!
But, sadly the audio is not working anymore.
He tried to

- create a new audio stream on top of it, since Vegas doesn't seem to be able to import the last audio stream?
- add a recorded audio stream of the ingame audio to the new video file

Sadly both of those didn't work.
Anybody got an idea what we could do to let the audio still work or experience with video files in a ps2 game that are split up between video and audio?
« Last Edit: April 09, 2020, 07:23:48 am by Risae »

Naldrag

  • Jr. Member
  • **
  • Posts: 27
    • View Profile
Re: [Technical] [PS2] Modifying .mpg cut-scene files to add subtitles
« Reply #8 on: April 10, 2020, 01:07:19 pm »
I want to say the biggest problem I had with rendering is that the original files were encoded with TMPGEnc, which I don't have that particular encoder and it doesn't come with VEGAS.  (not even sure if VEGAS supports it)

I did see a thing where someone else what having issues with subbing with ffmpeg and there might be a command that'll do it

Code: [Select]
ffmpeg -i ###.mpg -vf "subtitles=subtitle.srt" ###.mpg
I'm hoping that'll help.