
Recherche avancée
Médias (16)
-
#7 Ambience
16 octobre 2011, par
Mis à jour : Juin 2015
Langue : English
Type : Audio
-
#6 Teaser Music
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#5 End Title
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#3 The Safest Place
16 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#4 Emo Creates
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
-
#2 Typewriter Dance
15 octobre 2011, par
Mis à jour : Février 2013
Langue : English
Type : Audio
Autres articles (29)
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP 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" (...) -
Les autorisations surchargées par les plugins
27 avril 2010, parMediaspip core
autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs -
Gestion des droits de création et d’édition des objets
8 février 2011, parPar défaut, beaucoup de fonctionnalités sont limitées aux administrateurs mais restent configurables indépendamment pour modifier leur statut minimal d’utilisation notamment : la rédaction de contenus sur le site modifiables dans la gestion des templates de formulaires ; l’ajout de notes aux articles ; l’ajout de légendes et d’annotations sur les images ;
Sur d’autres sites (4234)
-
ffmpeg issue when using it from kurento to rtmp stream
15 juillet 2020, par MaxiI successfully managed to connect ffmpeg with an RTP endpoint of my kurento server. On many tries before I got a "Connection timed out" due my docker configuration. In my docker logs I see following now after RTP endpoint creation and starting ffmpeg :


streamy-server_1 | 2020-07-15 08:30:20.397 INFO 49 --- [nio-8080-exec-1] net.bramp.ffmpeg.RunProcessFunction : ffmpeg -y -v error -protocol_whitelist file,http,https,tcp,tls,udp,rtp -rtbufsize 1500M -re -i /tmp/test.sdp -f flv -vcodec libx264 -pix_fmt yuv420p -s 640x480 -r 20/1 -b:v 1000000 -acodec libmp3lame -ar 44100 -b:a 1000000 -bufsize 4000k -maxrate 1000k -profile:v baseline -deinterlace -preset medium -g 60 -r 30 rtmps://live-api-s.facebook.com:443/rtmp/3163232097002611?xyz
streamy-server_1 | [h264 @ 0x56538aeae0a0] non-existing PPS 0 referenced
streamy-server_1 | Last message repeated 1 times
streamy-server_1 | [h264 @ 0x56538aeae0a0] decode_slice_header error
streamy-server_1 | [h264 @ 0x56538aeae0a0] no frame!
streamy-server_1 | [h264 @ 0x56538aeae0a0] non-existing PPS 0 referenced
streamy-server_1 | Last message repeated 1 times
streamy-server_1 | [h264 @ 0x56538aeae0a0] decode_slice_header error
streamy-server_1 | [h264 @ 0x56538aeae0a0] no frame!
streamy-server_1 | [h264 @ 0x56538aeae0a0] non-existing PPS 0 referenced
streamy-server_1 | Last message repeated 1 times
streamy-server_1 | [h264 @ 0x56538aeae0a0] decode_slice_header error
streamy-server_1 | [h264 @ 0x56538aeae0a0] no frame!
streamy-server_1 | [h264 @ 0x56538aeae0a0] non-existing PPS 0 referenced
streamy-server_1 | Last message repeated 1 times
streamy-server_1 | [h264 @ 0x56538aeae0a0] decode_slice_header error
streamy-server_1 | [h264 @ 0x56538aeae0a0] no frame!
streamy-server_1 | [h264 @ 0x56538aeae0a0] non-existing PPS 0 referenced
streamy-server_1 | Last message repeated 1 times
[...] (this is repeated for the next ~20-30 seconds, then continues with:)
kurento_1 | 0:03:00.152967182 1 0x7faa58093b30 INFO KurentoWebSocketTransport WebSocketTransport.cpp:296:keepAliveSessions: Keep alive 998a9271-615e-490c-acce-6bc22d9592f7
streamy-server_1 | Too many packets buffered for output stream 0:0.
streamy-server_1 | 2020-07-15 08:30:38.361 ERROR 49 --- [nio-8080-exec-1] c.maximummgt.streamy.WebsocketsHandler : Unknown error while websockets session
streamy-server_1 | 
streamy-server_1 | java.lang.RuntimeException: java.io.IOException: ffmpeg returned non-zero exit status. Check stdout.
streamy-server_1 | at net.bramp.ffmpeg.job.SinglePassFFmpegJob.run(SinglePassFFmpegJob.java:46) ~[ffmpeg-0.6.2.jar:0.6.2]



At facebook live it does not receive the video stream. In log I just see this message :


Facebook has not received video signal from the video source for some time. Check that the connectivity between the video source and Facebook is sufficient for the source resolution and bitrate. Check your video encoder logs for details. If problems persist, consider improving connection quality or reducing the bitrate of your video source.


On Kurento Java code I am doing following :


- 

-
Create an RTP endpoint


-
Connect it with the video source from the user


-
Create an SDP offer and save it to a file (currently /tmp/test.sdp)


-
Process SDP offer with the RTP endpoint


-
Start the ffmpeg process with (
net.bramp.ffmpeg.builder.FFmpegBuilder
) :

FFmpegBuilder builder = new FFmpegBuilder()
.addExtraArgs("-protocol_whitelist", "file,http,https,tcp,tls,udp,rtp")
.addExtraArgs("-rtbufsize", "1500M")
.addExtraArgs("-re")
.setInput("/tmp/test.sdp")
.addOutput(rtmpURL)
.setFormat("flv")
.addExtraArgs("-bufsize", "4000k")
.addExtraArgs("-maxrate", "1000k")
.setAudioCodec("libmp3lame")
.setAudioSampleRate(FFmpeg.AUDIO_SAMPLE_44100)
.setAudioBitRate(1_000_000)
.addExtraArgs("-profile:v", "baseline")
.setVideoCodec("libx264")
.setVideoPixelFormat("yuv420p")
.setVideoResolution(width, height)
.setVideoBitRate(1_000_000)
.setVideoFrameRate(20)
.addExtraArgs("-deinterlace")
.addExtraArgs("-preset", "medium")
.addExtraArgs("-g", "60")
.addExtraArgs("-r", "30")
.done();

FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);
executor.createJob(builder).run();
















Can somebody guide here on this issue ? Thanks in advance


EDIT 01 : I disabled now


// FFmpegExecutor executor = new FFmpegExecutor(ffmpeg, ffprobe);
// executor.createJob(builder).run();



so that ffmpeg does not start automatically. After java created the test.sdp, I ran ffmpeg by myself in the console not to stream to facebook but to a mp4 :


ffmpeg -loglevel debug -protocol_whitelist file,crypto,udp,rtp -re -vcodec libvpx -acodec opus -i /tmp/test.sdp -vcodec libx264 -acodec aac -y output.mp4


The output looks as following - I interrupted it after 25s with CTRL + C


root@app:/var/www# ffmpeg -loglevel debug -protocol_whitelist file,crypto,udp,rtp -re -vcodec libvpx -acodec opus -i /tmp/test.sdp -vcodec libx264 -acodec aac -y output.mp4
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
 built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
 configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
 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
 libavresample 3. 7. 0 / 3. 7. 0
 libswscale 4. 8.100 / 4. 8.100
 libswresample 2. 9.100 / 2. 9.100
 libpostproc 54. 7.100 / 54. 7.100
Splitting the commandline.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging level) with argument 'debug'.
Reading option '-protocol_whitelist' ... matched as AVOption 'protocol_whitelist' with argument 'file,crypto,udp,rtp'.
Reading option '-re' ... matched as option 're' (read input at native frame rate) with argument '1'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libvpx'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'opus'.
Reading option '-i' ... matched as input url with argument '/tmp/test.sdp'.
Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'.
Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'aac'.
Reading option '-y' ... matched as option 'y' (overwrite output files) with argument '1'.
Reading option 'output.mp4' ... matched as output url.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Applying option y (overwrite output files) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input url /tmp/test.sdp.
Applying option re (read input at native frame rate) with argument 1.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument libvpx.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument opus.
Successfully parsed a group of options.
Opening an input file: /tmp/test.sdp.
[NULL @ 0x55c2344e6a00] Opening '/tmp/test.sdp' for reading
[sdp @ 0x55c2344e6a00] Format sdp probed with size=2048 and score=50
[sdp @ 0x55c2344e6a00] audio codec set to: pcm_mulaw
[sdp @ 0x55c2344e6a00] audio samplerate set to: 44000
[sdp @ 0x55c2344e6a00] audio channels set to: 1
[sdp @ 0x55c2344e6a00] video codec set to: h264
[sdp @ 0x55c2344e6a00] RTP Packetization Mode: 1
[udp @ 0x55c2344e90c0] end receive buffer size reported is 131072
[udp @ 0x55c2344e9320] end receive buffer size reported is 131072
[sdp @ 0x55c2344e6a00] setting jitter buffer size to 500
[udp @ 0x55c2344ea0a0] end receive buffer size reported is 131072
[udp @ 0x55c2344ea180] end receive buffer size reported is 131072
[sdp @ 0x55c2344e6a00] setting jitter buffer size to 500
[sdp @ 0x55c2344e6a00] Before avformat_find_stream_info() pos: 305 bytes read:305 seeks:0 nb_streams:2
[libvpx @ 0x55c2344eeb80] v1.7.0
[libvpx @ 0x55c2344eeb80] --prefix=/usr --enable-pic --enable-shared --disable-install-bins --disable-install-srcs --size-limit=16384x16384 --enable-postproc --enable-multi-res-encoding --enable-temporal-denoising --enable-vp9-temporal-denoising --enable-vp9-postproc --target=x86_64-linux-gcc
[libvpx @ 0x55c2344eeb80] Invalid sync code e06101.
[libvpx @ 0x55c2344eeb80] Failed to decode frame: Bitstream not supported by this decoder
[libvpx @ 0x55c2344eeb80] Invalid sync code e06101.
[libvpx @ 0x55c2344eeb80] Failed to decode frame: Bitstream not supported by this decoder
 Last message repeated 1 times
[libvpx @ 0x55c2344eeb80] Invalid sync code e06101.
[libvpx @ 0x55c2344eeb80] Failed to decode frame: Bitstream not supported by this decoder
[sdp @ 0x55c2344e6a00] Non-increasing DTS in stream 1: packet 3 with DTS 5940, packet 4 with DTS 5940
[...]
[sdp @ 0x55c2344e6a00] Non-increasing DTS in stream 1: packet 956 with DTS 2027726, packet 957 with DTS 2027726
[libvpx @ 0x55c2344eeb80] Failed to decode frame: Bitstream not supported by this decoder
[libvpx @ 0x55c2344eeb80] Invalid sync code e06101.
[libvpx @ 0x55c2344eeb80] Failed to decode frame: Bitstream not supported by this decoder
[libvpx @ 0x55c2344eeb80] Invalid sync code e06101.
[libvpx @ 0x55c2344eeb80] Failed to decode frame: Bitstream not supported by this decoder
[libvpx @ 0x55c2344eeb80] Invalid sync code e06101.
[libvpx @ 0x55c2344eeb80] Failed to decode frame: Bitstream not supported by this decoder
[libvpx @ 0x55c2344eeb80] Invalid sync code 4a3bd8.
[sdp @ 0x55c2344e6a00] Non-increasing DTS in stream 1: packet 960 with DTS 2036690, packet 961 with DTS 2036690
[libvpx @ 0x55c2344eeb80] Failed to decode frame: Bitstream not supported by this decoder
[sdp @ 0x55c2344e6a00] interrupted
[sdp @ 0x55c2344e6a00] decoding for stream 1 failed
[sdp @ 0x55c2344e6a00] rfps: 30.000000 0.000926
[sdp @ 0x55c2344e6a00] rfps: 60.000000 0.003706
[sdp @ 0x55c2344e6a00] rfps: 120.000000 0.014824
[sdp @ 0x55c2344e6a00] Setting avg frame rate based on r frame rate
[sdp @ 0x55c2344e6a00] Could not find codec parameters for stream 1 (Video: vp8 (libvpx), 1 reference frame, none(progressive)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[sdp @ 0x55c2344e6a00] After avformat_find_stream_info() pos: 305 bytes read:305 seeks:0 frames:962
Input #0, sdp, from '/tmp/test.sdp':
 Metadata:
 title : KMS
 Duration: N/A, start: 0.033000, bitrate: N/A
 Stream #0:0, 0, 1/44000: Audio: opus, 48000 Hz, mono, fltp
 Stream #0:1, 962, 1/90000: Video: vp8, 1 reference frame, none(progressive), 30 fps, 30 tbr, 90k tbn, 90k tbc
Successfully opened the file.
Parsing a group of options: output url output.mp4.
Applying option vcodec (force video codec ('copy' to copy stream)) with argument libx264.
Applying option acodec (force audio codec ('copy' to copy stream)) with argument aac.
Successfully parsed a group of options.
Opening an output file: output.mp4.
[file @ 0x55c234563320] Setting default whitelist 'file,crypto'
Successfully opened the file.
[libvpx @ 0x55c2344eb0e0] v1.7.0
[libvpx @ 0x55c2344eb0e0] --prefix=/usr --enable-pic --enable-shared --disable-install-bins --disable-install-srcs --size-limit=16384x16384 --enable-postproc --enable-multi-res-encoding --enable-temporal-denoising --enable-vp9-temporal-denoising --enable-vp9-postproc --target=x86_64-linux-gcc
Stream mapping:
 Stream #0:1 -> #0:0 (vp8 (libvpx) -> h264 (libx264))
 Stream #0:0 -> #0:1 (opus (native) -> aac (native))
Press [q] to stop, [?] for help
Finishing stream 0:0 without any data written to it.
Finishing stream 0:1 without any data written to it.
detected 2 logical cores
[graph_1_in_0_0 @ 0x55c234561360] Setting 'time_base' to value '1/48000'
[graph_1_in_0_0 @ 0x55c234561360] Setting 'sample_rate' to value '48000'
[graph_1_in_0_0 @ 0x55c234561360] Setting 'sample_fmt' to value 'fltp'
[graph_1_in_0_0 @ 0x55c234561360] Setting 'channel_layout' to value '0x4'
[graph_1_in_0_0 @ 0x55c234561360] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:0x4
[format_out_0_1 @ 0x55c2345611e0] Setting 'sample_fmts' to value 'fltp'
[format_out_0_1 @ 0x55c2345611e0] Setting 'sample_rates' to value '96000|88200|64000|48000|44100|32000|24000|22050|16000|12000|11025|8000|7350'
[AVFilterGraph @ 0x55c234560620] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
Nothing was written into output file 0 (output.mp4), because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=-577014:32:22.77 bitrate= -0.0kbits/s speed=N/A
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Input file #0 (/tmp/test.sdp):
 Input stream #0:0 (audio): 0 packets read (0 bytes); 0 frames decoded (0 samples);
 Input stream #0:1 (video): 0 packets read (0 bytes); 0 frames decoded;
 Total: 0 packets (0 bytes) demuxed
Output file #0 (output.mp4):
 Output stream #0:0 (video): 0 frames encoded; 0 packets muxed (0 bytes);
 Output stream #0:1 (audio): 0 frames encoded (0 samples); 0 packets muxed (0 bytes);
 Total: 0 packets (0 bytes) muxed
0 frames successfully decoded, 0 decoding errors
[AVIOContext @ 0x55c234563420] Statistics: 0 seeks, 0 writeouts
[aac @ 0x55c23458bea0] Qavg: -nan
[AVIOContext @ 0x55c2344ef6e0] Statistics: 305 bytes read, 0 seeks
Exiting normally, received signal 2.
root@app:/var/www# ls -lt
total 72
-rw-r--r-- 1 root root 0 Jul 15 09:12 output.mp4



-
-
MediaRecorder - FFMPEG - RTMP issue
5 octobre 2017, par Bear10Currently I’m working on streaming Audio and Video from a video captured in Chrome 61.0.3163.100 with the MediaRecorder API.
The backend is running on node and it spawns a child process which runs ffmpeg :
ffmpeg -threads 4 -i udp://127.0.0.1:41234 -t 5400 -ar 44100
-b:a 128k -c:v libx264 -c:a libfdk_aac -pix_fmt yuv420p -r 30 -g 60 -vb 2048k -preset slow -minrate 2000k -maxrate 4000k test.mp4On the client side I send the raw Blob from Chrome to the Node server via web socket :
var mediaStream = new MediaStream([videoOutput.getVideoTracks()[0], audioOutput.getAudioTracks()[0]]),
recorder = new MediaRecorder(mediaStream, {
mimeType: 'video/webm;codecs=vp8'
});
socket = io('http://localhost:' + port);
recorder.addEventListener('dataavailable', function (evt) {
socket.emit('video:data', evt.data);
});And in Node we simply resend via udp to the ffmpeg process :
let client = dgram.createSocket('udp4'),
client.send(chunk, 0, chunk.length, 41234, '127.0.0.1', function (err, bytes) {
if (err) {
throw err;
}
});The resulting mp4 is viewable on VLC without any issues, despite many of the following warnings showing up in the FFMPEG console :
stderr: frame= 1751 fps= 31 q=17.0 size= 15997kB time=00:00:58.39 bitrate=2244.3kbits/s dup=449 drop=32 speed=1.03x
stderr: [mp4 @ 0x7fefe6019000] Non-monotonous DTS in output stream 0:1; previous: 2573919, current: 2573792; changing to 2573920. This may result in incorrect timestamps in the output file.
stderr: frame= 1767 fps= 31 q=17.0 size= 16166kB time=00:00:58.90 bitrate=2248.4kbits/s dup=452 drop=32 speed=1.03x
stderr: [libmp3lame @ 0x7fefe7004c00] Queue input is backward in time
stderr: [mp4 @ 0x7fefe6019000] Non-monotonous DTS in output stream 0:1; previous: 2614768, current: 2614686; changing to 2614769. This may result in incorrect timestamps in the output file.However when I try to re stream this specific video on Youtube or any other RTMP platform (ex : Facebook) the audio is choppy, the command I use :
ffmpeg -i ./test.mp4 -f flv rtmp://a.rtmp.youtube.com/live2/MYAPIKEY
On the other hand any other "good" video not made from the aforementioned process re streams just fine and I suspect it might be from the warnings I’m getting.
As an added bit of information streaming directly from my PC with avfoundation to youtube also works fine, and writing from avfoundation to a file and then streaming to youtube also works ok.
The goal is to stream from my browser to the node server and directly to the Youtube RTMP without the choppy audio issue.
If someone knows how to get rid of the warning to ensure ffmpeg isn’t the issue or can point me in the direction to achieve the desired result that’d be great.
-
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