
Recherche avancée
Autres articles (112)
-
Personnaliser en ajoutant son logo, sa bannière ou son image de fond
5 septembre 2013, parCertains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;
-
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...) -
Ajouter des informations spécifiques aux utilisateurs et autres modifications de comportement liées aux auteurs
12 avril 2011, parLa manière la plus simple d’ajouter des informations aux auteurs est d’installer le plugin Inscription3. Il permet également de modifier certains comportements liés aux utilisateurs (référez-vous à sa documentation pour plus d’informations).
Il est également possible d’ajouter des champs aux auteurs en installant les plugins champs extras 2 et Interface pour champs extras.
Sur d’autres sites (8532)
-
examples : Add a VA-API encode example.
6 novembre 2017, par Jun Zhaoexamples : Add a VA-API encode example.
Supports only raw NV12 input.
Example use :
./vaapi_encode 1920 1080 test.yuv test.h264Signed-off-by : Jun Zhao <jun.zhao@intel.com>
Signed-off-by : Liu, Kaixuan <kaixuan.liu@intel.com>
Signed-off-by : Mark Thompson <sw@jkqxz.net> -
How to force specific AVInputFormat in code (FFMPEG) ?
18 février 2020, par kugipark++Plaease understand that maybe some words or sentences could not be correct English.++
I’m novice programmer and developing a video player app for Android which can play 5ch .avi video from http. It based on ffplay.c in FFMPEG libarary.
Currently I have 2 problems for this below. It has occured only in android devices.
1) Too much time taken for detecting format.
- opening and finding stream info takes more than a minute when I trying to open 5ch video source whereas normal .mp4 (h264) source open almost immediately.
2) Demuxing is too slow when it comes to large size video.
- If the resolution of video getting larger, then displaying frame rate getting slower even though there are enough memory, network and CPU resources physically.
To resolve my problem, I tried to force the format and decoders but I couldn’t found some information for specifying the input source in code level.
The official doc site only refers to a sentence about those parameters like "If non-NULL, this parameter forces a specific input format. Otherwise the format is autodetected.". So I don’t have any clues how to set the number of streams, decoders, decoders’ private options, and etc. (And also which parameters should I manage.) If someone knows how to set the options(like AVDictionary), and pass to the av functions, please let me know an exmple. The source contains 2 video streams, 1 audio stream, and 2 more extra streams (for custom data like gps). The stream information of video is below. I printed it manually, and these are auto-detected information.---------- File format information ----------
flags=2097152
video_codec_id=0 (NONE)
audio_codec_id=0 (NONE)
ctx_flags=0
data_codec_id=0 (NONE)
format_whitelist=(null)
iformat=0xa19d0d2c
---------- Stream information ----------
stream 1 of 5:
----- common ----------
bit_rate: 11383235
bits_per_coded_sample: 24
bits_per_raw_sample: 0
codec_id: 0x1C (H264)
codec_tag: 875967048
extradata_size: 0
level: -99
profile: -99
sample_rate: 0
----- Video Stream ----------
chroma_location: 0
color_primaries: 2
color_space: 2
color_trc: 2
field_order: 0
format: -1 (NONE)
height: 1080
width: 1920
sample_aspect_ratio.den: 1
sample_aspect_ratio.num: 0
video_delay: 0
----------------------------------------
stream 2 of 5:
----- common ----------
bit_rate: 6185438
bits_per_coded_sample: 24
bits_per_raw_sample: 0
codec_id: 0x1C (H264)
codec_tag: 875967048
extradata_size: 0
level: -99
profile: -99
sample_rate: 0
----- Video Stream ----------
chroma_location: 0
color_primaries: 2
color_space: 2
color_trc: 2
field_order: 0
format: -1 (NONE)
height: 720
width: 1280
sample_aspect_ratio.den: 1
sample_aspect_ratio.num: 0
video_delay: 0
----------------------------------------
stream 3 of 5:
----- common ----------
bit_rate: 352800
bits_per_coded_sample: 16
bits_per_raw_sample: 0
codec_id: 0x10000 (PCM_S16LE)
codec_tag: 1
extradata_size: 0
level: -99
profile: -99
sample_rate: 22050
----- Audio Stream ----------
block_align: 2
channels: 1
channel_layout: 0
color_range: 0
frame_size: 0
initial_padding: 0
seek_preroll: 0
trailing_padding: 0
----------------------------------------
stream 4 of 5:
----- common ----------
bit_rate: 15625
bits_per_coded_sample: 0
bits_per_raw_sample: 0
codec_id: 0x0 (NONE)
codec_tag: 0
extradata_size: 0
level: -99
profile: -99
sample_rate: 0
----- Subtitle Stream ----------
----------------------------------------
stream 5 of 5:
----- common ----------
bit_rate: 33862
bits_per_coded_sample: 0
bits_per_raw_sample: 0
codec_id: 0x0 (NONE)
codec_tag: 0
extradata_size: 0
level: -99
profile: -99
sample_rate: 0
----- Subtitle Stream ---------- -
ffmpeg concatenating videos of different fps while keeping the total length not changed
23 novembre 2017, par A_MatarI wanna pad an
mp4
video stream with another video clip of a static image that I created using :def generate_white_vid (duration):
output_filename = os.path.join(p_path,'white_vid_'+" 0:.2f}".format(duration)+'.mp4')
ffmpeg_create_vid_from_static_img = 'ffmpeg -loop 1 -i /path/WhiteBackground.jpg -c:v libx264 -t %f -pix_fmt yuv420p -vf scale=1920:1080 %s' % (duration, output_filename)
p = subprocess.Popen(ffmpeg_create_vid_from_static_img, shell=True)
p.communicate()
return output_filenameI use the following to concatenate :
def concat_vids(clip_paths):
filenames_txt = open('clips_to_join.txt','w')
for clip in clip_paths:
filenames_txt.write ('file \''+ clip+'\'\n')
filenames_txt.close()
output_filename = clip_paths[0].split('.', 2)[0]
output_file_path = os.path.join(root_path, output_filename+'-padded.mp4')
# join the clips
ffmpeg_command = ["ffmpeg", "-f", "concat", "-safe", "0", "-i", "clips_to_join.txt", "-codec", "copy", output_file_path] # output_filename = ch0X-start_time-end_time
p = subprocess.Popen(ffmpeg_command)
p.communicate() # wait till the subprocess finishes. You can send commands to process as well.
return output_file_pathWhen I check the length of the resulting video after concatenation, I find that it is not equal to the sum of the two segments that I concatenated, and sometimes it is even less by some seconds !!
Here is how I get the video length in seconds :
def ffmpeg_len(vid_path):
'''
Returns length in seconds using ffmpeg
'''
ffmpeg_get_mediafile_length = ['sh', '-c', 'ffmpeg -i "$1" 2>&1 | grep Duration', '_', vid_path]
p = subprocess.Popen(ffmpeg_get_mediafile_length, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = p.communicate()
length_regexp = 'Duration: (\d{2}):(\d{2}):(\d{2})(\.\d+),'
re_length = re.compile(length_regexp)
matches = re_length.search(output)
if matches:
video_length = int(matches.group(1)) * 3600 + \
int(matches.group(2)) * 60 + \
int(matches.group(3)) + float(matches.group(4))
return video_length
else:
print("Can't determine video length.")
print err
raise SystemExitMy guess is that maybe the concatenation unifies the
fps
rate for the all the clips to be joined, if this is the case, how to prevent this from happening ? How can I get a video of the desired length exactly.Maybe it worth mentioning that the video to padded is very short
0.42 second
, the original video is210.58
and the resultant video is210.56
!I have verified that ffmpeg does generate the desired padding region and it is of the desired length
0.42
I got a 0.43 segment when I forced30 fps
but it is okay.