
Recherche avancée
Autres articles (63)
-
Encodage et transformation en formats lisibles sur Internet
10 avril 2011MediaSPIP transforme et ré-encode les documents mis en ligne afin de les rendre lisibles sur Internet et automatiquement utilisables sans intervention du créateur de contenu.
Les vidéos sont automatiquement encodées dans les formats supportés par HTML5 : MP4, Ogv et WebM. La version "MP4" est également utilisée pour le lecteur flash de secours nécessaire aux anciens navigateurs.
Les documents audios sont également ré-encodés dans les deux formats utilisables par HTML5 :MP3 et Ogg. La version "MP3" (...) -
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 (...) -
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
Sur d’autres sites (9243)
-
Options to re-encode video with new key frames
24 novembre 2022, par muralivI need to add key frames at 2 second intervals in this video.


ffprobe input-video.mp4 
ffprobe version 5.1.2 Copyright (c) 2007-2022 the FFmpeg developers
 built with Apple clang version 14.0.0 (clang-1400.0.29.102)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/5.1.2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox
 libavutil 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 libpostproc 56. 6.100 / 56. 6.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'input-video.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42mp41
 creation_time : 2022-11-23T10:04:47.000000Z
 Duration: 00:02:00.15, start: 0.000000, bitrate: 16302 kb/s
 Stream #0:0[0x1](eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 16174 kb/s, 23.98 fps, 23.98 tbr, 24k tbn (default)
 Metadata:
 creation_time : 2022-11-23T10:04:47.000000Z
 handler_name : ?Mainconcept Video Media Handler
 vendor_id : [0][0][0][0]
 encoder : AVC Coding
 Stream #0:1[0x2](eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 125 kb/s (default)
 Metadata:
 creation_time : 2022-11-23T10:04:47.000000Z
 handler_name : #Mainconcept MP4 Sound Media Handler
 vendor_id : [0][0][0][0]



I used this ffmpeg command for this purpose.


ffmpeg -i input-video.mp4 -codec:v libx264 -r 23.976 -force_key_frames "expr:gte(t,n_forced*2)" -c:a copy -y output.mp4



However, this output.mp4 now has different video bitrate (3692 kb/s) compared to the original video (16302 kb/s). How do I use the ffmpeg command to re-encode the video with key frames and with the same bitrate as original video ?


-
streaming data with ffmpeg using pipe - freeze after few seconds
13 octobre 2022, par tamirgIm fetching some video data, and trying to stream it using ffmpeg.
what i do is create an ffmpeg process, set it to get info from '-', and then when i fetch the video data i write it to the process STDIN.


My problem is that its working, but only working for around 3 seconds, then the stream stops, and there are no longer any logs from ffmpeg.


Im running ffmpeg with log level debug, and it seems to parse the data ok, which i guess thats why it works for 3 seconds, but then the ffmpeg stops printing any more logs.


I dont want to attach all the logs because its too much, but ill write the main parts.
Maybe the ffmpeg process is missing some arguments ?


It starts with :


Clipping frame in rate conversion by 0.000008
2022-10-13T09:16:53.535546194Z cur_dts is invalid (this is harmless if it occurs once at the start per stream)
2022-10-13T09:16:53.535987546Z Last message repeated 2 times
2022-10-13T09:16:53.536012520Z [hevc @ 0x55f4e8798100] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:53.537017901Z [hevc @ 0x55f4e86eeb80] Decoded frame with POC 0.
2022-10-13T09:16:53.538652961Z [hevc @ 0x55f4e8798100] Output frame with POC 8.
2022-10-13T09:16:53.538782714Z [hevc @ 0x55f4e8789c00] Decoded frame with POC 1.
2022-10-13T09:16:53.540362322Z [hevc @ 0x55f4e8773500] Decoded frame with POC 2.
2022-10-13T09:16:53.540989229Z cur_dts is invalid (this is harmless if it occurs once at the start per stream)
2022-10-13T09:16:53.541118680Z Last message repeated 1 times
2022-10-13T09:16:53.541161109Z [hevc @ 0x55f4e86eeb80] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:53.542663730Z [hevc @ 0x55f4e86eeb80] Output frame with POC 9.
2022-10-13T09:16:53.544954074Z [hevc @ 0x55f4e8783e80] Decoded frame with POC 3.
2022-10-13T09:16:53.545102776Z cur_dts is invalid (this is harmless if it occurs once at the start per stream)
2022-10-13T09:16:53.545165406Z Last message repeated 2 times
2022-10-13T09:16:53.545175969Z [hevc @ 0x55f4e8789c00] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:53.546742754Z [hevc @ 0x55f4e8789c00] Output frame with POC 10.
2022-10-13T09:16:53.547695241Z [hevc @ 0x55f4e8877c40] Decoded frame with POC 4.
2022-10-13T09:16:53.549347290Z cur_dts is invalid (this is harmless if it occurs once at the start per stream)



then :


2022-10-13T09:16:53.828180084Z cur_dts is invalid (this is harmless if it occurs once at the start per stream)

2022-10-13T09:16:53.831843061Z Last message repeated 2 times
2022-10-13T09:16:53.831902903Z [hevc @ 0x55f4e88984c0] nal_unit_type: 32(VPS), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:53.831909160Z [hevc @ 0x55f4e88984c0] nal_unit_type: 33(SPS), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:53.831912827Z [hevc @ 0x55f4e88984c0] nal_unit_type: 34(PPS), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:53.832173968Z [hevc @ 0x55f4e88984c0] nal_unit_type: 19(IDR_W_RADL), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:53.832309139Z [hevc @ 0x55f4e88984c0] Decoding VPS
2022-10-13T09:16:53.832324955Z [hevc @ 0x55f4e88984c0] Main profile bitstream
2022-10-13T09:16:53.832651015Z [hevc @ 0x55f4e88984c0] Decoding SPS
2022-10-13T09:16:53.832730623Z [hevc @ 0x55f4e88984c0] Main profile bitstream
2022-10-13T09:16:53.832785521Z [hevc @ 0x55f4e88984c0] Decoding VUI
2022-10-13T09:16:53.832833202Z [hevc @ 0x55f4e88984c0] Decoding PPS
2022-10-13T09:16:53.833112865Z [hevc @ 0x55f4e88984c0] Output frame with POC 0.
2022-10-13T09:16:53.835713007Z [hevc @ 0x55f4e8888080] Decoded frame with POC 59.
2022-10-13T09:16:53.836572581Z [libx264 @ 0x55f4e8794800] frame= 0 QP=44.23 NAL=3 Slice:I Poc:0 I:14400 P:0 SKIP:0 size=41597 bytes
2022-10-13T09:16:53.836783822Z [rtp @ 0x55f4eaa75fc0] Sending NAL 7 of len 24 M=0
2022-10-13T09:16:53.836805582Z [rtp @ 0x55f4eaa75fc0] Sending NAL 8 of len 4 M=0
2022-10-13T09:16:53.836809885Z [rtp @ 0x55f4eaa75fc0] Sending NAL 6 of len 642 M=0
2022-10-13T09:16:53.836830503Z [rtp @ 0x55f4eaa75fc0] Sending NAL 5 of len 40913 M=1
2022-10-13T09:16:53.836836082Z [rtp @ 0x55f4eaa75fc0] NAL size 40913 > 1460
2022-10-13T09:16:53.837084718Z [hevc @ 0x55f4e88a8900] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:53.837193504Z [hevc @ 0x55f4e88a8900] Output frame with POC 1.
2022-10-13T09:16:53.844457060Z [libx264 @ 0x55f4e8794800] frame= 1 QP=48.02 NAL=2 Slice:P Poc:2 I:16 P:655 SKIP:13729 size=1459 bytes
2022-10-13T09:16:53.844621824Z [rtp @ 0x55f4eaa75fc0] Sending NAL 1 of len 1455 M=1
2022-10-13T09:16:53.844680058Z [hevc @ 0x55f4e8798100] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:53.844749212Z [hevc @ 0x55f4e8798100] Output frame with POC 2.
2022-10-13T09:16:53.851913353Z [libx264 @ 0x55f4e8794800] frame= 2 QP=44.00 NAL=2 Slice:P Poc:4 I:0 P:11 SKIP:14389 size=48 bytes



and finally the last logs are those, and afterwards i don't get anymore logs :


2022-10-13T09:16:56.836957083Z [NULL @ 0x55f4e86e7a00] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:56.837158270Z [hevc @ 0x55f4e8773500] nal_unit_type: 1(TRAIL_R), nuh_layer_id: 0, temporal_id: 0
2022-10-13T09:16:56.837355973Z [hevc @ 0x55f4e8773500] Output frame with POC 59.
2022-10-13T09:16:56.837935475Z [hevc @ 0x55f4e86eeb80] Decoded frame with POC 57.
2022-10-13T09:16:56.840799210Z [hevc @ 0x55f4e8789c00] Decoded frame with POC 58.
2022-10-13T09:16:56.842434529Z [libx264 @ 0x55f4e8794800] frame= 59 QP=33.00 NAL=2 Slice:P Poc:118 I:11 P:952 SKIP:13437 size=5251 bytes
2022-10-13T09:16:56.842472226Z [rtp @ 0x55f4eaa75fc0] Sending NAL 1 of len 5247 M=1
2022-10-13T09:16:56.842478464Z [rtp @ 0x55f4eaa75fc0] NAL size 5247 > 1460
2022-10-13T09:16:56.846625001Z [hevc @ 0x55f4e8773500] Decoded frame with POC 59.



-
FFMPEG fails with seeking params before input on AWS Lambda
18 janvier 2023, par Rashid GoshtasbiI am trying to run the following command on AWS Lambda that has FFMPEG layer but it fails with a SIGSEGV. The FFMPEG process starts working fine until it reaches the segment's it wants to get.


/opt/ffmpeglib/ffmpeg -ss 00:02:00 -t 30 -i https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa-audio-only.m3u8 /tmp/out.aac -y



Note : The url is a sample url for this sharing


What this is doing : It will seek 2 minutes into the stream url, then capture the next 30 seconds into an out.aac file. When I run this locally, it works fine. When I run this on Lambda, it ends abruptly when reading the segments that are in the time frame I want (from 2:00min to 2:30 min).


FFMPEG will skip the frames if I put the -ss 00:02:00 -t 30 before the -i which they state is faster. If i put it after the -i, it works, but of course, it's a bit slower.


Example working command :


/opt/ffmpeglib/ffmpeg -i https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa-audio-only.m3u8 -ss 00:02:00 -t 30 /tmp/out.aac -y



Wondering if anyone knows a way to run this on Lambda. Thank you.


Note : I have tried this on Python and Javascript. Tried also making child processes with Javascript and no luck. I also added -nostdin and piped stdin/out to dev null but nothing.


Thanks.


Example of me running locally :


~/D/build [1]$ ffmpeg -ss 00:02:00 -t 30 -i https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa-audio-only.m3u8 /tmp/out.aac -y 14:56:13
ffmpeg version 5.1.2 Copyright (c) 2000-2022 the FFmpeg developers
 built with Apple clang version 14.0.0 (clang-1400.0.29.102)
 configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1.2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-neon
 libavutil 57. 28.100 / 57. 28.100
 libavcodec 59. 37.100 / 59. 37.100
 libavformat 59. 27.100 / 59. 27.100
 libavdevice 59. 7.100 / 59. 7.100
 libavfilter 8. 44.100 / 8. 44.100
 libswscale 6. 7.100 / 6. 7.100
 libswresample 4. 7.100 / 4. 7.100
 libpostproc 56. 6.100 / 56. 6.100
[hls @ 0x122f05250] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa_audio_1_stereo_128000.m3u8' for reading
[hls @ 0x122f05250] Skip ('#EXT-X-VERSION:3')
[hls @ 0x122f05250] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_0.ts' for reading
[hls @ 0x122f05250] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_1.ts' for reading
Input #0, hls, from 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa-audio-only.m3u8':
 Duration: 00:03:31.43, start: 0.000000, bitrate: 0 kb/s
 Program 0 
 Metadata:
 variant_bitrate : 128000
 Stream #0:0: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp
 Metadata:
 variant_bitrate : 128000
Stream mapping:
 Stream #0:0 -> #0:0 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[hls @ 0x122f05250] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_30.ts' for reading
[hls @ 0x122f05250] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_31.ts' for reading
Output #0, adts, to '/tmp/out.aac':
 Metadata:
 encoder : Lavf59.27.100
 Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s
 Metadata:
 variant_bitrate : 128000
 encoder : Lavc59.37.100 aac
[https @ 0x12001c600] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_32.ts' for reading
[https @ 0x124038800] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_33.ts' for reading
[https @ 0x12001c600] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_34.ts' for reading
[https @ 0x124038800] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_35.ts' for reading
[https @ 0x12001c600] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_36.ts' for reading
[https @ 0x124038800] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_37.ts' for reading
[https @ 0x12001c600] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_38.ts' for reading
size= 486kB time=00:00:30.01 bitrate= 132.8kbits/s speed=10.7x 
video:0kB audio:477kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.018663%



It doesn't do anything after this line via the lambda console logs :


[hls @ 0x72faa80] Opening 'https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/audio/1_stereo_128000/hls/segment_0.ts' for reading