AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / unix / Perguntas / 774448
Accepted
Dmitry Grigoryev
Dmitry Grigoryev
Asked: 2024-04-13 13:45:37 +0800 CST2024-04-13 13:45:37 +0800 CST 2024-04-13 13:45:37 +0800 CST

Como extrair letras de músicas de um fluxo de legendas m4a?

  • 772

Eu tenho esses arquivos .m4a para os quais ffprobe(no Debian 12.1) relatórios:

  Stream #0:1[0x2](eng): Data: bin_data (text / 0x74786574), 0 kb/s
    Metadata:
      handler_name    : SubtitleHandler
Unsupported codec with id 98314 for input stream 1

São letras de músicas e, em caso afirmativo, como posso extraí-las como texto simples?

debian
  • 1 1 respostas
  • 21 Views

1 respostas

  • Voted
  1. Best Answer
    JayCravens
    2024-07-14T22:06:30+08:002024-07-14T22:06:30+08:00

    Eles são, provavelmente, marcadores de capítulo.
    Eu estava procurando bin_datainicialmente, mas tudo que encontrei foi:

    Stream #0:1(eng): Data: bin_data (tx3g / 0x67337874) 
    

    Mas encontrar esta postagem me deu um arquivo semelhante para testar.

    Então, pesquisando por bin_data (text...)me levou a este post em superuser.com:

    ffmpeg -i input_movie.mov -map 0:d:0 -c copy -f data text.bin
    
    [mjpeg @ 0x555d72be4000] EOI missing, emulating
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.m4a':
      Metadata:
        major_brand     : M4V 
        minor_version   : 1
        compatible_brands: M4A mp42isom
        creation_time   : 2019-02-20T23:54:27.000000Z
        title           : FS232 Wurstkatastrophe im Bällebad
        artist          : Metaebene Personal Media
        album           : Freak Show
        track           : 232
        date            : 2019
        encoder         : auphonic.com
        iTunSMPB        :  00000000 00000800 000005E0 00000000125EC620 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        description     : 
        comment         : 
        album_artist    : Freak Show
      Duration: 03:52:57.53, start: 0.000000, bitrate: 1 kb/s
      Chapters:
        Chapter #0:0: start 0.000000, end 65.487000
          Metadata:
            title           : Intro
        Chapter #0:1: start 65.487000, end 169.929000
          Metadata:
            title           : Begrüßung
        Chapter #0:2: start 169.929000, end 397.296000
          Metadata:
            title           : Niklas Roy
        Chapter #0:3: start 397.296000, end 1603.783000
          Metadata:
            title           : Heimcomputer und Spielekonsolen
        Chapter #0:4: start 1603.783000, end 3173.700000
          Metadata:
            title           : Grafiksoftware
        Chapter #0:5: start 3173.700000, end 4836.552000
          Metadata:
            title           : Kunst
        Chapter #0:6: start 4836.552000, end 6757.380000
          Metadata:
            title           : Niklas' Projekte
        Chapter #0:7: start 6757.380000, end 8316.623000
          Metadata:
            title           : Steuerung und Workshops
        Chapter #0:8: start 8316.623000, end 10261.220000
          Metadata:
            title           : Dokumentation und freie Lizenzen
        Chapter #0:9: start 10261.220000, end 13145.059000
          Metadata:
            title           : Neues aus Barcelona
        Chapter #0:10: start 13145.059000, end 13661.674000
          Metadata:
            title           : E-Roller Security
        Chapter #0:11: start 13661.674000, end 13857.677000
          Metadata:
            title           : Free Wifi an Flughäfen
        Chapter #0:12: start 13857.677000, end 13977.530000
          Metadata:
            title           : Ausklang
      Stream #0:0[0x1](und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 47 kb/s (default)
        Metadata:
          creation_time   : 2019-02-20T23:54:27.000000Z
          vendor_id       : [0][0][0][0]
      Stream #0:1[0x2](eng): Data: bin_data (tx3g / 0x67337874)
        Metadata:
          creation_time   : 2019-02-20T23:58:55.000000Z
          handler_name    : "Chapter Titles"
      Stream #0:2[0x3](eng): Video: mjpeg (Baseline) (jpeg / 0x6765706A), yuvj420p(pc, bt470bg/unknown/unknown), 300x300 [SAR 1:1 DAR 1:1], 0.0001 fps, 0.0001 tbr, 1k tbn (default) (attached pic) (timed thumbnails)
        Metadata:
          creation_time   : 2019-02-20T23:58:55.000000Z
          handler_name    : "Chapter Images"
          vendor_id       : ....
    Output #0, data, to 'text.bin':
      Metadata:
        major_brand     : M4V 
        minor_version   : 1
        compatible_brands: M4A mp42isom
        album_artist    : Freak Show
        title           : FS232 Wurstkatastrophe im Bällebad
        artist          : Metaebene Personal Media
        album           : Freak Show
        track           : 232
        date            : 2019
        comment         : 
        iTunSMPB        :  00000000 00000800 000005E0 00000000125EC620 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        description     : 
        encoder         : Lavf60.16.100
      Chapters:
        Chapter #0:0: start 0.000000, end 65.487000
          Metadata:
            title           : Intro
        Chapter #0:1: start 65.487000, end 169.929000
          Metadata:
            title           : Begrüßung
        Chapter #0:2: start 169.929000, end 397.296000
          Metadata:
            title           : Niklas Roy
        Chapter #0:3: start 397.296000, end 1603.783000
          Metadata:
            title           : Heimcomputer und Spielekonsolen
        Chapter #0:4: start 1603.783000, end 3173.700000
          Metadata:
            title           : Grafiksoftware
        Chapter #0:5: start 3173.700000, end 4836.552000
          Metadata:
            title           : Kunst
        Chapter #0:6: start 4836.552000, end 6757.380000
          Metadata:
            title           : Niklas' Projekte
        Chapter #0:7: start 6757.380000, end 8316.623000
          Metadata:
            title           : Steuerung und Workshops
        Chapter #0:8: start 8316.623000, end 10261.220000
          Metadata:
            title           : Dokumentation und freie Lizenzen
        Chapter #0:9: start 10261.220000, end 13145.059000
          Metadata:
            title           : Neues aus Barcelona
        Chapter #0:10: start 13145.059000, end 13661.674000
          Metadata:
            title           : E-Roller Security
        Chapter #0:11: start 13661.674000, end 13857.677000
          Metadata:
            title           : Free Wifi an Flughäfen
        Chapter #0:12: start 13857.677000, end 13977.530000
          Metadata:
            title           : Ausklang
      Stream #0:0(eng): Data: bin_data (tx3g / 0x67337874)
        Metadata:
          creation_time   : 2019-02-20T23:58:55.000000Z
          handler_name    : "Chapter Titles"
    Stream mapping:
      Stream #0:1 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    [out#0/data @ 0x555d72bf14c0] video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.000000%
    size=       0kB time=03:50:57.67 bitrate=   0.0kbits/s speed=3.19e+05x    
    

    Ao ver o resultado da text.binfaixa, descobrimos que são marcadores de capítulo, não letras, infelizmente. Eu olhei para text.binsi mesmo e mostra:

    fedora@/dev/pts/0:$ cat text.bin
    Intro
         Begrüßung
    Niklas RoyHeimcomputer und SpielekonsolenGrafiksoftwareKunstNiklas' ProjekteSteuerung und Workshops Dokumentation und freie LizenzenNeues aus BarcelonaE-Roller SecurityFree Wifi an FlughäfeAusklang
    

    O que parece estar alinhado com a saída do capítulo.


    Não tenho ideia de qual é a codificação desse arquivo, mas se você quiser que os metadados sejam gerados corretamente em um arquivo:

    #!/bin/bash
    
    ffmpeg -i your_file.m4a -map 0:d -c copy -f data text.bin > ffoutput.log 2>&1
    
    line1=$(cat ffoutput.log | grep -n 'data.bin' | cut -d':' -f1)
    line2=$(cat ffoutput.log | grep -n 'Stream mapping' | cut -d':' -f1)
    
    tail -n +$line1 | head -n $((line2-line1)) > chapters.txt
    
    cat chapters.txt
    

    Isso produzirá o texto entre Output #0, data, to 'text.bin':e Stream mapping:do ffmpeglog.

    • 1

relate perguntas

  • Configuração do GRUB para reconhecer diferentes ambientes de desktop (instalações) da mesma distribuição Linux

  • astyle não altera a formatação do arquivo de origem

  • Recebendo e-mail em um novo Debian fresco

  • Debian Stretch: gnome-software segfault em libgs_plugin_systemd-updates.so

  • Como digitar ü no Pinyin IME?

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Possível firmware ausente /lib/firmware/i915/* para o módulo i915

    • 3 respostas
  • Marko Smith

    Falha ao buscar o repositório de backports jessie

    • 4 respostas
  • Marko Smith

    Como exportar uma chave privada GPG e uma chave pública para um arquivo

    • 4 respostas
  • Marko Smith

    Como podemos executar um comando armazenado em uma variável?

    • 5 respostas
  • Marko Smith

    Como configurar o systemd-resolved e o systemd-networkd para usar o servidor DNS local para resolver domínios locais e o servidor DNS remoto para domínios remotos?

    • 3 respostas
  • Marko Smith

    apt-get update error no Kali Linux após a atualização do dist [duplicado]

    • 2 respostas
  • Marko Smith

    Como ver as últimas linhas x do log de serviço systemctl

    • 5 respostas
  • Marko Smith

    Nano - pule para o final do arquivo

    • 8 respostas
  • Marko Smith

    erro grub: você precisa carregar o kernel primeiro

    • 4 respostas
  • Marko Smith

    Como baixar o pacote não instalá-lo com o comando apt-get?

    • 7 respostas
  • Martin Hope
    user12345 Falha ao buscar o repositório de backports jessie 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl Por que a maioria dos exemplos do systemd contém WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky Como exportar uma chave privada GPG e uma chave pública para um arquivo 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll status systemctl mostra: "Estado: degradado" 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim Como podemos executar um comando armazenado em uma variável? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S Por que /dev/null é um arquivo? Por que sua função não é implementada como um programa simples? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 Como ver as últimas linhas x do log de serviço systemctl 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - pule para o final do arquivo 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla Por que verdadeiro e falso são tão grandes? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis Substitua a string em um arquivo de texto enorme (70 GB), uma linha 2017-12-30 06:58:33 +0800 CST

Hot tag

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve