
Recherche avancée
Autres articles (50)
-
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...) -
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 -
Changer son thème graphique
22 février 2011, parLe thème graphique ne touche pas à la disposition à proprement dite des éléments dans la page. Il ne fait que modifier l’apparence des éléments.
Le placement peut être modifié effectivement, mais cette modification n’est que visuelle et non pas au niveau de la représentation sémantique de la page.
Modifier le thème graphique utilisé
Pour modifier le thème graphique utilisé, il est nécessaire que le plugin zen-garden soit activé sur le site.
Il suffit ensuite de se rendre dans l’espace de configuration du (...)
Sur d’autres sites (5770)
-
OpenCV : FFMPEG : tag is not supported with codec id 12 and format 'mp4 / MP4
30 septembre 2023, par Tina JI was trying to run a repo located HERE. Basically, just targeting
SimpleVideoSummarizer.cc
which uses OpenCV for some basic video processing. I'm using Ubuntu 14.04. Following is the save part of the code :


void SimpleVideoSummarizer::playAndSaveSummaryVideo(char* videoFileSave) {
 cv::VideoCapture capture(videoFile);
 cv::Mat frame;
 capture.set(CV_CAP_PROP_POS_FRAMES, 0);
 cv::VideoWriter videoWriter;
 if (videoFileSave != "") {
 videoWriter = cv::VideoWriter(videoFileSave, CV_FOURCC('M', 'J', 'P', 'G'), static_cast<int>(capture.get(CV_CAP_PROP_FPS)), cv::Size(capture.get(CV_CAP_PROP_FRAME_WIDTH), capture.get(CV_CAP_PROP_FRAME_HEIGHT)));
 }
 for (std::set<int>::iterator it = summarySet.begin(); it != summarySet.end(); it++) {
 capture.set(CV_CAP_PROP_POS_FRAMES, segmentStartTimes[*it] * frameRate);
 for (int i = segmentStartTimes[*it]; i < segmentStartTimes[*it + 1]; i++) {
 for (int j = 0; j < frameRate; j++) {
 capture >> frame;
 cv::putText(frame, "Time: " + IntToString(i) + " seconds", cvPoint(30, 30),
 cv::FONT_HERSHEY_COMPLEX_SMALL, 0.8, cvScalar(200, 200, 250), 1, CV_AA);
 if (frame.data) {
 cv::imshow("Summary Video", frame);
 }
 if (videoFileSave != "") {
 videoWriter.write(frame);
 }
 // Press ESC on keyboard to exit
 char c = static_cast<char>(cv::waitKey(25));
 if (c == 27) {
 break;
 }
 }
 }
 }
 capture.release();
}
</char></int></int>



I pass an
input.mp4
file and specify aout.mp4
as well. Unfortunately, when the example is trying to save the output video file, it throws errors on the FOURCC :


OpenCV: FFMPEG: tag 0x44495658/'XVID' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'




or another one :



OpenCV: FFMPEG: tag 0x3234504d/'MP42' is not supported with codec id 15 and format 'mp4 / MP4 (MPEG-4 Part 14)'
[mp4 @ 0x16bc700] Could not find tag for codec msmpeg4v2 in stream #0, codec not currently supported in container




I tried to change the FOURCC in this part of the code which writes the video, and applied XVID, MJPG, X264, MP42, MP4V. None worked and threw similar errors.



What is the problem ? How to fix it ?


-
python ffmpeg can't save gif ,but can save mp4
21 février 2019, par waterI use python(jupyter) ffmpeg in mac , the main code is as follows :
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import animation
plt.rcParams['animation.ffmpeg_path'] = '/Users/water/anaconda/bin/ffmpeg'
fig = plt.figure()
ax = plt.axes(xlim=(0, 2), ylim=(-2, 2))
line, = ax.plot([], [], lw=2)
def init():
line.set_data([], [])
return line,
def animate(i):
x = np.linspace(0, 2, 1000)
y = np.sin(2 * np.pi * (x - 0.01 * i))
line.set_data(x, y)
return line,
anim = animation.FuncAnimation(fig, animate, init_func=init,
frames=200, interval=20, blit=True)
mywriter = animation.FFMpegWriter()
anim.save('mymovie.mp4',writer=mywriter)
plt.show()this will be right ,no error.
but i want to save as gif, I change this part :anim.save('mymovie.gif',writer=mywriter)
I get the error as follows :
37 except (AttributeError, TypeError, ValueError):
38 raise ValueError("Invalid file object: "
---> 39 "{!r}".format(fileobj)) from None
40 if fd < 0:
41 raise ValueError("Invalid file descriptor: {}".format(fd))
ValueError: Invalid file object: <_io.BufferedReader name=70>can anyone tell why gif is error and mp4 is oK ? and how to solve this problem
-
Add logo or watermark to Converted video using ffmpeg and PHP
27 mars 2022, par Medicare AdvisorsWe are converting videos to MP4 using FFMPEG.


We did a lot of research, however we cannot figure out how to add the company logo as a logo or a water mark to the converted video


PHP code


<?php 
$uploads_dir = 'original/';
$file_name = basename($_FILES['file']['name']);
$output_name = explode('.', $file_name)[0];
$uploaded_file = $uploads_dir . $file_name;
$convert_status = ['mp4' => 0, 'webm' => 0];

if(isset($_POST['submit'])) {
 if(move_uploaded_file($_FILES['file']['tmp_name'], $uploaded_file)) {
 // Make sure to get the correct path to ffmpeg
 // Run $ where ffmpeg to get the path
 $ffmpeg = '/bin/ffmpeg';
 
 // MP4
 $video_mp4 = $output_name . '.mp4';
 exec($ffmpeg . ' -i "' . $uploaded_file . '" -vcodec h264 -acodec libfdk_aac "./converted/' . $video_mp4 . '" -y 1>convert.txt 2>&1', $output, $convert_status['mp4']);

 // Debug
 // echo '<pre>' . print_r($output, 1) . ' </pre>';

 

 // Debug
 // echo '<pre>' . print_r($output, 1) . ' </pre>';
 }
}
?>



The logo we want to add is on : https://propeview.com/wp-content/uploads/2021/08/logo-whiteb.png