Nie jesteś zalogowany.
Jeśli nie posiadasz konta, zarejestruj je już teraz! Pozwoli Ci ono w pełni korzystać z naszego serwisu. Spamerom dziękujemy!

Ogłoszenie

Prosimy o pomoc dla małej Julki — przekaż 1% podatku na Fundacji Dzieciom zdazyć z Pomocą.
Więcej informacji na dug.net.pl/pomagamy/.

#1  2014-01-25 23:45:43

  morfik - Cenzor wirtualnego świata

morfik
Cenzor wirtualnego świata
Skąd: ze WSI
Zarejestrowany: 2011-09-15
Serwis

[SOLVED] Wyciąganie napisów z kontenera QuickTime/MP4

Próbuję ogarnąć swoją kolekcję filmów i trafiłem na ciekawy problem. Mam plik, który według mkvmerge wygląda jak poniżej:

Kod:

$ mkvmerge -i film.mp4
File 'film.mp4': container: QuickTime/MP4
Track ID 0: video (MPEG-4p10/AVC/h.264)
Track ID 1: audio (AAC)
Chapters: 45 entries

Ale smplayer dodatkowo pokazuje 3 ścieżki napisów. Mediainfo na to:

Kod:

General
Complete name                            : /media/film.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 2.34 GiB
Duration                                 : 3h 16mn
Overall bit rate mode                    : Variable
Overall bit rate                         : 1 711 Kbps
Encoded date                             : UTC 2013-10-23 14:07:50
Tagged date                              : UTC 2013-10-23 14:07:50

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 3h 16mn
Bit rate                                 : 1 611 Kbps
Maximum bit rate                         : 11.4 Mbps
Width                                    : 1 280 pixels
Height                                   : 528 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.099
Stream size                              : 2.21 GiB (94%)
Title                                    : 264#trackID=1:fps=23.976@GPAC0.5.1-DEV-rev4283
Writing library                          : x264 core 133 r2334 a3ac64b
Encoding settings                        : cabac=1 / ref=4 / deblock=1:-1:-1 / analyse=0x3:0x113 / me=tesa / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=32 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=0 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=1611 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=50000 / vbv_bufsize=50000 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
Encoded date                             : UTC 2013-10-23 14:07:50
Tagged date                              : UTC 2013-10-23 14:19:12

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 3h 16mn
Bit rate mode                            : Variable
Bit rate                                 : 96.0 Kbps
Maximum bit rate                         : 151 Kbps
Channel count                            : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Stream size                              : 135 MiB (6%)
Language                                 : English
Encoded date                             : UTC 2013-10-23 08:37:38
Tagged date                              : UTC 2013-10-23 14:19:12

Text #1
ID                                       : 3
Format                                   : Timed Text
Codec ID                                 : tx3g
Duration                                 : 3h 5mn
Bit rate mode                            : Variable
Bit rate                                 : 36 bps
Stream size                              : 48.5 KiB (0%)
Title                                    : *srt#trackID=1:lang=en@GPAC0.5.1-DEV-rev4283
Language                                 : English
Encoded date                             : UTC 2013-10-23 14:19:12
Tagged date                              : UTC 2013-10-23 14:19:12

Text #2
ID                                       : 4
Format                                   : Timed Text
Codec ID                                 : tx3g
Duration                                 : 3h 6mn
Bit rate mode                            : Variable
Bit rate                                 : 37 bps
Stream size                              : 50.7 KiB (0%)
Title                                    : *srt#trackID=1:lang=ro@GPAC0.5.1-DEV-rev4283
Language                                 : Romanian
Encoded date                             : UTC 2013-10-23 14:19:12
Tagged date                              : UTC 2013-10-23 14:19:12

Text #3
ID                                       : 5
Format                                   : Timed Text
Codec ID                                 : tx3g
Duration                                 : 3h 5mn
Bit rate mode                            : Variable
Bit rate                                 : 60 bps
Stream size                              : 81.9 KiB (0%)
Title                                    : *srt#trackID=1:lang=ru@GPAC0.5.1-DEV-rev4283
Language                                 : Russian
Encoded date                             : UTC 2013-10-23 14:19:12
Tagged date                              : UTC 2013-10-23 14:19:12

Menu
00:00:00.000                             : Foreword
00:01:30.090                             : Awaiting Achilles
00:08:16.329                             : "Is There No One Else?"
00:11:06.332                             : Secret Lovers
00:18:22.101                             : Brothers' Pledges
00:25:33.365                             : Greatest War
00:27:41.493                             : Recruiter Odysseus
00:33:23.335                             : Glory and Doom
00:36:39.864                             : Royal Welcome
00:40:01.566                             : They're Coming for Me
00:44:50.187                             : Immortality Is Yours
00:52:32.316                             : Beach Combat
00:58:00.143                             : Too Early in the Day
01:03:48.992                             : No Need to Fear
01:07:41.224                             : Spoils of War
01:12:36.352                             : The Way I Love Helen
01:17:55.838                             : Power, Not Love
01:21:31.720                             : Soldiers Obey
01:23:55.864                             : Gathering Forces
01:28:49.324                             : Brave Offer
01:32:23.371                             : Paris vs. Menelaus
01:36:58.146                             : Battle Cry
01:41:39.093                             : Greek Retreat
01:44:56.957                             : Weak Morale
01:48:15.322                             : Everyone Dies
01:54:20.687                             : Born for This War
01:57:26.039                             : Priam's Order
02:00:05.698                             : Flaming Attack
02:03:47.086                             : Hector's Adversary
02:08:40.212                             : Tragic Mistake
02:10:42.668                             : Night of Torments
02:15:10.436                             : Summoned to Fight
02:20:47.773                             : Now You Know
02:23:08.246                             : Hector vs. Achilles
02:26:25.110                             : Desecrating the Dead
02:28:29.734                             : A Father's Plea
02:34:48.446                             : Achilles' Word
02:37:28.939                             : Inspirations and Honors
02:41:20.170                             : Parting Gift
02:45:40.764                             : Troy Under Siege
02:51:09.759                             : We Will Be Together
02:55:39.028                             : Royal Bloodshed
02:58:42.712                             : Brought to Hell
03:02:24.433                             : I Walked With Giants
03:05:12.601                             : End Credits

Ktoś wie może jak wyciągnąć te napisy i zapisać je do pliku?

Ostatnio edytowany przez morfik (2014-01-26 02:24:01)

Offline

 

#2  2014-01-26 02:23:39

  morfik - Cenzor wirtualnego świata

morfik
Cenzor wirtualnego świata
Skąd: ze WSI
Zarejestrowany: 2011-09-15
Serwis

Re: [SOLVED] Wyciąganie napisów z kontenera QuickTime/MP4

Do obsługi tych kontenerów QuickTime/MP4 jest inne narzędzie -- MP4Box , dostępne w pakiecie gpac . I tak się prezentuje info o pliku:


Kod:

$ MP4Box -info film.mp4
* Movie Info *
        Timescale 600 - Duration 03:16:02.900
        5 track(s)
        Fragmented File: no
        File suitable for progressive download (moov before mdat)
        File Brand isom - version 1
        Created: GMT Wed Oct 23 14:07:50 2013

File has root IOD (9 bytes)
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: AVC/H264 Profile (0x15)
Audio PL: AAC Profile @ Level 2 (0x29)
No streams included in root OD

Chapters:
        Chapter #1 - 00:00:00.000 - "Foreword"
        Chapter #2 - 00:01:30.090 - "Awaiting Achilles"
        Chapter #3 - 00:08:16.329 - ""Is There No One Else?""
        Chapter #4 - 00:11:06.332 - "Secret Lovers"
        Chapter #5 - 00:18:22.101 - "Brothers' Pledges"
        Chapter #6 - 00:25:33.365 - "Greatest War"
        Chapter #7 - 00:27:41.493 - "Recruiter Odysseus"
        Chapter #8 - 00:33:23.335 - "Glory and Doom"
        Chapter #9 - 00:36:39.864 - "Royal Welcome"
        Chapter #10 - 00:40:01.566 - "They're Coming for Me"
        Chapter #11 - 00:44:50.187 - "Immortality Is Yours"
        Chapter #12 - 00:52:32.316 - "Beach Combat"
        Chapter #13 - 00:58:00.143 - "Too Early in the Day"
        Chapter #14 - 01:03:48.992 - "No Need to Fear"
        Chapter #15 - 01:07:41.224 - "Spoils of War"
        Chapter #16 - 01:12:36.352 - "The Way I Love Helen"
        Chapter #17 - 01:17:55.838 - "Power, Not Love"
        Chapter #18 - 01:21:31.720 - "Soldiers Obey"
        Chapter #19 - 01:23:55.864 - "Gathering Forces"
        Chapter #20 - 01:28:49.324 - "Brave Offer"
        Chapter #21 - 01:32:23.371 - "Paris vs. Menelaus"
        Chapter #22 - 01:36:58.146 - "Battle Cry"
        Chapter #23 - 01:41:39.093 - "Greek Retreat"
        Chapter #24 - 01:44:56.957 - "Weak Morale"
        Chapter #25 - 01:48:15.322 - "Everyone Dies"
        Chapter #26 - 01:54:20.687 - "Born for This War"
        Chapter #27 - 01:57:26.039 - "Priam's Order"
        Chapter #28 - 02:00:05.698 - "Flaming Attack"
        Chapter #29 - 02:03:47.086 - "Hector's Adversary"
        Chapter #30 - 02:08:40.212 - "Tragic Mistake"
        Chapter #31 - 02:10:42.668 - "Night of Torments"
        Chapter #32 - 02:15:10.436 - "Summoned to Fight"
        Chapter #33 - 02:20:47.773 - "Now You Know"
        Chapter #34 - 02:23:08.246 - "Hector vs. Achilles"
        Chapter #35 - 02:26:25.110 - "Desecrating the Dead"
        Chapter #36 - 02:28:29.734 - "A Father's Plea"
        Chapter #37 - 02:34:48.446 - "Achilles' Word"
        Chapter #38 - 02:37:28.939 - "Inspirations and Honors"
        Chapter #39 - 02:41:20.170 - "Parting Gift"
        Chapter #40 - 02:45:40.764 - "Troy Under Siege"
        Chapter #41 - 02:51:09.759 - "We Will Be Together"
        Chapter #42 - 02:55:39.028 - "Royal Bloodshed"
        Chapter #43 - 02:58:42.712 - "Brought to Hell"
        Chapter #44 - 03:02:24.433 - "I Walked With Giants"
        Chapter #45 - 03:05:12.601 - "End Credits"

Track # 1 Info - TrackID 1 - TimeScale 24000 - Media Duration 03:16:02.751
Media Info: Language "Undetermined" - Type "vide:avc1" - 282024 samples
Visual Track layout: x=0 y=0 width=1280 height=528
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 1280 x 528
        AVC Info: 1 SPS - 1 PPS - Profile High @ Level 4.1
        NAL Unit length bits: 32
        Pixel Aspect Ratio 1:1 - Indicated track size 1280 x 528
        Chroma format 1 - Luma bit depth 8 - chroma bit depth 8
Self-synchronized

Track # 2 Info - TrackID 2 - TimeScale 48000 - Media Duration 03:16:02.901
Media Info: Language "English" - Type "soun:mp4a" - 551386 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 48000
Synchronized on stream 1

Track # 3 Info - TrackID 3 - TimeScale 1000 - Media Duration 03:05:05.671
Media Info: Language "English" - Type "text:tx3g" - 2748 samples
3GPP/MPEG-4 Timed Text - Size 1280 x 528 - Translation X=0 Y=0 - Layer 0

Track # 4 Info - TrackID 4 - TimeScale 1000 - Media Duration 03:06:09.928
Media Info: Language "Romanian; Moldavian; Moldovan" - Type "text:tx3g" - 2689 samples
3GPP/MPEG-4 Timed Text - Size 1280 x 528 - Translation X=0 Y=0 - Layer 0

Track # 5 Info - TrackID 5 - TimeScale 1000 - Media Duration 03:05:05.619
Media Info: Language "Russian" - Type "text:tx3g" - 2796 samples
3GPP/MPEG-4 Timed Text - Size 1280 x 528 - Translation X=0 Y=0 - Layer 0

Co ciekawe to potrafi z automatu przekonwertować te napisy do .srt:

Kod:

$ MP4Box -srt 3 film.mp4
Conversion done

Ostatnio edytowany przez morfik (2014-01-26 02:26:49)

Offline

 

Stopka forum

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson
Nas ludzie lubią po prostu, a nie klikając w przyciski ;-)