Recherche avancée

Médias (16)

Mot : - Tags -/mp3

Autres articles (78)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

Sur d’autres sites (8902)

  • Not able to merge init.mp4 and seg-*.m4s with ffmpeg and python due to its file format difference

    1er février 2023, par XiBBaL

    I'm developing video downloader (only for free videos) for korean anime streaming site https://laftel.net/

    


    I guess laftel.net uses mpeg-dash for their streaming.
I found "init.mp4" file and "segments-number.m4s" files in chrome developer tools.

    


    Code below downloads seg-1.m4s (name of the first segment) to seg-239.m4s (name of the last segment) file and init.mp4 file and it works.

    


    
(Skip the beginning becasue there is a code that collects "Request-URL" for each .m4s files in network stream)


#variable "found" is part of the "Request-URL"

def curl_m4s():
    for i in range(1,240): #number of the .m4s segment file is constant at 239
        vid_url = f"https://mediacloud.laftel.net/{found}/video/avc1/2/seg-{i}.m4s"
        aud_url = f"https://mediacloud.laftel.net/{found}/audio/mp4a/eng/seg-{i}.m4s"
        
        if i < 10: #for single digit num
            os.system(f"curl {vid_url} > {location}/vids/vid00{i}.m4s")
            os.system(f"curl {aud_url} > {location}/auds/aud00{i}.m4s")
            sleep(random.randint(1,3))
            
        elif i < 100: #for double digit num
            os.system(f"curl {vid_url} > {location}/vids/vid0{i}.m4s")
            os.system(f"curl {aud_url} > {location}/auds/aud0{i}.m4s")
            sleep(random.randint(1,3))
            
        else: #for three digit num
            os.system(f"curl {vid_url} > {location}/vids/vid{i}.m4s")
            os.system(f"curl {aud_url} > {location}/auds/aud{i}.m4s")
            sleep(random.randint(1,3))

location = os.getcwd()

os.system(f"curl https://mediacloud.laftel.net/{found}/video/avc1/2/init.mp4 > {location}/vids/vid_init.mp4")
os.system(f"curl https://mediacloud.laftel.net/{found}/audio/mp4a/eng/init.mp4 > {location}/auds/aud_init.mp4")
os.system(f"curl https://mediacloud.laftel.net/{found}/stream.mpd > {location}/stream.mpd")

curl_m4s()
#use curl in cmd and downloads each of the .m4s (001 ~ 239)

    


    


    So in the vids folder i have "init.mp4" for video and "seg-1.m4s seg-239.m4s" for video
and in the auds folder i have "init.mp4" for audio and "seg-1.m4s seg-239.m4s" for audio

    


    Problem is, I cannot merge init file and segment files.
I have no idea about combining .mp4 and .m4s together.
There are a lot of example codes for merging init.m4s + seg-.m4s but I couldn't find init.mp4 + seg-.mp4 codes.

    


    I tried to merge segments together first, like this and it works.

    


    location = os.getcwd()

os.system(f"cd {location}")
os.system("copy /b vid*.m4s vid_full.m4s")


    


    and now, i want to merge init.mp4 becasue it has very much information about whole video files.
But how ??

    


    I tried these and none of them worked (looks like Successfull merge but it do not contain any watchable video)

    


    # vid_full is merged segment files (seg-1.m4s + ... + seg-239.m4s)
 
1. 
os.system("copy /b init.mp4 + vid*.m4s video_full.m4s")
os.system("ffmpeg -i video_full.m4s -c:a copy video_full.mp4")


2. 
os.system("type vid_init.mp4 index.txt > Filename.mp4")


3. 
import os 

os.system("ffmpeg -i vid_full.m4s -c:a copy vid_full.mp4")
os.system("copy /b vid_init.mp4 + vid_full.mp4 VIDEO.mp4")


    


    All problem occurs the format of the init file is .mp4. If it was .m4s I guess I could merge it.

    


    and I guess i must merge init file and segments files together both in .m4s format. Is it right ?
Via ffmpeg, i couldn't encode init.mp4 to init.m4s so this is the problme also.

    


    So, Please help me merge init.mp4 and segments.m4s

    


    All methods are wellcome at least it is based on python.

    


      

    1. I tried to merge init.mp4 + merged_segment.m4s but it failed
    2. 


    3. I tried to convert init.mp4 to init.m4s via ffmpeg but it failed
    4. 


    5. I tried to convert all the segments to .mp4 files and merge into init.mp4 but it failed
    6. 


    


    I want to merge init file and segment files and make playable video.
Pleas Teach me how to do this.

    


    Links below are what I used for my test :

    


    [Laftel.net URL]
https://laftel.net/player/40269/46123

    


    [Request URL for init.mp4 (video)]
https://mediacloud.laftel.net/2021/04/46773/v15/video/dash/video/avc1/2/init.mp4

    


    [Request URL for init.mp4 (audio)]
https://mediacloud.laftel.net/2021/04/46773/v15/video/dash/audio/mp4a/eng/init.mp4

    


    [Request URL for seg-1.m4s (video)]
https://mediacloud.laftel.net/2021/04/46773/v15/video/dash/video/avc1/2/seg-1.m4s

    


    [Request URL for seg-1.m4s (audio)]
https://mediacloud.laftel.net/2021/04/46773/v15/video/dash/audio/mp4a/eng/seg-1.m4s

    


  • ffmpeg - merge mp3 and mp4 (duration difference)

    8 décembre 2017, par dfionov

    I’m trying to merge mp4 and mp3 files with ffmpeg.
    mp4 duration - 9.800 sec, mp3 - 58.540 sec. So i using -shortest key.
    Code :

    ffmpeg -i video.mp4 -i audio.mp3 -c:v libx264 -c:a aac -strict experimental -shortest output.mp4

    After that i got output.mp4 with duration 9.846. Where is my error ? Why output video longer than source ? (9.846 sec and 9.800 sec).

    Source mp4 MediaInfo :

    General
    Complete name                  : F:\video test\video.mp4
    Format                         : MPEG-4
    Format profile                 : Base Media
    Codec ID                       : iso5 (iso5/dash)
    File size                      : 3.19 MiB
    Duration                       : 9 s 800 ms
    Overall bit rate               : 2 732 kb/s
    Encoded date                   : UTC 2017-11-24 20:53:53
    Tagged date                    : UTC 2017-11-24 20:53:53

    Video
    ID                             : 1
    Format                         : AVC
    Format/Info                    : Advanced Video Codec
    Format profile                 : High@L3.1
    Format settings                : CABAC / 4 Ref Frames
    Format settings, CABAC         : Yes
    Format settings, ReFrames      : 4 frames
    Codec ID                       : avc1
    Codec ID/Info                  : Advanced Video Coding
    Duration                       : 9 s 800 ms
    Bit rate                       : 2 729 kb/s
    Maximum bit rate               : 3 766 kb/s
    Width                          : 1 280 pixels
    Height                         : 720 pixels
    Display aspect ratio           : 16:9
    Frame rate mode                : Constant
    Frame rate                     : 25.000 FPS
    Color space                    : YUV
    Chroma subsampling             : 4:2:0
    Bit depth                      : 8 bits
    Scan type                      : Progressive
    Bits/(Pixel*Frame)             : 0.118
    Stream size                    : 3.19 MiB (100%)
    Writing library                : x264 core 146
    Encoding settings              : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 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=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
    Tagged date                    : UTC 2017-11-24 20:53:53

    Source mp3 Mediainfo :

    General
    Complete name                  : F:\video test\audio.mp3
    Format                         : MPEG Audio
    File size                      : 1.19 MiB
    Duration                       : 58 s 540 ms
    Overall bit rate mode          : Variable
    Overall bit rate               : 170 kb/s
    Writing library                : LAME3.99r

    Audio
    Format                         : MPEG Audio
    Format version                 : Version 1
    Format profile                 : Layer 3
    Format settings                : Joint stereo / MS Stereo
    Duration                       : 58 s 540 ms
    Bit rate mode                  : Variable
    Bit rate                       : 170 kb/s
    Minimum bit rate               : 32.0 kb/s
    Channel(s)                     : 2 channels
    Sampling rate                  : 44.1 kHz
    Frame rate                     : 38.281 FPS (1152 SPF)
    Compression mode               : Lossy
    Stream size                    : 1.19 MiB (100%)
    Writing library                : LAME3.99r
    Encoding settings              : -m j -V 2 -q 0 -lowpass 18.5 --vbr-new -b 32

    Console output :

    ffmpeg version 3.4 Copyright (c) 2000-2017 the FFmpeg developers
     built with gcc 7.2.0 (GCC)
     configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-bzlib --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-cuda --enable-cuvid --enable-d3d11va --enable-nvenc --enable-dxva2 --enable-avisynth --enable-libmfx
     libavutil      55. 78.100 / 55. 78.100
     libavcodec     57.107.100 / 57.107.100
     libavformat    57. 83.100 / 57. 83.100
     libavdevice    57. 10.100 / 57. 10.100
     libavfilter     6.107.100 /  6.107.100
     libswscale      4.  8.100 /  4.  8.100
     libswresample   2.  9.100 /  2.  9.100
     libpostproc    54.  7.100 / 54.  7.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
     Metadata:
       major_brand     : iso5
       minor_version   : 1
       compatible_brands: iso5dash
       creation_time   : 2017-11-24T20:53:53.000000Z
     Duration: 00:00:09.80, start: 0.000000, bitrate: 2732 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 2259 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler
    Input #1, mp3, from 'audio.mp3':
     Duration: 00:00:58.54, start: 0.025057, bitrate: 170 kb/s
       Stream #1:0: Audio: mp3, 44100 Hz, stereo, s16p, 170 kb/s
       Metadata:
         encoder         : LAME3.99r
       Side data:
         replaygain: track gain - -2.200000, track peak - unknown, album gain - unknown, album peak - unknown,
    Stream mapping:
     Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
     Stream #1:0 -> #0:1 (mp3 (native) -> aac (native))
    Press [q] to stop, [?] for help
    [libx264 @ 00000000005ab440] using SAR=1/1
    [libx264 @ 00000000005ab440] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
    [libx264 @ 00000000005ab440] profile High, level 3.1
    [libx264 @ 00000000005ab440] 264 - core 152 r2851 ba24899 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, mp4, to 'output.mp4':
     Metadata:
       major_brand     : iso5
       minor_version   : 1
       compatible_brands: iso5dash
       encoder         : Lavf57.83.100
       Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
       Metadata:
         handler_name    : VideoHandler
         encoder         : Lavc57.107.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
       Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s
       Metadata:
         encoder         : Lavc57.107.100 aac
       Side data:
         replaygain: track gain - -2.200000, track peak - unknown, album gain - unknown, album peak - unknown,
    frame=   54 fps=0.0 q=28.0 size=       0kB time=00:00:00.04 bitrate=   8.3kbits/s speed=0.0927x    
    frame=   80 fps= 80 q=28.0 size=       0kB time=00:00:01.09 bitrate=   0.4kbits/s speed=1.09x    
    frame=   98 fps= 65 q=28.0 size=     256kB time=00:00:01.83 bitrate=1143.5kbits/s speed=1.21x    
    frame=  119 fps= 59 q=28.0 size=     512kB time=00:00:02.67 bitrate=1570.9kbits/s speed=1.32x    
    frame=  144 fps= 56 q=28.0 size=     768kB time=00:00:03.66 bitrate=1715.0kbits/s speed=1.42x    
    frame=  167 fps= 52 q=28.0 size=    1024kB time=00:00:04.57 bitrate=1833.9kbits/s speed=1.44x    
    frame=  190 fps= 51 q=28.0 size=    1280kB time=00:00:05.50 bitrate=1905.5kbits/s speed=1.47x    
    frame=  218 fps= 51 q=28.0 size=    1792kB time=00:00:06.64 bitrate=2210.6kbits/s speed=1.56x    
    frame=  242 fps= 50 q=28.0 size=    2048kB time=00:00:07.56 bitrate=2216.4kbits/s speed=1.58x    
    frame=  245 fps= 41 q=-1.0 Lsize=    3045kB time=00:00:09.82 bitrate=2539.6kbits/s speed=1.65x    
    video:2880kB audio:156kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.298058%
    [libx264 @ 00000000005ab440] frame I:14    Avg QP:20.01  size: 39750
    [libx264 @ 00000000005ab440] frame P:106   Avg QP:23.85  size: 14578
    [libx264 @ 00000000005ab440] frame B:125   Avg QP:24.63  size:  6770
    [libx264 @ 00000000005ab440] consecutive B-frames: 22.9% 22.0% 15.9% 39.2%
    [libx264 @ 00000000005ab440] mb I  I16..4: 16.7% 80.3%  3.0%
    [libx264 @ 00000000005ab440] mb P  I16..4: 10.2% 36.2%  1.1%  P16..4: 25.0%  7.9%  2.5%  0.0%  0.0%    skip:17.1%
    [libx264 @ 00000000005ab440] mb B  I16..4:  2.3%  5.8%  0.2%  B16..8: 31.4%  6.5%  0.9%  direct: 3.7%  skip:49.2%  L0:51.8% L1:44.5% BI: 3.7%
    [libx264 @ 00000000005ab440] 8x8 transform intra:76.1% inter:86.3%
    [libx264 @ 00000000005ab440] coded y,uvDC,uvAC intra: 38.3% 52.1% 9.0% inter: 12.3% 20.1% 0.2%
    [libx264 @ 00000000005ab440] i16 v,h,dc,p: 30% 28%  9% 33%
    [libx264 @ 00000000005ab440] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 36% 23% 19%  3%  3%  4%  4%  4%  4%
    [libx264 @ 00000000005ab440] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 21% 14%  5%  7%  7%  6%  5%  3%
    [libx264 @ 00000000005ab440] i8c dc,h,v,p: 45% 24% 25%  6%
    [libx264 @ 00000000005ab440] Weighted P-Frames: Y:13.2% UV:6.6%
    [libx264 @ 00000000005ab440] ref P L0: 71.7% 12.5% 12.9%  2.7%  0.2%
    [libx264 @ 00000000005ab440] ref B L0: 92.8%  6.3%  0.9%
    [libx264 @ 00000000005ab440] ref B L1: 98.3%  1.7%
    [libx264 @ 00000000005ab440] kb/s:2406.56
    [aac @ 00000000005adde0] Qavg: 511.420

    ffprobe -show_packets output too big, so I loaded to pastebin
    https://pastebin.com/TYSMdceS

  • Difference between use subprocess.Popen() and run the command in shell mannually ? [duplicate]

    6 février 2021, par hu chenlin
    import subprocess
ffmpeg_params=['ffmpeg', '-y', '-i', 'http://cache.m.iqiyi.com/mus/235133201/2af150aebb98276a80d52513fb91fbc8/afbe8fd3d73448c9/0/20210115/1f/c5/cda301a0e8339c4cbcc89a4e9a6dafac.m3u8?qd_originate=tmts_py&tvid=1694459300&bossStatus=0&qd_vip=0&px=&src=3_31_312&prv=&previewType=&previewTime=&from=&qd_time=1612598784271&qd_p=6011968c&qd_asc=d0d83b774212c40885a78123935cf7d4&qypid=1694459300_04022000001000000000_4&qd_k=7b1dacf9d318a810bd201e367ef98196&isdol=0&code=2&ff=f4v&iswb=0&qd_s=otv&vf=bb7741a4e27350139427f0051c641530&np_tag=nginx_part_tag', '-c', 'copy', '-bsf:a', 'aac_adtstoasc', '--', 'f:\\/【英语口语】我羡慕你.mp4']
b=subprocess.Popen(ffmpeg_params)


    


    Using this simple .py script I can call ffmpeg to download the video file sucessfully.

    


    However, if I run

    


    


    ffmpeg -y -i
http://cache.m.iqiyi.com/mus/235133201/2af150aebb98276a80d52513fb91fbc8/afbe8fd3d73448c9/0/20210115/1f/c5/cda301a0e8339c4cbcc89a4e9a6dafac.m3u8?qd_originate=tmts_py&tvid=1694459300&bossStatus=0&qd_vip=0&px=&src=3_31_312&prv=&previewType=&previewTime=&from=&qd_time=1612598784271&qd_p=6011968c&qd_asc=d0d83b774212c40885a78123935cf7d4&qypid=1694459300_04022000001000000000_4&qd_k=7b1dacf9d318a810bd201e367ef98196&isdol=0&code=2&ff=f4v&iswb=0&qd_s=otv&vf=bb7741a4e27350139427f0051c641530&np_tag=nginx_part_tag
-c copy -bsf:a aac_adtstoasc — f :/【英语口语】我羡慕你.mp4

    


    


    in shell, it will fail with below message :

    


    


    ffmpeg version N-90173-gfa0c9d69d3 Copyright (c) 2000-2018 the FFmpeg
developers built with gcc 7.3.0 (GCC) configuration : —enable-gpl
—enable-version3 —enable-sdl2 —enable-bzlib —enable-fontconfig —enable-gnutls —enable-iconv —enable-libass —enable-libbluray —enable-libfreetype —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-libopus —enable-libshine —enable-libsnappy —enable-libsoxr —enable-libtheora —enable-libtwolame —enable-libvpx —enable-libwavpack —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxml2 —enable-libzimg —enable-lzma —enable-zlib —enable-gmp —enable-libvidstab —enable-libvorbis —enable-libvo-amrwbenc —enable-libmysofa —enable-libspeex —enable-libxvid —enable-libmfx —enable-amf —enable-cuda —enable-cuvid —enable-d3d11va —enable-nvenc —enable-dxva2 —enable-avisynth libavutil 56. 7.101 / 56. 7.101 libavcodec 58. 13.100 / 58. 13.100 libavformat 58. 10.100 /
58. 10.100 libavdevice 58. 2.100 / 58. 2.100 libavfilter 7. 12.100 / 7. 12.100 libswscale 5. 0.101 / 5. 0.101 libswresample 3. 0.101 / 3. 0.101 libpostproc 55. 0.100 /
55. 0.100 http://cache.m.iqiyi.com/mus/235133201/2af150aebb98276a80d52513fb91fbc8/afbe8fd3d73448c9/0/20210115/1f/c5/cda301a0e8339c4cbcc89a4e9a6dafac.m3u8?qd_originate=tmts_py :
Invalid data found when processing input 'tvid' is not recognized as
an internal or external command, operable program or batch file.
'bossStatus' is not recognized as an internal or external command,
operable program or batch file.

    


    


    I can use subprocess.Popen to call the ffmpeg to download the video file successfully, However, I can't directly run ffmpeg in shell with the same parameters to download the file. Why ? How can I directly run ffmpeg in shell to download the file ?