Skip to content

Instantly share code, notes, and snippets.

View ludovic-gasc's full-sized avatar

Ludovic Gasc ludovic-gasc

  • Brussels
View GitHub Profile
@ludovic-gasc
ludovic-gasc / ffmpeg GIF to MP4.MD
Created November 7, 2024 15:44 — forked from gvoze32/ffmpeg GIF to MP4.MD
Convert animated GIF to MP4 using ffmpeg in terminal.

To convert animation GIF to MP4 by ffmpeg, use the following command

ffmpeg -i animated.gif -movflags faststart -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" video.mp4

Description

movflags – This option optimizes the structure of the MP4 file so the browser can load it as quickly as possible.

pix_fmt – MP4 videos store pixels in different formats. We include this option to specify a specific format which has maximum compatibility across all browsers.

@ludovic-gasc
ludovic-gasc / gist:10d672b8bcf565467a28e3e15dd143b2
Created January 17, 2018 20:53
Asterisk 15 WebRTC+pjsip STUN issue log
[Jan 17 14:27:19] DEBUG[13636][C-00000005]: channel.c:5563 set_format: Channel SIP/opens.trunk_b7-00000004 setting read format path: alaw -> alaw
[Jan 17 14:27:19] DEBUG[13636][C-00000005]: channel.c:5563 set_format: Channel SIP/opens.trunk_b7-00000004 setting write format path: alaw -> alaw
-- SIP/opens.trunk_b7-00000004 is making progress passing it to PJSIP/XXXX.YYYY-00000004
[Jan 17 14:27:19] DEBUG[13568]: devicestate.c:367 _ast_device_state: No provider found, checking channel drivers for PJSIP - XXXX.YYYY
[Jan 17 14:27:19] DEBUG[13568]: devicestate.c:472 do_state_change: Changing state for PJSIP/XXXX.YYYY - state 2 (In use)
[Jan 17 14:27:19] DEBUG[13589]: res_pjsip_session.c:821 handle_negotiated_sdp_session_media: Applying negotiated SDP media stream 'audio' using audio SDP handler
[Jan 17 14:27:19] DEBUG[13589]: res_rtp_asterisk.c:6363 ast_rtp_prop_set: Ignoring duplicate RTCP property on RTP instance '0x7f4abc0c5e18'
[Jan 17 14:27:19] DEBUG[13589]: netsock2.c:170 ast_sockaddr_split_hostport: Spli
@ludovic-gasc
ludovic-gasc / result.txt
Created May 4, 2016 09:08
Seep bug with refs and default value
$ python seep_bug_default_includes.py
With ref:
{'music_on_hold_id': {}}
Without ref:
{'music_on_hold_id': None}
@ludovic-gasc
ludovic-gasc / gist:3aeb7e906b580239b42a
Created January 28, 2015 23:15
Strange bug with AsyncIO
--- Logging error ---
Traceback (most recent call last):
--- Logging error ---
Traceback (most recent call last):
Exception ignored in: <bound method Task.__del__ of <Task finished coro=<crawler() done, defined at couchdb_explorer_2.py:50> exception=ValueError('Set of coroutines/Futures is empty.',)>>
Traceback (most recent call last):
File "/usr/local/pythonz/pythons/CPython-3.4.2/lib/python3.4/asyncio/tasks.py", line 93, in __del__
File "/usr/local/pythonz/pythons/CPython-3.4.2/lib/python3.4/asyncio/futures.py", line 218, in __del__
File "/usr/local/pythonz/pythons/CPython-3.4.2/lib/python3.4/asyncio/base_events.py", line 941, in call_exception_handler
File "/usr/local/pythonz/pythons/CPython-3.4.2/lib/python3.4/logging/__init__.py", line 1303, in error
@ludovic-gasc
ludovic-gasc / gist:79fd2f172d41f1882aac
Created October 29, 2014 09:12
Quick'n'dirty example with API-Hour and aiopg
# Au démarrage du daemon
@asyncio.coroutine
def start(self):
self.stores['pg'] = yield from aiopg.create_pool(host='127.0.0.1',
port=5432,
dbname='picard',
user='asterisk',
password='proformatique',
cursor_factory=psycopg2.extras.RealDictCursor,
minsize=10,
@ludovic-gasc
ludovic-gasc / xorg.conf
Last active November 17, 2022 08:07
Xorg config file with NVidia optimus
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "intel"
Driver "intel"
BusID "PCI:0@0:2:0"