
Recherche avancée
Médias (1)
-
Rennes Emotion Map 2010-11
19 octobre 2011, par
Mis à jour : Juillet 2013
Langue : français
Type : Texte
Autres articles (96)
-
Encoding and processing into web-friendly formats
13 avril 2011, parMediaSPIP automatically converts uploaded files to internet-compatible formats.
Video files are encoded in MP4, Ogv and WebM (supported by HTML5) and MP4 (supported by Flash).
Audio files are encoded in MP3 and Ogg (supported by HTML5) and MP3 (supported by Flash).
Where possible, text is analyzed in order to retrieve the data needed for search engine detection, and then exported as a series of image files.
All uploaded files are stored online in their original format, so you can (...) -
Supporting all media types
13 avril 2011, parUnlike most software and media-sharing platforms, MediaSPIP aims to manage as many different media types as possible. The following are just a few examples from an ever-expanding list of supported formats : images : png, gif, jpg, bmp and more audio : MP3, Ogg, Wav and more video : AVI, MP4, OGV, mpg, mov, wmv and more text, code and other data : OpenOffice, Microsoft Office (Word, PowerPoint, Excel), web (html, CSS), LaTeX, Google Earth and (...)
-
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 (9408)
-
ffmpeg command to add moving text watermark to video [closed]
13 octobre 2023, par Imran Khan

// Constants for watermark movement, direction change intervals, fade intervals, and overlap duration
 const MOVE_SPEED = 3;
 const DIRECTION_CHANGE_MIN = 3000;
 const DIRECTION_CHANGE_MAX = 6000;
 const FADE_INTERVAL_MIN = 10000;
 const FADE_INTERVAL_MAX = 20000;
 const OVERLAP_DURATION = 2000;

 // Get references to the video container and watermarks
 const container = document.querySelector('.video-container');
 const watermark1 = document.getElementById('watermark1');
 const watermark2 = document.getElementById('watermark2');

 // Helper function to get a random integer between min and max (inclusive)
 function getRandomInt(min, max) {
 return Math.floor(Math.random() * (max - min + 1)) + min;
 }

 // Helper function to get a random direction (either 1 or -1)
 function getRandomDirection() {
 return Math.random() > 0.5 ? 1 : -1;
 }

 // Set the initial position of the watermark inside the video container
 function setInitialPosition(watermark) {
 const x = getRandomInt(0, container.offsetWidth - watermark.offsetWidth);
 const y = getRandomInt(0, container.offsetHeight - watermark.offsetHeight);
 watermark.style.left = `${x}px`;
 watermark.style.top = `${y}px`;
 watermark.style.opacity = 1;
 }

 // Function to handle continuous movement of the watermark
 function continuousMove(watermark) {
 let dx = getRandomDirection() * MOVE_SPEED;
 let dy = getRandomDirection() * MOVE_SPEED;

 // Inner function to handle the actual movement logic
 function move() {
 let x = parseInt(watermark.style.left || 0) + dx;
 let y = parseInt(watermark.style.top || 0) + dy;

 // Check boundaries and reverse direction if necessary
 if (x < 0 || x > container.offsetWidth - watermark.offsetWidth) {
 dx = -dx;
 }
 if (y < 0 || y > container.offsetHeight - watermark.offsetHeight) {
 dy = -dy;
 }

 // Apply the new position
 watermark.style.left = `${x}px`;
 watermark.style.top = `${y}px`;

 // Continue moving
 setTimeout(move, 100);
 }

 move();

 // Change direction at random intervals
 setInterval(() => {
 const randomChoice = Math.random();
 if (randomChoice < 0.33) {
 dx = getRandomDirection() * MOVE_SPEED;
 dy = 0;
 } else if (randomChoice < 0.66) {
 dy = getRandomDirection() * MOVE_SPEED;
 dx = 0;
 } else {
 dx = getRandomDirection() * MOVE_SPEED;
 dy = getRandomDirection() * MOVE_SPEED;
 }
 }, getRandomInt(DIRECTION_CHANGE_MIN, DIRECTION_CHANGE_MAX));
 }

 // Handle the fading out of the old watermark and fading in of the new watermark
 function fadeOutAndIn(oldWatermark, newWatermark) {
 setTimeout(() => {
 setInitialPosition(newWatermark);
 newWatermark.style.opacity = 1;
 }, 0);

 setTimeout(() => {
 oldWatermark.style.opacity = 0;
 }, OVERLAP_DURATION);

 // Continue the cycle
 setTimeout(() => fadeOutAndIn(newWatermark, oldWatermark), getRandomInt(FADE_INTERVAL_MIN, FADE_INTERVAL_MAX));
 }

 // Initialize the watermarks
 setInitialPosition(watermark1);
 continuousMove(watermark1);
 setTimeout(() => fadeOutAndIn(watermark1, watermark2), getRandomInt(FADE_INTERVAL_MIN, FADE_INTERVAL_MAX));
 continuousMove(watermark2);



body, html {
 height: 100%;
 margin: 0;
 font-family: Arial, sans-serif;
 display: flex;
 justify-content: center;
 align-items: center;
 background-color: #eee;
 }

 .video-container {
 width: 50vw;
 height: 50vh;
 background-color: black;
 position: relative;
 overflow: hidden;
 }

 .watermark {
 font-size: 22px;
 position: absolute;
 color: white;
 opacity: 0;
 transition: opacity 2s;
 }





 
 
 


 <div class="video-container">
 <span class="watermark">watermark</span>
 <span class="watermark">watermark</span>
 </div>
 









I am trying to achieve an animation effect using ffmpeg. I am adding text watermark to an input video and animate the text diagonally, horizontally or vertically changed randomly. Here is what I have achieved so far.


ffmpeg -i video.mp4 -c:v libx264 -preset veryfast -crf 25 -tune zerolatency -vendor ap10 -pix_fmt yuv420p -filter:v "drawtext=fontfile=./fonts/Roboto/Roboto-Light.ttf:text='Watermark':fontcolor=white:alpha=0.5:fontsize=60:y=h/10*mod(t\,10):x=w/10*mod(t\,10):enable=1" -c:a copy watermark.mp4


Here is what I want it to work.


Initial Position :
The watermark randomly placed in the video the first time they appear.


Continuous Movement :
The watermark continuously moves within the video.
The direction and speed of the watermark's movement are random. It can move diagonally, purely horizontally, or purely vertically.
When the watermark reaches the boundaries of the video, it bounces back, changing its direction.


Direction Change :
During its continuous movement, the watermark will suddenly change its direction at random intervals between 3 to 6 seconds.
When changing direction, the watermark can randomly determined move diagonally, purely horizontally, or purely vertically.


Fade In and Out :
Every 10 to 20 seconds (randomly determined), the current watermark begins to fade out.
As the old watermark starts to fade out, a new watermark fades in at a random position, ensuring that there's always a visible watermark on the screen.
These two watermarks (the fading old one and the emerging new one) overlap on the screen for a duration of 2 seconds, after which the old watermark completely disappears.
These patterns and characteristics together provide a dynamic, constantly moving, and changing watermark for the video


To achieve the result I think we can use the
drawtext
multiple times. I have attached the HTML and JavaScript variant just for the reference to understand the result but I am trying to do this using ffmpeg.

-
Installing GPAC's player - Errors
25 janvier 2016, par VirMarGuI am working with Ubuntu 14.04 LTS 64 bits.
I am trying to compile and install GPAC’s player (Osmo) in its latest version.I had an installed version, but I have tried to compile one new and finally, the previous one doesn’t already work fine.
I have made the following steps :
1. sudo apt-get install git
2. git clone https://github.com/gpac/gpac.git
3. sudo apt-get install subversion make pkg-config g++ zlib1g-dev libfreetype6-dev libjpeg62-dev libpng12-dev libopenjpeg-dev
libmad0-dev libfaad-dev libogg-dev libvorbis-dev libtheora-dev
liba52-0.7.4-dev libavcodec-dev libavformat-dev libavutil-dev
libswscale-dev libavresample-dev libxv-dev x11proto-video-dev
libgl1-mesa-dev x11proto-gl-dev linux-sound-base libxvidcore-dev
libssl-dev libjack-dev libasound2-dev libpulse-dev libsdl1.2-dev
dvb-apps libavcodec-extra libavdevice-dev libmozjs185-dev
4. cd gpac
5. ./configureThe output of the previous execution is :
** System Configuration
Install prefix: /usr/local
Source path: /home/vmg/gpac
C compiler: gcc
C++ compiler: g++
make: make
CPU: x86_64
Big Endian: no
** GPAC 0.5.2-DEV rev1167-gaef2bf4-master Core Configuration **
debug version: no
GProf enabled: no
Static build enabled: no
Memory tracking enabled: no
Fixed-Point Version: no
IPV6 Support: yes
Static Modules: no
** Detected libraries **
zlib: system
OSS Audio: yes
ALSA Audio: yes
Jack Audio: yes
PulseAudio Audio: yes
DirectFB support: no
X11 Shared Memory support: yes (path: /usr/X11R6)
X11 XVideo support: yes
SDL Support: yes
OpenGL support: yes
TinyGL support: no
OpenSSL support: yes
Mozilla XUL/GECKO support: no
DVB Support: yes
XMLRPC Support: no
wxWidgets support: no
** Extra Libraries used **
SpiderMonkey: system
FreeType: system
JPEG: system
OpenJPEG: system
PNG: system
MAD: system
FAAD: system
XVID: system
FFMPEG: system
Xiph OGG: system
Platinum UPnP: no
AVCap: no
Xiph Vorbis: system
Xiph Theora: system
A52 (AC3): system
OpenSVCDecoder: no
OpenHEVCDecoder: no
Freenect: no
Creating config.mak
config.h is unchanged
Check config.log for detection failures
Done - type 'make help' for make info, 'make' to build-
make
make -C src all
make[1] : Entering directory/home/vmg/gpac/src'
CC utils/os_divers.c
CC utils/os_file.c
CC utils/list.c
CC utils/bitstream.c
CC utils/error.c
CC utils/alloc.c
utils/alloc.c: In function ‘gf_asprintf’:
utils/alloc.c:868:2: warning: implicit declaration of function ‘asprintf’ [-Wimplicit-function-declaration]
size = asprintf(strp, fmt, args);
^
CC utils/url.c
CC utils/configfile.c
CC utils/sha1.c
CC utils/base_encoding.c
CC utils/os_net.c
CC utils/os_thread.c
CC utils/os_config_init.c
CC utils/cache.c
utils/cache.c: In function ‘gf_cache_create_entry’:
utils/cache.c:482:10: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
GF_Err err;
^
utils/cache.c:526:10: warning: variable ‘err’ set but not used [-Wunused-but-set-variable]
GF_Err err;
^
CC utils/downloader.c
utils/downloader.c: In function ‘gf_dm_connect’:
utils/downloader.c:1385:8: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]
int ret;
^
CC utils/xml_parser.c
CC utils/utf.c
CC utils/token.c
CC utils/color.c
CC utils/os_module.c
CC utils/path2d.c
CC utils/path2d_stroker.c
CC utils/module.c
CC utils/uni_bidi.c
CC utils/ringbuffer.c
CC utils/map.c
CC ietf/rtcp.c
CC ietf/rtp.c
CC ietf/rtp_packetizer.c
CC ietf/rtp_pck_3gpp.c
CC ietf/rtp_pck_mpeg12.c
CC ietf/rtp_pck_mpeg4.c
CC ietf/rtsp_command.c
CC ietf/rtsp_common.c
CC ietf/rtsp_response.c
CC ietf/rtsp_session.c
CC ietf/sdp.c
CC ietf/rtp_depacketizer.c
CC ietf/rtp_streamer.c
CC bifs/arith_decoder.c
CC bifs/bifs_codec.c
CC bifs/bifs_node_tables.c
CC bifs/com_dec.c
CC bifs/com_enc.c
CC bifs/conditional.c
CC bifs/field_decode.c
CC bifs/field_encode.c
CC bifs/memory_decoder.c
CC bifs/predictive_mffield.c
CC bifs/quantize.c
CC bifs/script_dec.c
CC bifs/script_enc.c
CC bifs/unquantize.c
CC odf/desc_private.c
CC odf/descriptors.c
CC odf/odf_code.c
odf/odf_code.c: In function ‘gf_odf_write_kw’:
odf/odf_code.c:2633:9: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
CC odf/odf_codec.c
CC odf/odf_command.c
odf/odf_command.c: In function ‘gf_odf_write_od_remove’:
odf/odf_command.c:171:9: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
odf/odf_command.c: In function ‘gf_odf_del_ipmp_update’:
odf/odf_command.c:570:9: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
CC odf/qos.c
CC odf/slc.c
odf/slc.c: In function ‘gf_odf_write_slc’:
odf/slc.c:261:9: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
CC odf/ipmpx_code.c
CC odf/oci_codec.c
CC odf/ipmpx_dump.c
CC odf/ipmpx_parse.c
CC odf/odf_dump.c
CC odf/odf_parse.c
CC laser/lsr_enc.c
CC laser/lsr_dec.c
CC laser/lsr_tables.c
CC isomedia/avc_ext.c
CC isomedia/box_code_3gpp.c
isomedia/box_code_3gpp.c: In function ‘styl_Write’:
isomedia/box_code_3gpp.c:641:9: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
CC isomedia/box_code_apple.c
CC isomedia/box_code_base.c
isomedia/box_code_base.c: In function ‘mp4a_AddBox’:
isomedia/box_code_base.c:3511:12: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
CC isomedia/box_code_drm.c
isomedia/box_code_drm.c: In function ‘schm_Write’:
isomedia/box_code_drm.c:196:9: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
CC isomedia/box_code_meta.c
CC isomedia/box_dump.c
CC isomedia/box_funcs.c
CC isomedia/data_map.c
CC isomedia/drm_sample.c
CC isomedia/isom_intern.c
CC isomedia/isom_read.c
CC isomedia/isom_store.c
CC isomedia/isom_write.c
isomedia/isom_write.c: In function ‘gf_isom_estimate_size’:
isomedia/isom_write.c:3818:9: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
CC isomedia/media.c
CC isomedia/media_odf.c
CC isomedia/meta.c
CC isomedia/movie_fragments.c
CC isomedia/sample_descs.c
CC isomedia/stbl_read.c
CC isomedia/stbl_write.c
CC isomedia/track.c
CC isomedia/tx3g.c
CC isomedia/iff.c
CC isomedia/hint_track.c
CC isomedia/hinting.c
CC isomedia/box_code_adobe.c
CC isomedia/ttml.c
CC scene_manager/scene_manager.c
scene_manager/scene_manager.c: In function ‘gf_sm_update_bitwrapper_buffer’:
scene_manager/scene_manager.c:764:11: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread(data, 1, data_size, f);
^
CC scene_manager/text_to_bifs.c
CC scene_manager/loader_bt.c
CC scene_manager/loader_xmt.c
CC scene_manager/loader_isom.c
CC scene_manager/loader_qt.c
CC scene_manager/loader_svg.c
CC scene_manager/swf_parse.c
scene_manager/swf_parse.c: In function ‘swf_def_bits_jpeg’:
scene_manager/swf_parse.c:2100:10: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
CC scene_manager/swf_bifs.c
CC scene_manager/swf_svg.c
CC scene_manager/scene_dump.c
CC scene_manager/scene_stats.c
CC scene_manager/scene_engine.c
CC scene_manager/encode_isom.c
CC terminal/channel.c
CC terminal/clock.c
CC terminal/decoder.c
CC terminal/term_node_init.c
CC terminal/input_sensor.c
CC terminal/media_control.c
CC terminal/media_manager.c
CC terminal/media_memory.c
CC terminal/media_object.c
CC terminal/media_sensor.c
CC terminal/mpeg4_inline.c
CC terminal/network_service.c
CC terminal/object_browser.c
CC terminal/object_manager.c
CC terminal/scene.c
CC terminal/terminal.c
CC terminal/svg_external.c
CC compositor/audio_input.c
CC compositor/audio_mixer.c
CC compositor/audio_render.c
CC compositor/bindable.c
CC compositor/camera.c
CC compositor/compositor.c
CC compositor/compositor_2d.c
CC compositor/compositor_3d.c
CC compositor/compositor_node_init.c
CC compositor/drawable.c
CC compositor/events.c
CC compositor/font_engine.c
CC compositor/hc_flash_shape.c
CC compositor/hardcoded_protos.c
CC compositor/mesh.c
CC compositor/mesh_collide.c
CC compositor/mesh_tesselate.c
CC compositor/mpeg4_animstream.c
CC compositor/mpeg4_audio.c
CC compositor/mpeg4_background.c
CC compositor/mpeg4_background2d.c
CC compositor/mpeg4_bitmap.c
CC compositor/mpeg4_composite.c
CC compositor/mpeg4_form.c
CC compositor/mpeg4_geometry_2d.c
CC compositor/mpeg4_geometry_3d.c
CC compositor/mpeg4_geometry_ifs2d.c
CC compositor/mpeg4_geometry_ils2d.c
CC compositor/mpeg4_gradients.c
CC compositor/mpeg4_grouping.c
CC compositor/mpeg4_grouping_2d.c
CC compositor/mpeg4_grouping_3d.c
CC compositor/mpeg4_layer_2d.c
CC compositor/mpeg4_layer_3d.c
CC compositor/mpeg4_layout.c
CC compositor/mpeg4_lighting.c
CC compositor/mpeg4_path_layout.c
CC compositor/mpeg4_sensors.c
CC compositor/mpeg4_sound.c
CC compositor/mpeg4_text.c
CC compositor/mpeg4_textures.c
CC compositor/mpeg4_timesensor.c
CC compositor/mpeg4_viewport.c
CC compositor/navigate.c
CC compositor/offscreen_cache.c
CC compositor/svg_base.c
CC compositor/svg_filters.c
CC compositor/svg_font.c
CC compositor/svg_geometry.c
CC compositor/svg_grouping.c
CC compositor/svg_media.c
CC compositor/svg_paint_servers.c
CC compositor/svg_text.c
CC compositor/texturing.c
CC compositor/texturing_gl.c
CC compositor/visual_manager.c
CC compositor/visual_manager_2d.c
CC compositor/visual_manager_2d_draw.c
CC compositor/visual_manager_3d.c
CC compositor/visual_manager_3d_gl.c
CC compositor/x3d_geometry.c
CC scenegraph/base_scenegraph.c
CC scenegraph/mpeg4_animators.c
CC scenegraph/commands.c
CC scenegraph/mpeg4_nodes.c
CC scenegraph/mpeg4_valuator.c
CC scenegraph/vrml_interpolators.c
CC scenegraph/vrml_proto.c
CC scenegraph/vrml_route.c
CC scenegraph/vrml_script.c
CC scenegraph/vrml_smjs.c
CC scenegraph/vrml_tools.c
CC scenegraph/x3d_nodes.c
CC scenegraph/svg_attributes.c
CC scenegraph/svg_types.c
CC scenegraph/svg_smjs.c
CC scenegraph/smil_anim.c
CC scenegraph/smil_timing.c
CC scenegraph/svg_properties.c
CC scenegraph/dom_events.c
CC scenegraph/dom_smjs.c
CC scenegraph/xbl_process.c
CC scenegraph/xml_ns.c
CC scenegraph/html5_media_smjs.c
CC scenegraph/html5_mse_smjs.c
CC scenegraph/webvtt_smjs.c
CC media_tools/isom_tools.c
media_tools/isom_tools.c: In function ‘gf_media_change_pl’:
media_tools/isom_tools.c:2321:9: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
CC media_tools/dash_segmenter.c
media_tools/dash_segmenter.c: In function ‘gf_media_isom_segment_file’:
media_tools/dash_segmenter.c:1666:21: warning: variable ‘SegmentNum’ set but not used [-Wunused-but-set-variable]
u32 scaler, SegmentNum;
^
media_tools/dash_segmenter.c: In function ‘dasher_isom_segment_file’:
media_tools/dash_segmenter.c:2969:6: warning: ‘track_duration2’ may be used uninitialized in this function [-Wmaybe-uninitialized]
e = dasher_isom_adjust_last_sample(in, trackNumber, track_duration2, target_duration_in_timescale, fragment_duration_in_sec);
^
media_tools/dash_segmenter.c:2952:14: note: ‘track_duration2’ was declared here
u32 i, j, track_duration2, sample_count = gf_isom_get_sample_count(in, trackNumber);
^
CC media_tools/av_parsers.c
media_tools/av_parsers.c: In function ‘gf_ac3_parser_bs’:
media_tools/av_parsers.c:4694:64: warning: variable ‘syncword’ set but not used [-Wunused-but-set-variable]
u32 fscod, frmsizecod, bsid, ac3_mod, freq, framesize, bsmod, syncword;
^
media_tools/av_parsers.c: In function ‘gf_eac3_parser_bs’:
media_tools/av_parsers.c:4759:45: warning: variable ‘syncword’ set but not used [-Wunused-but-set-variable]
u32 fscod, bsid, ac3_mod, freq, framesize, syncword, substreamid, lfon, channels, numblkscod;
^
CC media_tools/img.c
CC media_tools/media_import.c
media_tools/media_import.c: In function ‘gf_import_amr_evrc_smv’:
media_tools/media_import.c:3803:54: warning: variable ‘readen’ set but not used [-Wunused-but-set-variable]
u32 track, trackID, di, sample_rate, block_size, i, readen;
^
media_tools/media_import.c: In function ‘gf_import_raw_unit’:
media_tools/media_import.c:6971:35: warning: variable ‘readen’ set but not used [-Wunused-but-set-variable]
u32 mtype, track, di, timescale, readen;
^
CC media_tools/mpegts.c
media_tools/mpegts.c: In function ‘gf_m2ts_process_tdt_tot’:
media_tools/mpegts.c:1952:6: warning: variable ‘data_size’ set but not used [-Wunused-but-set-variable]
u32 data_size, nb_sections;
^
CC media_tools/m3u8.c
CC media_tools/mpd.c
media_tools/mpd.c: In function ‘gf_m3u8_fill_mpd_struct.isra.15’:
media_tools/mpd.c:1267:45: warning: ‘pe’ may be used uninitialized in this function [-Wmaybe-uninitialized]
set->segment_template->duration = (u32)pe->duration_info;
^
CC media_tools/dash_client.c
media_tools/dash_client.c: In function ‘gf_dash_update_manifest’:
media_tools/dash_client.c:2083:6: warning: ‘force_timeline_setup’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (force_timeline_setup) {
^
media_tools/dash_client.c: In function ‘gf_dash_get_segment_availability_start_time’:
media_tools/dash_client.c:1329:21: warning: ‘scale’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*segment_duration /= scale;
^
media_tools/dash_client.c:1324:6: note: ‘scale’ was declared here
u32 scale;
^
media_tools/dash_client.c:1328:23: warning: ‘dur’ may be used uninitialized in this function [-Wmaybe-uninitialized]
*segment_duration = (Double) dur;
^
media_tools/dash_client.c:1323:13: note: ‘dur’ was declared here
u64 start, dur;
^
media_tools/dash_client.c: In function ‘gf_dash_group_current_segment_start_time’:
media_tools/dash_client.c:1331:24: warning: ‘scale’ may be used uninitialized in this function [-Wmaybe-uninitialized]
return ((Double)start)/scale;
^
media_tools/dash_client.c:1324:6: note: ‘scale’ was declared here
u32 scale;
^
CC media_tools/media_export.c
CC media_tools/m2ts_mux.c
media_tools/m2ts_mux.c: In function ‘gf_m2ts_mux_table_get_next_packet’:
media_tools/m2ts_mux.c:486:21: warning: variable ‘table’ set but not used [-Wunused-but-set-variable]
GF_M2TS_Mux_Table *table;
^
CC media_tools/filestreamer.c
CC media_tools/avilib.c
CC media_tools/mpeg2_ps.c
CC media_tools/gpac_ogg.c
CC media_tools/ismacryp.c
CC media_tools/isom_hinter.c
CC media_tools/saf.c
CC media_tools/vobsub.c
CC media_tools/text_import.c
CC media_tools/html5_media.c
CC media_tools/html5_mse.c
media_tools/html5_mse.c: In function ‘gf_mse_parse_segment’:
media_tools/html5_mse.c:783:12: warning: variable ‘e’ set but not used [-Wunused-but-set-variable]
GF_Err e;
^
CC media_tools/webvtt.c
CC mcrypt/cbc.c
CC mcrypt/cfb.c
CC mcrypt/ctr.c
CC mcrypt/des.c
CC mcrypt/ecb.c
CC mcrypt/g_crypt.c
CC mcrypt/ncfb.c
CC mcrypt/nofb.c
CC mcrypt/ofb.c
CC mcrypt/rijndael-128.c
CC mcrypt/rijndael-192.c
CC mcrypt/rijndael-256.c
CC mcrypt/stream.c
CC mcrypt/tripledes.c
OBJS utils/os_divers.o utils/os_file.o utils/list.o utils/bitstream.o utils/error.o utils/alloc.o utils/url.o utils/configfile.o utils/sha1.o utils/base_encoding.o utils/os_net.o utils/os_thread.o utils/os_config_init.o utils/cache.o utils/downloader.o utils/xml_parser.o utils/utf.o utils/token.o utils/color.o utils/os_module.o utils/math.o utils/path2d.o utils/path2d_stroker.o utils/module.o utils/uni_bidi.o utils/ringbuffer.o utils/unicode.o utils/map.o mcrypt/cbc.o mcrypt/cfb.o mcrypt/ctr.o mcrypt/des.o mcrypt/ecb.o mcrypt/g_crypt.o mcrypt/ncfb.o mcrypt/nofb.o mcrypt/ofb.o mcrypt/rijndael-128.o mcrypt/rijndael-192.o mcrypt/rijndael-256.o mcrypt/stream.o mcrypt/tripledes.o scenegraph/base_scenegraph.o scenegraph/mpeg4_animators.o scenegraph/commands.o scenegraph/mpeg4_nodes.o scenegraph/mpeg4_valuator.o scenegraph/vrml_interpolators.o scenegraph/vrml_proto.o scenegraph/vrml_route.o scenegraph/vrml_script.o scenegraph/vrml_smjs.o scenegraph/vrml_tools.o scenegraph/x3d_nodes.o scenegraph/svg_attributes.o scenegraph/svg_types.o scenegraph/svg_smjs.o scenegraph/smil_anim.o scenegraph/smil_timing.o scenegraph/svg_properties.o scenegraph/dom_events.o scenegraph/dom_smjs.o scenegraph/xbl_process.o scenegraph/xml_ns.o scenegraph/html5_media_smjs.o scenegraph/html5_mse_smjs.o scenegraph/webvtt_smjs.o ietf/rtcp.o ietf/rtp.o ietf/rtp_packetizer.o ietf/rtp_pck_3gpp.o ietf/rtp_pck_mpeg12.o ietf/rtp_pck_mpeg4.o ietf/rtsp_command.o ietf/rtsp_common.o ietf/rtsp_response.o ietf/rtsp_session.o ietf/sdp.o ietf/rtp_depacketizer.o ietf/rtp_streamer.o bifs/arith_decoder.o bifs/bifs_codec.o bifs/bifs_node_tables.o bifs/com_dec.o bifs/com_enc.o bifs/conditional.o bifs/field_decode.o bifs/field_encode.o bifs/memory_decoder.o bifs/predictive_mffield.o bifs/quantize.o bifs/script_dec.o bifs/script_enc.o bifs/unquantize.o isomedia/avc_ext.o isomedia/box_code_3gpp.o isomedia/box_code_apple.o isomedia/box_code_base.o isomedia/box_code_drm.o isomedia/box_code_meta.o isomedia/box_dump.o isomedia/box_funcs.o isomedia/data_map.o isomedia/drm_sample.o isomedia/isom_intern.o isomedia/isom_read.o isomedia/isom_store.o isomedia/isom_write.o isomedia/media.o isomedia/media_odf.o isomedia/meta.o isomedia/movie_fragments.o isomedia/sample_descs.o isomedia/stbl_read.o isomedia/stbl_write.o isomedia/track.o isomedia/tx3g.o isomedia/iff.o isomedia/hint_track.o isomedia/hinting.o isomedia/box_code_adobe.o isomedia/ttml.o odf/desc_private.o odf/descriptors.o odf/odf_code.o odf/odf_codec.o odf/odf_command.o odf/qos.o odf/slc.o odf/ipmpx_code.o odf/oci_codec.o odf/ipmpx_dump.o odf/ipmpx_parse.o odf/odf_dump.o odf/odf_parse.o media_tools/isom_tools.o media_tools/dash_segmenter.o media_tools/av_parsers.o media_tools/img.o media_tools/media_import.o media_tools/mpegts.o media_tools/m3u8.o media_tools/mpd.o media_tools/dash_client.o media_tools/media_export.o media_tools/m2ts_mux.o media_tools/filestreamer.o media_tools/avilib.o media_tools/mpeg2_ps.o media_tools/gpac_ogg.o media_tools/ismacryp.o media_tools/isom_hinter.o media_tools/saf.o media_tools/vobsub.o media_tools/text_import.o media_tools/html5_media.o media_tools/html5_mse.o media_tools/webvtt.o scene_manager/scene_manager.o scene_manager/text_to_bifs.o scene_manager/loader_bt.o scene_manager/loader_xmt.o scene_manager/loader_isom.o scene_manager/loader_qt.o scene_manager/loader_svg.o scene_manager/swf_parse.o scene_manager/swf_bifs.o scene_manager/swf_svg.o scene_manager/scene_dump.o scene_manager/scene_stats.o scene_manager/scene_engine.o scene_manager/encode_isom.o terminal/channel.o terminal/clock.o terminal/decoder.o terminal/term_node_init.o terminal/input_sensor.o terminal/media_control.o terminal/media_manager.o terminal/media_memory.o terminal/media_object.o terminal/media_sensor.o terminal/mpeg4_inline.o terminal/network_service.o terminal/object_browser.o terminal/object_manager.o terminal/scene.o terminal/terminal.o terminal/svg_external.o compositor/audio_input.o compositor/audio_mixer.o compositor/audio_render.o compositor/bindable.o compositor/camera.o compositor/compositor.o compositor/compositor_2d.o compositor/compositor_3d.o compositor/compositor_node_init.o compositor/drawable.o compositor/events.o compositor/font_engine.o compositor/hc_flash_shape.o compositor/hardcoded_protos.o compositor/mesh.o compositor/mesh_collide.o compositor/mesh_tesselate.o compositor/mpeg4_animstream.o compositor/mpeg4_audio.o compositor/mpeg4_background.o compositor/mpeg4_background2d.o compositor/mpeg4_bitmap.o compositor/mpeg4_composite.o compositor/mpeg4_form.o compositor/mpeg4_geometry_2d.o compositor/mpeg4_geometry_3d.o compositor/mpeg4_geometry_ifs2d.o compositor/mpeg4_geometry_ils2d.o compositor/mpeg4_gradients.o compositor/mpeg4_grouping.o compositor/mpeg4_grouping_2d.o compositor/mpeg4_grouping_3d.o compositor/mpeg4_layer_2d.o compositor/mpeg4_layer_3d.o compositor/mpeg4_layout.o compositor/mpeg4_lighting.o compositor/mpeg4_path_layout.o compositor/mpeg4_sensors.o compositor/mpeg4_sound.o compositor/mpeg4_text.o compositor/mpeg4_textures.o compositor/mpeg4_timesensor.o compositor/mpeg4_viewport.o compositor/navigate.o compositor/offscreen_cache.o compositor/svg_base.o compositor/svg_filters.o compositor/svg_font.o compositor/svg_geometry.o compositor/svg_grouping.o compositor/svg_media.o compositor/svg_paint_servers.o compositor/svg_text.o compositor/texturing.o compositor/texturing_gl.o compositor/visual_manager.o compositor/visual_manager_2d.o compositor/visual_manager_2d_draw.o compositor/visual_manager_3d.o compositor/visual_manager_3d_gl.o compositor/x3d_geometry.o laser/lsr_enc.o laser/lsr_dec.o laser/lsr_tables.o
LIBS -lm -L/usr/local/lib -lGL -lGLU -lX11 -lz -lssl -lcrypto -lmozjs185 -lplds4 -lplc4 -lnspr4 -ljpeg -lpng -lpthread -ldl
mv ../bin/gcc/libgpac.so ../bin/gcc/libgpac.so.6.0.0
ln -sf libgpac.so.6.0.0 ../bin/gcc/libgpac.so.6
ln -sf libgpac.so.6.0.0 ../bin/gcc/libgpac.so
make[1]: Leaving directory/home/vmg/gpac/src’
make -C applications all
make[1] : Entering directory/home/vmg/gpac/applications'
set -e; for i in mp4client mp4box mp42ts dashcast ; do make -C $i all; done
make[2]: Entering directory/home/vmg/gpac/applications/mp4client’
make[2] : Leaving directory/home/vmg/gpac/applications/mp4client'
make[2]: Entering directory/home/vmg/gpac/applications/mp4box’
make[2] : Leaving directory/home/vmg/gpac/applications/mp4box'
make[2]: Entering directory/home/vmg/gpac/applications/mp42ts’
make[2] : Leaving directory/home/vmg/gpac/applications/mp42ts'
make[2]: Entering directory/home/vmg/gpac/applications/dashcast’
CC audio_decoder.c
audio_decoder.c : In function ‘dc_audio_decoder_read’ :
audio_decoder.c:276:48 : error : ‘AVFrame’ has no member named ‘channels’
int num_channels = audio_input_data->aframe->channels ;
^
make[2] : * [audio_decoder.o] Error 1
make[2] : Leaving directory/home/vmg/gpac/applications/dashcast'
make[1]: *** [apps] Error 2
make[1]: Leaving directory/home/vmg/gpac/applications’
make : * [all] Error 2
Regarding to ffmpeg-libraries :
ffmpeg version N-74748-gbaeb8f5 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04)
configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libdcadec --enable-libfreetype --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 59.100 / 56. 59.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.100 / 5. 40.100
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100I don’t know if the error is due to some incompatibility with the libraries or if I must uninstall the previous GPAC (I don’t know how to make it because there is no uninstall script).
I will appreciate any help.
Thank you ! -
-
AWS Lambda : ffmpeg thumbnails Generator : empty JPG
3 septembre 2020, par MagikeyWhen a video is uploaded on S3 i want to store a JPG screenshot.



On a lambda function with amazon AWS, i do :



...

 let tmpFile = createWriteStream(`/tmp/screenshot.jpg`)

 var ffmpeg = spawn(ffmpegPath, [
 "-ss","00:00:05",
 "-i", target,
 "-vf", "thumbnail,scale=200:200", 
 "-qscale:v" ,"2",
 "-frames:v", "1",
 "-f", "image2",
 "-c:v", "mjpeg",
 "pipe:1"
 ]);

 ffmpeg.stdout.pipe(tmpFile).on("error", err => {
 console.log("Error A: ",err);
 });

 ffmpeg.on('error', err => {
 console.log("Error B", err)
 reject()
 })

 ffmpeg.on('close', code => {
 tmpFile.end();
 console.log('Log A', ffmpeg);

 child_process.exec("echo `ls -l -R /tmp`",
 (error, stdout, stderr) => {
 console.log(stdout)
 });

 resolve()
 })
...




But the result is an empty JPG file in S3.



Logs shows no errors, my "target" is OK, stdout ls show me the empty JPG file.



I have try a lot of things, like use other version of ffmpeg but same.



There is the "console.log('Log A', ffmpeg)" :



ChildProcess {
 _events: [Object: null prototype] { error: [Function], close: [Function] },
 _eventsCount: 2,
 _maxListeners: undefined,
 _closesNeeded: 3,
 _closesGot: 3,
 connected: false,
 signalCode: 'SIGSEGV',
 exitCode: null,
 killed: false,
 spawnfile: '/opt/nodejs/ffmpeg',
 _handle: null,
 spawnargs: [
 '/opt/nodejs/ffmpeg',
 '-ss',
 '00:00:05',
 '-i',
 'https://xxxxxxxxx',
 '-vf',
 'thumbnail,scale=200:200',
 '-qscale:v',
 '2',
 '-frames:v',
 '1',
 '-f',
 'image2',
 '-v',
 '16',
 '-c:v',
 'mjpeg',
 'pipe:1'
 ],
 pid: 24,
 stdin: Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: ReadableState {
 objectMode: false,
 highWaterMark: 16384,
 buffer: BufferList { head: null, tail: null, length: 0 },
 length: 0,
 pipes: null,
 pipesCount: 0,
 flowing: null,
 ended: false,
 endEmitted: false,
 reading: false,
 sync: true,
 needReadable: false,
 emittedReadable: false,
 readableListening: false,
 resumeScheduled: false,
 paused: true,
 emitClose: false,
 autoDestroy: false,
 destroyed: true,
 defaultEncoding: 'utf8',
 awaitDrain: 0,
 readingMore: false,
 decoder: null,
 encoding: null
 },
 readable: false,
 _events: [Object: null prototype] { end: [Function: onReadableStreamEnd] },
 _eventsCount: 1,
 _maxListeners: undefined,
 _writableState: WritableState {
 objectMode: false,
 highWaterMark: 16384,
 finalCalled: false,
 needDrain: false,
 ending: false,
 ended: false,
 finished: false,
 destroyed: true,
 decodeStrings: false,
 defaultEncoding: 'utf8',
 length: 0,
 writing: false,
 corked: 0,
 sync: true,
 bufferProcessing: false,
 onwrite: [Function: bound onwrite],
 writecb: null,
 writelen: 0,
 bufferedRequest: null,
 lastBufferedRequest: null,
 pendingcb: 0,
 prefinished: false,
 errorEmitted: false,
 emitClose: false,
 autoDestroy: false,
 bufferedRequestCount: 0,
 corkedRequestsFree: [Object]
 },
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 [Symbol(asyncId)]: 5,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 },
 stdout: Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: ReadableState {
 objectMode: false,
 highWaterMark: 16384,
 buffer: BufferList { head: null, tail: null, length: 0 },
 length: 0,
 pipes: null,
 pipesCount: 0,
 flowing: false,
 ended: true,
 endEmitted: true,
 reading: false,
 sync: false,
 needReadable: false,
 emittedReadable: false,
 readableListening: false,
 resumeScheduled: false,
 paused: false,
 emitClose: false,
 autoDestroy: false,
 destroyed: true,
 defaultEncoding: 'utf8',
 awaitDrain: 0,
 readingMore: false,
 decoder: null,
 encoding: null
 },
 readable: false,
 _events: [Object: null prototype] {
 end: [Function: onReadableStreamEnd],
 close: [Function]
 },
 _eventsCount: 2,
 _maxListeners: undefined,
 _writableState: WritableState {
 objectMode: false,
 highWaterMark: 16384,
 finalCalled: false,
 needDrain: false,
 ending: false,
 ended: false,
 finished: false,
 destroyed: true,
 decodeStrings: false,
 defaultEncoding: 'utf8',
 length: 0,
 writing: false,
 corked: 0,
 sync: true,
 bufferProcessing: false,
 onwrite: [Function: bound onwrite],
 writecb: null,
 writelen: 0,
 bufferedRequest: null,
 lastBufferedRequest: null,
 pendingcb: 0,
 prefinished: false,
 errorEmitted: false,
 emitClose: false,
 autoDestroy: false,
 bufferedRequestCount: 0,
 corkedRequestsFree: [Object]
 },
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 write: [Function: writeAfterFIN],
 [Symbol(asyncId)]: 6,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 },
 stderr: Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: ReadableState {
 objectMode: false,
 highWaterMark: 16384,
 buffer: BufferList { head: null, tail: null, length: 0 },
 length: 0,
 pipes: null,
 pipesCount: 0,
 flowing: null,
 ended: true,
 endEmitted: true,
 reading: false,
 sync: false,
 needReadable: false,
 emittedReadable: false,
 readableListening: false,
 resumeScheduled: false,
 paused: true,
 emitClose: false,
 autoDestroy: false,
 destroyed: true,
 defaultEncoding: 'utf8',
 awaitDrain: 0,
 readingMore: false,
 decoder: null,
 encoding: null
 },
 readable: false,
 _events: [Object: null prototype] {
 end: [Function: onReadableStreamEnd],
 close: [Function]
 },
 _eventsCount: 2,
 _maxListeners: undefined,
 _writableState: WritableState {
 objectMode: false,
 highWaterMark: 16384,
 finalCalled: false,
 needDrain: false,
 ending: false,
 ended: false,
 finished: false,
 destroyed: true,
 decodeStrings: false,
 defaultEncoding: 'utf8',
 length: 0,
 writing: false,
 corked: 0,
 sync: true,
 bufferProcessing: false,
 onwrite: [Function: bound onwrite],
 writecb: null,
 writelen: 0,
 bufferedRequest: null,
 lastBufferedRequest: null,
 pendingcb: 0,
 prefinished: false,
 errorEmitted: false,
 emitClose: false,
 autoDestroy: false,
 bufferedRequestCount: 0,
 corkedRequestsFree: [Object]
 },
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 write: [Function: writeAfterFIN],
 [Symbol(asyncId)]: 7,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 },
 stdio: [
 Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: [ReadableState],
 readable: false,
 _events: [Object: null prototype],
 _eventsCount: 1,
 _maxListeners: undefined,
 _writableState: [WritableState],
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 [Symbol(asyncId)]: 5,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 },
 Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: [ReadableState],
 readable: false,
 _events: [Object: null prototype],
 _eventsCount: 2,
 _maxListeners: undefined,
 _writableState: [WritableState],
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 write: [Function: writeAfterFIN],
 [Symbol(asyncId)]: 6,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 },
 Socket {
 connecting: false,
 _hadError: false,
 _parent: null,
 _host: null,
 _readableState: [ReadableState],
 readable: false,
 _events: [Object: null prototype],
 _eventsCount: 2,
 _maxListeners: undefined,
 _writableState: [WritableState],
 writable: false,
 allowHalfOpen: false,
 _sockname: null,
 _pendingData: null,
 _pendingEncoding: '',
 server: null,
 _server: null,
 write: [Function: writeAfterFIN],
 [Symbol(asyncId)]: 7,
 [Symbol(kHandle)]: null,
 [Symbol(lastWriteQueueSize)]: 0,
 [Symbol(timeout)]: null,
 [Symbol(kBuffer)]: null,
 [Symbol(kBufferCb)]: null,
 [Symbol(kBufferGen)]: null,
 [Symbol(kBytesRead)]: 0,
 [Symbol(kBytesWritten)]: 0
 }
 ]
} ```