
Recherche avancée
Médias (1)
-
Richard Stallman et le logiciel libre
19 octobre 2011, par
Mis à jour : Mai 2013
Langue : français
Type : Texte
Autres articles (69)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Publier sur MédiaSpip
13 juin 2013Puis-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 (11679)
-
MP4Box does not create final segment
5 janvier 2019, par DhruvaMP4Box is not creating the final segment of video when I dash it. If I run this command on the command line I get only 15 segments out of 16(there is no error) and running it in Google’s Shaka player gives me a 404 at the end of the video saying that the 16th video segment is not found. I am running MP4Box version 0.5.2.
MP4Box -dash 4000 -rap -frag-rap -sample-groups-traf -profile dashavc264:live -bs-switching multi -url-template video-700k-encrypted.mp4 video-1000k-encrypted.mp4 video-1500k-encrypted.mp4 video-2000k-encrypted.mp4 audio-encrypted.mp4 -out "dash_protected/manifest.mp4"
.mpd file
<?xml version="1.0"?>
<mpd xmlns="urn:mpeg:dash:schema:mpd:2011" minbuffertime="PT1.500S" type="static" mediapresentationduration="PT0H1M0.096S" maxsegmentduration="PT0H0M4.000S" profiles="urn:mpeg:dash:profile:isoff-live:2011,http://dashif.org/guidelines/dash264">
<programinformation moreinformationurl="http://gpac.sourceforge.net">
</programinformation>
<period duration="PT0H1M0.096S">
<adaptationset segmentalignment="true" bitstreamswitching="true" maxwidth="1024" maxheight="576" maxframerate="24" par="16:9" lang="eng">
<segmenttemplate initialization="manifest_set1_init.mp4"></segmenttemplate>
<contentprotection schemeiduri="urn:mpeg:dash:mp4protection:2011" value="cenc"></contentprotection>
<representation mimetype="video/mp4" codecs="avc3.64002a" width="852" height="480" framerate="24" sar="1:1" startwithsap="1" bandwidth="1477735">
<segmenttemplate timescale="12288" media="source-video-1500k-encrypted_dash_track1_$Number$.m4s" startnumber="1" duration="49152"></segmenttemplate>
</representation>
<representation mimetype="video/mp4" codecs="avc3.64002a" width="512" height="288" framerate="24" sar="1:1" startwithsap="1" bandwidth="689308">
<segmenttemplate timescale="12288" media="source-video-700k-encrypted_dash_track1_$Number$.m4s" startnumber="1" duration="49152"></segmenttemplate>
</representation>
<representation mimetype="video/mp4" codecs="avc3.64002a" width="1024" height="576" framerate="24" sar="1:1" startwithsap="1" bandwidth="1968345">
<segmenttemplate timescale="12288" media="source-video-2000k-encrypted_dash_track1_$Number$.m4s" startnumber="1" duration="49152"></segmenttemplate>
</representation>
<representation mimetype="video/mp4" codecs="avc3.64002a" width="640" height="360" framerate="24" sar="1:1" startwithsap="1" bandwidth="994771">
<segmenttemplate timescale="12288" media="source-video-1000k-encrypted_dash_track1_$Number$.m4s" startnumber="1" duration="49152"></segmenttemplate>
</representation>
</adaptationset>
<adaptationset segmentalignment="true" lang="eng">
<contentprotection schemeiduri="urn:mpeg:dash:mp4protection:2011" value="cenc"></contentprotection>
<representation mimetype="audio/mp4" codecs="mp4a.40.2" audiosamplingrate="22050" startwithsap="1" bandwidth="69486">
<audiochannelconfiguration schemeiduri="urn:mpeg:dash:23003:3:audio_channel_configuration:2011" value="2"></audiochannelconfiguration>
<segmenttemplate timescale="22050" media="source-audio-encrypted_dash$Number$.m4s" startnumber="1" duration="88045" initialization="source-audio-encrypted_dashinit.mp4"></segmenttemplate>
</representation>
</adaptationset>
</period>
</mpd> -
ffmpeg out of sync after split and put together
5 septembre 2017, par LaborCLooking for the correct way to encode a given input video in multiple bitrates and then package it for dash and hls. I thought this is a basic task, but as it turns out, I could not find a best practise on how to achieve this.
So the way I do it is (but with these I get an out of sync video/audio) :First I split my video (mp4) into video and audio.
ffmpeg -c:v copy -an video_na.mp4 -i source_input.mp4
ffmpeg -c:a aac -ac 2 -async 1 -vn audio.mp4 -i source_input.mp4Then I encode the video with the following commands :
ffmpeg.exe -i video_na.mp4 -an -c:v libx264 -crf 18 \
-preset fast -profile:v high -level 4.2 -b:v 2000k -minrate 2000k \
-maxrate 2000k -bufsize 4000k -g 96 -keyint_min 96 -sc_threshold 0 \
-filter:v "scale='trunc(oh*a/2)*2:576'" -movflags +faststart \
-pix_fmt yuv420p -threads 4 -f mp4 video-2000k.mp4
ffmpeg.exe -i video_na.mp4 -an -c:v libx264 -crf 18 \
-preset fast -profile:v high -level 4.2 -b:v 1500k -minrate 1500k \
-maxrate 1500k -bufsize 3000k -g 96 -keyint_min 96 -sc_threshold 0 \
-filter:v "scale='trunc(oh*a/2)*2:480'" -movflags +faststart \
-pix_fmt yuv420p -threads 4 -f mp4 video-1500k.mp4After that I fragment the videos.
mp4fragment --fragment-duration 4000 --timescale 10000 video-2000k.mp4 \
video-2000k-f.mp4
mp4fragment --fragment-duration 4000 --timescale 10000 video-1500k.mp4 \
video-1500k-f.mp4And finally package everything together again for dash.
mp4dash --media-prefix=out \
--use-segment-timeline \
video-2000k-f.mp4 \
video-1500k-f.mp4 \
--out dashNow there is a difference between audio and video.
I think that the problem is with my parameters for encoding. But which one I have no idea.
What am I doing wrong ? -
Not able to merge init.mp4 and seg-*.m4s with ffmpeg and python due to its file format difference
1er février 2023, par XiBBaLI'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.


- 

- I tried to merge init.mp4 + merged_segment.m4s but it failed
- I tried to convert init.mp4 to init.m4s via ffmpeg but it failed
- I tried to convert all the segments to .mp4 files and merge into init.mp4 but it failed








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