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 ;-)

[ Generated in 0.012 seconds, 15 queries executed ]

Informacje debugowania

Time (s) Query
0.00012 SET CHARSET latin2
0.00005 SET NAMES latin2
0.00128 SELECT u.*, g.*, o.logged FROM punbb_users AS u INNER JOIN punbb_groups AS g ON u.group_id=g.g_id LEFT JOIN punbb_online AS o ON o.ident='3.148.104.165' WHERE u.id=1
0.00068 REPLACE INTO punbb_online (user_id, ident, logged) VALUES(1, '3.148.104.165', 1734061498)
0.00045 SELECT * FROM punbb_online WHERE logged<1734061198
0.00057 DELETE FROM punbb_online WHERE ident='185.191.171.6'
0.00053 DELETE FROM punbb_online WHERE ident='3.22.240.149'
0.00051 DELETE FROM punbb_online WHERE ident='57.141.0.3'
0.00065 DELETE FROM punbb_online WHERE ident='85.208.96.205'
0.00085 SELECT topic_id FROM punbb_posts WHERE id=253491
0.00082 SELECT id FROM punbb_posts WHERE topic_id=25087 ORDER BY posted
0.00062 SELECT t.subject, t.closed, t.num_replies, t.sticky, f.id AS forum_id, f.forum_name, f.moderators, fp.post_replies, 0 FROM punbb_topics AS t INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.id=25087 AND t.moved_to IS NULL
0.00013 SELECT search_for, replace_with FROM punbb_censoring
0.00113 SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM punbb_posts AS p INNER JOIN punbb_users AS u ON u.id=p.poster_id INNER JOIN punbb_groups AS g ON g.g_id=u.group_id LEFT JOIN punbb_online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id=25087 ORDER BY p.id LIMIT 0,25
0.00120 UPDATE punbb_topics SET num_views=num_views+1 WHERE id=25087
Total query time: 0.00959 s