
Recherche avancée
Médias (1)
-
La conservation du net art au musée. Les stratégies à l’œuvre
26 mai 2011
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (26)
-
Keeping control of your media in your hands
13 avril 2011, parThe vocabulary used on this site and around MediaSPIP in general, aims to avoid reference to Web 2.0 and the companies that profit from media-sharing.
While using MediaSPIP, you are invited to avoid using words like "Brand", "Cloud" and "Market".
MediaSPIP is designed to facilitate the sharing of creative media online, while allowing authors to retain complete control of their work.
MediaSPIP aims to be accessible to as many people as possible and development is based on expanding the (...) -
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 -
Emballe médias : à quoi cela sert ?
4 février 2011, parCe plugin vise à gérer des sites de mise en ligne de documents de tous types.
Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;
Sur d’autres sites (5165)
-
avformat/rtsp : Send mode=record instead of mode=receive in Transport header
15 janvier 2024, par Paul Orlykavformat/rtsp : Send mode=record instead of mode=receive in Transport header
Fixes server compatibility issues with rtspclientsink GStreamer plugin.
>From specification :
RFC 7826 "Real-Time Streaming Protocol Version 2.0" (https://datatracker.ietf.org/doc/html/rfc7826), section 18.54 :
mode : The mode parameter indicates the methods to be supported for
this session. The currently defined valid value is "PLAY". If
not provided, the default is "PLAY". The "RECORD" value was
defined in RFC 2326 ; in this specification, it is unspecified
but reserved. RECORD and other values may be specified in the
future.
RFC 2326 "Real Time Streaming Protocol (RTSP)" (https://datatracker.ietf.org/doc/html/rfc2326), section 12.39 :
mode :
The mode parameter indicates the methods to be supported for
this session. Valid values are PLAY and RECORD. If not
provided, the default is PLAY.mode=receive was always like this, from the initial commit 'a8ad6ffa rtsp : Add listen mode'.
For comparison, Wowza was used to push RTSP stream to. Both GStreamer and FFmpeg had no issues.
Here is the capture of Wowza responding to SETUP request :
200 OK
CSeq : 3
Server : Wowza Streaming Engine 4.8.26+4 build20231212155517
Cache-Control : no-cache
Expires : Mon, 15 Jan 2024 19:40:31 GMT
Transport : RTP/AVP/UDP ;unicast ;client_port=11640-11641 ;mode=record ;source=172.17.0.2 ;server_port=6976-6977
Date : Mon, 15 Jan 2024 19:40:31 GMT
Session : 1401457689 ;timeout=60Test setup :
Server : ffmpeg -loglevel trace -y -rtsp_flags listen -i rtsp ://0.0.0.0:30800/live.stream t.mp4
FFmpeg client : ffmpeg -re -i "Big Buck Bunny - FULL HD 30FPS.mp4" -c:v libx264 -f rtsp rtsp ://127.0.0.1:30800/live.stream
GStreamer client : gst-launch-1.0 videotestsrc is-live=true pattern=smpte ! queue ! videorate ! videoscale ! video/x-raw,width=640,height=360,framerate=60/1 ! timeoverlay font-desc="Sans, 84" halignment=center valignment=center ! queue ! videoconvert ! tee name=t t. ! x264enc bitrate=9000 pass=cbr speed-preset=ultrafast byte-stream=false key-int-max=15 threads=1 ! video/x-h264,profile=baseline ! queue ! rsink. audiotestsrc ! voaacenc ! queue ! rsink. t. ! queue ! autovideosink rtspclientsink name=rsink location=rtsp ://localhost:30800/live.streamTest results :
modified FFmpeg client -> stock server : ok
stock FFmpeg client -> modified server : ok
modified FFmpeg client -> modified server : ok
GStreamer client -> modified server : okSigned-off-by : Paul Orlyk <paul.orlyk@gmail.com>
Signed-off-by : Michael Niedermayer <michael@niedermayer.cc> -
ffmpeg streaming video not in sync
3 avril 2019, par Tenaciousd93I have a problem saving a streaming with
ffmpeg
.
The problem is that video is not in sync with audio.The video comes 2-3 seconds before the audio.
I try by removing and editing options but nothing change, I make some research too and I try all solution described in this great answer posted here, but it didn’t work for me.
I tried to download a chunk from playlist and I’ve got a
.ts
file with audio/video in sync.If I play the streaming with
VLC player
I can hear the audio without video for some seconds, then the video appear and is in sync with audio.ffplay
play the same streaming correctly too : seems like there is the time information inside audio and video codec and can be played correctly in sync.How can I ask ffmpeg to take audio and video in sync ?
If you need ffmpeg or ffplay outputs I will post them.
Edit : as requested, I report the full ffmpeg output of a simple command to save stream output to file :
$ ffmpeg -i http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/master.m3u8?hdnts=st=1554271074~exp=1554271524~acl=/*~hmac=14df2434241f7fd52f5a6012094367180f8567a1a733f7ef9eeef3dc7b46ebb2 -c copy out.mp4
ffmpeg version 3.4.2 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --prefix=/usr/local/Cellar/ffmpeg/3.4.2 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --disable-jack --enable-gpl --enable-ffplay --enable-libmp3lame --enable-libopus --enable-librtmp --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-opencl --enable-videotoolbox --enable-openssl --disable-lzma --enable-nonfree
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
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/index_2_av-p.m3u8?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/index_2_av-b.m3u8?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/index_1_av-p.m3u8?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/index_1_av-b.m3u8?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/index_2_a-p.m3u8?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/index_2_a-b.m3u8?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427138_2_av-p.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427138_2_av-b.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427138_1_av-p.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427138_1_av-b.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427138_2_a-p.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427138_2_a-b.ts?sd=10&rebase=on' for reading
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdf0025e00] non-existing PPS 0 referenced
[h264 @ 0x7ffdf0028200] non-existing PPS 0 referenced
[h264 @ 0x7ffdf0028200] decode_slice_header error
[h264 @ 0x7ffdf0028200] no frame!
[NULL @ 0x7ffdf0025e00] non-existing PPS 0 referenced
[h264 @ 0x7ffdf0028200] non-existing PPS 0 referenced
[h264 @ 0x7ffdf0028200] decode_slice_header error
[h264 @ 0x7ffdf0028200] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[NULL @ 0x7ffdf0025e00] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[h264 @ 0x7ffdf0028200] non-existing PPS 0 referenced
[h264 @ 0x7ffdf0028200] decode_slice_header error
[h264 @ 0x7ffdf0028200] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[NULL @ 0x7ffdf0025e00] non-existing PPS 0 referenced
[h264 @ 0x7ffdf0028200] non-existing PPS 0 referenced
[h264 @ 0x7ffdf0028200] decode_slice_header error
[h264 @ 0x7ffdf0028200] no frame!
[NULL @ 0x7ffdf0025e00] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[h264 @ 0x7ffdf0028200] non-existing PPS 0 referenced
[h264 @ 0x7ffdf0028200] decode_slice_header error
[h264 @ 0x7ffdf0028200] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
[NULL @ 0x7ffdef028000] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] non-existing PPS 0 referenced
[h264 @ 0x7ffdef02a400] decode_slice_header error
[h264 @ 0x7ffdef02a400] no frame!
Input #0, hls,applehttp, from 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/master.m3u8?hdnts=st=1554271074~exp=1554271524~acl=/*~hmac=14df2434241f7fd52f5a6012094367180f8567a1a733f7ef9eeef3dc7b46ebb2':
Duration: N/A, start: 65871.264133, bitrate: N/A
Program 0
Metadata:
variant_bitrate : 528000
Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv), 400x224, 25 fps, 25 tbr, 90k tbn, 50 tbc
Metadata:
variant_bitrate : 528000
Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 528000
Stream #0:2: Data: timed_id3 (ID3 / 0x20334449)
Metadata:
variant_bitrate : 528000
Program 1
Metadata:
variant_bitrate : 528000
Stream #0:3: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv), 400x224, 25 fps, 25 tbr, 90k tbn, 50 tbc
Metadata:
variant_bitrate : 528000
Stream #0:4: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 528000
Stream #0:5: Data: timed_id3 (ID3 / 0x20334449)
Metadata:
variant_bitrate : 528000
Program 2
Metadata:
variant_bitrate : 1328000
Stream #0:6: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv), 720x404, 25 fps, 25 tbr, 90k tbn, 50 tbc
Metadata:
variant_bitrate : 1328000
Stream #0:7: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 1328000
Stream #0:8: Data: timed_id3 (ID3 / 0x20334449)
Metadata:
variant_bitrate : 1328000
Program 3
Metadata:
variant_bitrate : 1328000
Stream #0:9: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(tv), 720x404, 25 fps, 25 tbr, 90k tbn, 50 tbc
Metadata:
variant_bitrate : 1328000
Stream #0:10: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 1328000
Stream #0:11: Data: timed_id3 (ID3 / 0x20334449)
Metadata:
variant_bitrate : 1328000
Program 4
Metadata:
variant_bitrate : 128000
Stream #0:12: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 128000
Stream #0:13: Data: timed_id3 (ID3 / 0x20334449)
Metadata:
variant_bitrate : 128000
Program 5
Metadata:
variant_bitrate : 128000
Stream #0:14: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 128000
Stream #0:15: Data: timed_id3 (ID3 / 0x20334449)
Metadata:
variant_bitrate : 128000
Output #0, mp4, to 'out.mp4':
Metadata:
encoder : Lavf57.83.100
Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv), 720x404, q=2-31, 25 fps, 25 tbr, 90k tbn, 90k tbc
Metadata:
variant_bitrate : 1328000
Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp
Metadata:
variant_bitrate : 528000
Stream mapping:
Stream #0:6 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[hls,applehttp @ 0x7ffdef800000] No longer receiving playlist 1rate=1167.5kbits/s speed=4.93x
[hls,applehttp @ 0x7ffdef800000] No longer receiving playlist 5
[hls,applehttp @ 0x7ffdef800000] No longer receiving playlist 3
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427139_2_av-p.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427139_1_av-p.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] No longer receiving playlist 4
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427140_2_av-p.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427140_1_av-p.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/index_1_av-p.m3u8?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427141_1_av-p.ts?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/index_2_av-p.m3u8?sd=10&rebase=on' for reading
[hls,applehttp @ 0x7ffdef800000] Opening 'http://la7livehls-lh.akamaihd.net/i/livebkup_1@372883/segment155427141_2_av-p.ts?sd=10&rebase=on' for reading
[mp4 @ 0x7ffdf0170600] Non-monotonous DTS in output stream 0:1; previous: 1440768, current: 1439744; changing to 1440769. This may result in incorrect timestamps in the output file.
(...) -
Convert Webm to MP4 on the fly using ffmpeg for a Telegram bot using Typescript
23 novembre 2022, par HexI'm trying to make a very primitive telegram bot that get's a json and uploads the urls that are in the json to telegram.


The problem is that there are urls that point to webm files I tried to see if there is a simple way to do this and I found this : https://www.npmjs.com/package/webm-to-mp4
but it doesn't seem to work sadly, it runs into this error : "






throw new Error(`Conversion error: ${stderr}`)
 ^

Error: Conversion error: ffmpeg version n4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with emcc (Emscripten gcc/clang-like replacement) 1.39.11
 configuration: --cc=emcc --ranlib=emranlib --enable-cross-compile --target-os=none --arch=x86 --disable-runtime-cpudetect --disable-asm --disable-fast-unaligned --disable-pthreads --disable-w32threads --disable-os2threads --disable-debug --disable-stripping --disable-safe-bitstream-reader --disable-all --enable-ffmpeg --enable-avcodec --enable-avformat --enable-avfilter --enable-swresample --enable-swscale --disable-network --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vdpau --enable-decoder=vp8 --enable-decoder=h264 --enable-decoder=vorbis --enable-decoder=opus --enable-decoder=mp3 --enable-decoder=aac --enable-decoder=pcm_s16le --enable-decoder=mjpeg --enable-decoder=png --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=wav --enable-demuxer=image2 --enable-demuxer=concat --enable-protocol=file --enable-filter=aresample --enable-filter=scale --enable-filter=crop --enable-filter=overlay --enable-filter=hstack --enable-filter=vstack --disable-bzlib --disable-iconv --disable-libxcb --disable-lzma --disable-sdl2 --disable-securetransport --disable-xlib --enable-zlib --enable-encoder=libx264 --enable-encoder=libmp3lame --enable-encoder=aac --enable-muxer=mp4 --enable-muxer=mp3 --enable-muxer=null --enable-gpl --enable-libmp3lame --enable-libx264 --extra-cflags='-s USE_ZLIB=1 -I../lame/dist/include' --extra-ldflags=-L../lame/dist/lib
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavfilter 7. 57.100 / 7. 57.100
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
input.webm: Invalid data found when processing input
exception thrown: Error: Conversion error: ffmpeg version n4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with emcc (Emscripten gcc/clang-like replacement) 1.39.11
 configuration: --cc=emcc --ranlib=emranlib --enable-cross-compile --target-os=none --arch=x86 --disable-runtime-cpudetect --disable-asm --disable-fast-unaligned --disable-pthreads --disable-w32threads --disable-os2threads --disable-debug --disable-stripping --disable-safe-bitstream-reader --disable-all --enable-ffmpeg --enable-avcodec --enable-avformat --enable-avfilter --enable-swresample --enable-swscale --disable-network --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vdpau --enable-decoder=vp8 --enable-decoder=h264 --enable-decoder=vorbis --enable-decoder=opus --enable-decoder=mp3 --enable-decoder=aac --enable-decoder=pcm_s16le --enable-decoder=mjpeg --enable-decoder=png --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=wav --enable-demuxer=image2 --enable-demuxer=concat --enable-protocol=file --enable-filter=aresample --enable-filter=scale --enable-filter=crop --enable-filter=overlay --enable-filter=hstack --enable-filter=vstack --disable-bzlib --disable-iconv --disable-libxcb --disable-lzma --disable-sdl2 --disable-securetransport --disable-xlib --enable-zlib --enable-encoder=libx264 --enable-encoder=libmp3lame --enable-encoder=aac --enable-muxer=mp4 --enable-muxer=mp3 --enable-muxer=null --enable-gpl --enable-libmp3lame --enable-libx264 --extra-cflags='-s USE_ZLIB=1 -I../lame/dist/include' --extra-ldflags=-L../lame/dist/lib
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavfilter 7. 57.100 / 7. 57.100
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
input.webm: Invalid data found when processing input
,Error: Conversion error: ffmpeg version n4.2.2 Copyright (c) 2000-2019 the FFmpeg developers
 built with emcc (Emscripten gcc/clang-like replacement) 1.39.11
 configuration: --cc=emcc --ranlib=emranlib --enable-cross-compile --target-os=none --arch=x86 --disable-runtime-cpudetect --disable-asm --disable-fast-unaligned --disable-pthreads --disable-w32threads --disable-os2threads --disable-debug --disable-stripping --disable-safe-bitstream-reader --disable-all --enable-ffmpeg --enable-avcodec --enable-avformat --enable-avfilter --enable-swresample --enable-swscale --disable-network --disable-d3d11va --disable-dxva2 --disable-vaapi --disable-vdpau --enable-decoder=vp8 --enable-decoder=h264 --enable-decoder=vorbis --enable-decoder=opus --enable-decoder=mp3 --enable-decoder=aac --enable-decoder=pcm_s16le --enable-decoder=mjpeg --enable-decoder=png --enable-demuxer=matroska --enable-demuxer=ogg --enable-demuxer=mov --enable-demuxer=mp3 --enable-demuxer=wav --enable-demuxer=image2 --enable-demuxer=concat --enable-protocol=file --enable-filter=aresample --enable-filter=scale --enable-filter=crop --enable-filter=overlay --enable-filter=hstack --enable-filter=vstack --disable-bzlib --disable-iconv --disable-libxcb --disable-lzma --disable-sdl2 --disable-securetransport --disable-xlib --enable-zlib --enable-encoder=libx264 --enable-encoder=libmp3lame --enable-encoder=aac --enable-muxer=mp4 --enable-muxer=mp3 --enable-muxer=null --enable-gpl --enable-libmp3lame --enable-libx264 --extra-cflags='-s USE_ZLIB=1 -I../lame/dist/include' --extra-ldflags=-L../lame/dist/lib
 libavutil 56. 31.100 / 56. 31.100
 libavcodec 58. 54.100 / 58. 54.100
 libavformat 58. 29.100 / 58. 29.100
 libavfilter 7. 57.100 / 7. 57.100
 libswscale 5. 5.100 / 5. 5.100
 libswresample 3. 5.100 / 3. 5.100
input.webm: Invalid data found when processing input



I'm not sure what is causing it, my guess is that the webm-to.mp4 package was updated 2 years ago and something broke in the meantime.


Is there a better way to do this then downloading the webm converting it and then sending it up to telegram ? If not how could I do the conversion using just ffmpeg ?


Here is my current code :


import { Telegram, MediaSource, HTML } from 'puregram'
import { HearManager } from '@puregram/hear'
import { createReadStream } from 'fs'
import postsJson from './posts.json';
const { promises: fs } = require("fs");
const webmToMp4 = require("webm-to-mp4");

const telegram = new Telegram({
 token: '********:AAEzriis6zNNjEQuw0BxF9M2RPA9V4lEqLA'
})
const hearManager = new HearManager()

telegram.updates.startPolling()
 .then(() => console.log(`started polling @${telegram.bot.username}`))
 .catch(console.error)

telegram.updates.on('message', hearManager.middleware)

var posts = postsJson;

telegram.updates.on('message', (context) => {
 posts.forEach( async data => {
 console.error(data.ext);
 if(data.ext == "jpg" || data.ext == "png"){
 context.sendPhoto(MediaSource.url(data.image), { caption: data.content } );
 delay(1000);
 }
 if(data.ext == "gif"){
 context.sendAnimation(MediaSource.url(data.image), { caption: data.content } );
 delay(1000);
 }
 if(data.ext == "webm"){
 //context.sendDocument(MediaSource.url(data.image), { caption: data.content } );
 delay(1000);
 }
 delay(1000);
 })
})
fs.writeFile("file.mp4", Buffer.from(webmToMp4( fs.readFile("./file.webm"))));

function delay(ms: number) {
 return new Promise( resolve => setTimeout(resolve, ms) ); //This does not work either
}



I wish everoyne a nice day !