VideoHelp Forum
+ Reply to Thread
Results 1 to 13 of 13
Thread
  1. Hello, I need your help:
    I've a XML file which extracted from TS file by ffmpeg (it shows bin_data), I think it's subtitles because it's time, ex 00:00:17.000.
    I've tried to use Subtitle Edit to convert but it just show 1 line, I think because the XML has only line.
    So can you help me to convert this XML to ASS or SRT? If you can, can you show me how to extract that XML like this?
    Thanks for your reading, and hope you will reply soon.
    that data tracks info:
    Code:
     Stream #0:2[0x1c00]: Data: bin_data ([6][0][0][0] / 0x0006)
    command i use to extract that xml:
    Code:
    ffmpeg -i input.m2ts -map 0:2 -c copy -copy_unknown -f data test.xml
    test.xml
    Quote Quote  
  2. Feels Good Man 2nHxWW6GkN1l916N3ayz8HQoi's Avatar
    Join Date
    Jan 2024
    Location
    Pepe Island
    Search Comp PM
    Could you upload somewhere the ts file?
    --[----->+<]>.++++++++++++.---.--------.
    [*Have questions about widefrog? You can find all your answers here*]
    Quote Quote  
  3. I doubt the problem is that everything is in one line.
    That xml has some strange character in it, which probably cause the problems.
    Here's an exert:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <tt
    	xmlns="http://www.w3.org/ns/ttml"
    	xmlns:arib-tt="http://www.arib.or.jp/ns/arib-ttml/v1_0"
    	xmlns:tts="http://www.w3.org/ns/ttml#styling" xml:lang="ja">
    	<head>
    		<styling>
    			<style xml:id="writingMode1" tts:writingMode="lrtb" />
    			<style xml:id="fontFamily1" tts:fontFamily="丸ゴシック" tts:fontStyle="normal" tts:fontWeight="normal" />
    			<style xml:id="normalSize1" tts:fontSize="144px 144px" tts:lineHeight="240px" arib-tt:letter-spacing="16px" />
    			<style xml:id="foreColor1" tts:color="#FFFF00FF" />
    			<style xml:id="backColor1" tts:backgroundColor="#00000080" />
    			<style xml:id="middleSize1" tts:fontSize="72px 144px" tts:lineHeight="240px" arib-tt:letter-spacing="8px" />
    		</styling>
    		<layout>
    			<region xml:id="r1170" tts:extent="1040px 240px" tts:origin="552px 1556px" />
    			<region xml:id="r1180" tts:extent="2640px 240px" tts:origin="632px 1796px" />
    		</layout>
    	</head>
    	<body>
    		<div begin="00:06:58.334" end="00:07:03.834">
    			<p xml:id="P790-1" region="r1170">
    				<span xml:id="S790-1" style="writingMode1 fontFamily1 normalSize1 foreColor1 backColor1">うん?</span>
    				<span xml:id="S790-2" style="writingMode1 fontFamily1 middleSize1 foreColor1 backColor1"></span>
    				<span xml:id="S790-3" style="writingMode1 fontFamily1 normalSize1 foreColor1 backColor1">いや〜</span>
    			</p>
    			<p xml:id="P790-2" region="r1180">
    				<span xml:id="S790-4" style="writingMode1 fontFamily1 normalSize1 foreColor1 backColor1">なかなか</span>
    				<span xml:id="S790-5" style="writingMode1 fontFamily1 middleSize1 foreColor1 backColor1"></span>
    				<span xml:id="S790-6" style="writingMode1 fontFamily1 normalSize1 foreColor1 backColor1">いいとこだよ</span>
    				<span xml:id="S790-7" style="writingMode1 fontFamily1 middleSize1 foreColor1 backColor1"></span>
    				<span xml:id="S790-8" style="writingMode1 fontFamily1 normalSize1 foreColor1 backColor1">ベトナムは</span>
    				<span xml:id="S790-9" style="writingMode1 fontFamily1 middleSize1 foreColor1 backColor1">。</span>
    			</p>
    		</div>
    	</body>
    </tt>  p€   F
    see characters at the end.
    (Attached a more readable version of the xml.)

    Cu Selur
    Image Attached Files
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  4. Originally Posted by 2nHxWW6GkN1l916N3ayz8HQoi View Post
    Could you upload somewhere the ts file?
    Sorry, I can't because the owner prohibited to share.
    Quote Quote  
  5. Originally Posted by Selur View Post
    I doubt the problem is that everything is in one line.
    That xml has some strange character in it, which probably cause the problems.
    Of course, but the problem is the time of subs can't show like xml, do you have any solution?
    Quote Quote  
  6. If Subtitle Edit does not support the (cleaned up) xml format you have, you could either:
    a. ask the Subtitle Edit authors whether they can support your format. Assuming you can show them a specification, since seeing that ffmpeg detects the stream as bin_data it might not be a generally known subtitle format.
    b. write something (in a program language you know yourself) to do the conversion yourself, or search for someone who is willing to do it (maybe for payment). Personally, I don't know enough about the xml formatting that was used and the ass format in detail to write a conversion quickly.

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. Use arib-ts2ass. Find the instructions in the original repository. You may need to fix the output .ASS file by adding [Events] headers before the dialog entries.
    Quote Quote  
  8. Originally Posted by cibo View Post
    Use arib-ts2ass. Find the instructions in the original repository. You may need to fix the output .ASS file by adding [Events] headers before the dialog entries.
    I've installed it but seem it's error
    Code:
    Traceback (most recent call last):
      File "\\?\C:\Users\kien\AppData\Local\Programs\Python\Python312\Scripts\arib-ts2ass-script.py", line 33, in <module>
        sys.exit(load_entry_point('arib==0.6.5', 'console_scripts', 'arib-ts2ass')())
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "\\?\C:\Users\kien\AppData\Local\Programs\Python\Python312\Scripts\arib-ts2ass-script.py", line 25, in importlib_load_entry_point
        return next(matches).load()
               ^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\kien\AppData\Local\Programs\Python\Python312\Lib\importlib\metadata\__init__.py", line 205, in load
        module = import_module(match.group('module'))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "C:\Users\kien\AppData\Local\Programs\Python\Python312\Lib\importlib\__init__.py", line 90, in import_module
        return _bootstrap._gcd_import(name[level:], package, level)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "<frozen importlib._bootstrap>", line 1381, in _gcd_import
      File "<frozen importlib._bootstrap>", line 1354, in _find_and_load
      File "<frozen importlib._bootstrap>", line 1325, in _find_and_load_unlocked
      File "<frozen importlib._bootstrap>", line 929, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 994, in exec_module
      File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
      File "C:\Users\kien\AppData\Local\Programs\Python\Python312\Lib\site-packages\arib-0.6.5-py3.12.egg\arib\ts2ass.py", line 18, in <module>
    ImportError: cannot import name 'EOFError' from 'read' (C:\Users\kien\AppData\Local\Programs\Python\Python312\Lib\site-packages\read\__init__.py)
    Quote Quote  
  9. Use an older version of Python. This converter is very old.
    Quote Quote  
  10. Originally Posted by cibo View Post
    Use an older version of Python. This converter is very old.
    I've installed python 2 but it can't run since it said: ImportError: No module named mpeg.ts although I've import my TS file.
    Quote Quote  
  11. Sounds like your pip install command failed with python2. This is very common if you have multiple version of Python on the same computer, or there is a broken install of arib-ts2ass that you did not remove.
    Try to force python2 with C:\...\python2.exe -m pip install [...], or in a virtual machine with ubuntu or something.
    Quote Quote  
  12. Originally Posted by cibo View Post
    Sounds like your pip install command failed with python2. This is very common if you have multiple version of Python on the same computer, or there is a broken install of arib-ts2ass that you did not remove.
    Try to force python2 with C:\...\python2.exe -m pip install [...], or in a virtual machine with ubuntu or something.
    It still didn't work, and I just look up on google, I see that subs use ARIB-TTML, but I don't know how I can convert it to ASS
    Click image for larger version

Name:	R-REP-BT.2342-3-2019-PDF-E.pdf
Views:	10
Size:	1.40 MB
ID:	77710
    Quote Quote  
  13. I just use TS-Doctor to fix that TS file, but it's not fix that to me. All error came from bin_data track which I said before. Can you help me how to fix this TS with TS-Doctor, or extract that TTML subs to file that I can use to convert ASS?
    Last edited by kienkzz; 24th Mar 2024 at 05:13. Reason: update status
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!