Recherche avancée

Médias (1)

Mot : - Tags -/MediaSPIP 0.2

Autres articles (60)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (5817)

  • Unable to extract KLV data from .mpg file

    2 novembre 2023, par Arjun Shastry

    I need to extract the klv data embedded in the following file :
https://samples.ffmpeg.org/MPEG2/mpegts-klv/Day%20Flight.mpg

    


    Currently, I am doing it using ffmpeg and python.
The code works for .ts files like the example given below, but not the above mpg file. :
https://www.arcgis.com/home/item.html?id=55ec6f32d5e342fcbfba376ca2cc409a

    


    I used the following python command, using subprocess, ffmpeg to extract klv data in a binary file and then using klvdata library to tranlate to a readable text file.

    


    #Extract klv data and output as binary file
command=['ffmpeg', '-i', input_video, '-map', 'd','-codec','copy','-f', 'data','out.bin']
process=subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = process.communicate()

print(stdout)
print(stderr)

#Open text file to write json data
outjson=open("./outjson.txt","w")
print("Flag 1")

# Open the out.bin file for reading as binary
with open("./out.bin", "rb") as f:
    sample=[]
    cnt=0
    for packet in klvdata.streamparser.StreamParser(f):
        pack=[]
        metadata = packet.MetadataList()
        for i in (5,6,7,13,14,15,18,19,23,24,25,26,27,28,29,30,31,32,33):#Only extracting required data
            pack.append(metadata[i][-1])
        sample.append(pack)
    sampleLength=(len(sample))
    json.dump(sample,outjson,indent=4) # Convert the metadata to a string and write it to outtext.txt


    


    When doing it for "Day Flight.mpg", the following error occurs :

    


    58. 19.100 / 58. 19.100\r\n  libavcodec     60. 26.100 / 60. 26.100\r\n  libavformat    60. 11.100 / 60. 11.100\r\n  libavdevice    60.  2.101 / 60.  2.101\r\n  libavfilter     9. 11.100 /  9. 11.100\r\n  libswscale      7.  3.100 /  7.  3.100\r\n  libswresample   4. 11.100 /  4. 11.100\r\n  libpostproc    57.  2.100 / 57.  2.100\r\n[mpegts @ 0000026bb99387c0] start time for stream 1 is not set in estimate_timings_from_pts\r\nInput #0, mpegts, from 'C:/Users/ashastry/Downloads/Day Flight.mpg':\r\n  Duration: 00:03:14.88, start: 10.000000, bitrate: 4187 kb/s\r\n  Program 1 \r\n  Stream #0:0[0x1e1]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720, 60 fps, 60 tbr, 90k tbn\r\n  Stream #0:1[0x1f1]: Data: klv (KLVA / 0x41564C4B)\r\nOutput #0, data, to 'out.bin':\r\n  Metadata:\r\n    encoder         : Lavf60.11.100\r\n  Stream #0:0: Data: klv (KLVA / 0x41564C4B)\r\nStream mapping:\r\n  Stream #0:1 -> #0:0 (copy)\r\nPress [q] to stop, [?] for help\r\nsize=       0kB time=00:00:00.00 bitrate=N/A speed=N/A    \rsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x    \rsize=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    \r[out#0/data @ 0000026bbb61b300] video:0kB audio:0kB subtitle:0kB other streams:1kB global headers:0kB muxing overhead: 0.000000%\r\nsize=       1kB time=00:00:00.00 bitrate=N/A speed=   0x    \r\n"
Flag 1
Traceback (most recent call last):

  File C:\ProgramData\anaconda3\Lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec
    exec(code, globals, locals)

  File c:\users\ashastry\desktop\gis\javascript\extract.py:34
    metadata = packet.MetadataList()

AttributeError: 'UnknownElement' object has no attribute 'MetadataList'


    


  • How can I output every other TS packet (of an MPEG Transport Stream file), into one output file, using FFMPEG ?

    9 août 2022, par mustardCutter

    I want to copy every other MPEG transport stream packet (PID# 00000000 [I'm guessing this is the first #], 00000002, 00000004...), from one MPEG transport stream file, into one output file, and the other ones (PID# 00000001, 00000003, 00000005...) into another output file. The output files don't have to be MPEG transport stream files ; they could be PCM, etc. Each packet could perhaps be referenced by stream id (PID #) or by Bytes, as each one is 188 Bytes, except perhaps the last packet.

    


    I'd prefer to not use HLS or sequence muxer or concat if they require that I separate all the TS packets from one TS file into a folder first (as that would make many thousands of them), and I'd rather not deal with log or text or playlist files if I don't have to do so. I can't rename the PIDs, as their naming should remain what it is for a later step. I can't glob since it isn't an image file, though if I have to, perhaps I can read it in as if it's an image file sequence and glob so as to group the odd PID #s as an 'odds' input and glob to group the even PID #s as an 'evens' input. I don't think I can use '%08d' on the input as a stream id, because what I'm doing to each packet differs from what I'm doing with the previous packet, as to its destination output file. Perhaps there is some solution using some loop, complex function, counter, or perhaps preferably some 'if' statement, though I'd like it to be done in FFMPEG rather than by the OS using some terminal trickery. I don't know if you can use '|' (backslash pipe) to pipe within FFMPEG (or to execute multiple FFMPEG commands sequentially) independent of the OS/terminal trickery ; (I'm guessing '&&' doesn't work within FFMPEG commands independent of the OS/terminal).

    


    In case it is helpful to know, the TS file is created from an MP4, so perhaps there is some way to transmux so that the packets are getting created in the end sequence needed and then renamed to what they would be if I had just transmuxed from MP4 to TS (though technically I'm transcoding audio [1 or 2 channels] from AAC to AC3 in the transmux step, but the video is h.264 and just copied into the TS file).

    


  • How to convert messed-up .vtt sub file from youtube-dl —write-auto-sub download ?

    27 septembre 2023, par perry_the_python

    My goal is to download a YouTube video with auto-generated subtitles in a separate file like .vtt,.srt, etc.

    


    I am currently trying to achieve this with youtube-dl but I am open to other solutions if needed.

    


    When I run the following command, it downloads the video as .mp4 (which is fine) and a separate .vtt file, but the .vtt seems to be messed-up somehow and displays all the text for the whole clip at once instead of the specified times.

    


    Command I am running :

    


    youtube-dl --write-auto-sub https://www.youtube.com/watch?v=Roc89oOZOF4&list=PLJBo3iyb1U0eNNN4Dij3N-d0rCJpMyAKQ&index=45


    


    Downloads this .vtt :

    


    WEBVTT&#xA;Kind: captions&#xA;Language: en&#xA;&#xA;00:00:05.960 --> 00:00:08.290 align:start position:0%&#xA; &#xA;thank &lt;00:00:06.003><c>you  </c>&lt;00:00:06.046><c>ah </c>&lt;00:00:06.089><c>crap  </c>&lt;00:00:06.132><c>well </c>&lt;00:00:06.175><c>looks </c>&lt;00:00:06.218><c>like </c>&lt;00:00:06.261><c>the </c>&lt;00:00:06.304><c>good </c>&lt;00:00:06.347><c>Lord </c>&lt;00:00:06.390><c>just </c>&lt;00:00:06.433><c>sent  </c>&lt;00:00:06.476><c>me </c>&lt;00:00:06.519><c>a </c>&lt;00:00:06.562><c>conversation </c>&lt;00:00:06.605><c>starter </c>&lt;00:00:06.648><c>come </c>&lt;00:00:06.691><c>here  </c>&lt;00:00:06.734><c>Jesse </c>&lt;00:00:06.777><c>come </c>&lt;00:00:06.820><c>get </c>&lt;00:00:06.863><c>the </c>&lt;00:00:06.906><c>ball  </c>&lt;00:00:06.949><c>hmm</c>&#xA;&#xA;00:00:08.290 --> 00:00:10.549 align:start position:0%&#xA;thank you  ah crap  well looks like the good Lord just sent  me a conversation starter come here  Jesse come get the ball  hmm&#xA; &#xA;&#xA;00:00:10.549 --> 00:00:13.070 align:start position:0%&#xA; &#xA; &#xA;&#xA;00:00:13.070 --> 00:00:15.470 align:start position:0%&#xA; &#xA; &#xA;&#xA;00:00:15.470 --> 00:00:23.750 align:start position:0%&#xA; &#xA; &#xA;&#xA;00:00:23.750 --> 00:00:23.760 align:start position:0%&#xA; &#xA; &#xA;&#xA;00:00:23.760 --> 00:00:26.480 align:start position:0%&#xA; &#xA;&#xA;&#xA;&#xA;

    &#xA;

    I have read that this may be done on purpose by YouTube.

    &#xA;

    Even if this is true, is there any way to convert this .vtt to a usable format or simply download correctly-formatted auto-generated subtitles from YouTube ?

    &#xA;

    Python, FFMPEG, cmd-line preferred, but anything is helpful !

    &#xA;

    Thanks ! Any and all assistance is greatly appreciated !

    &#xA;