
Recherche avancée
Médias (1)
-
Bug de détection d’ogg
22 mars 2013, par
Mis à jour : Avril 2013
Langue : français
Type : Video
Autres articles (29)
-
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 -
Publier sur MédiaSpip
13 juin 2013Puis-je poster des contenus à partir d’une tablette Ipad ?
Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir -
Librairies et binaires spécifiques au traitement vidéo et sonore
31 janvier 2010, parLes logiciels et librairies suivantes sont utilisées par SPIPmotion d’une manière ou d’une autre.
Binaires obligatoires FFMpeg : encodeur principal, permet de transcoder presque tous les types de fichiers vidéo et sonores dans les formats lisibles sur Internet. CF ce tutoriel pour son installation ; Oggz-tools : outils d’inspection de fichiers ogg ; Mediainfo : récupération d’informations depuis la plupart des formats vidéos et sonores ;
Binaires complémentaires et facultatifs flvtool2 : (...)
Sur d’autres sites (3552)
-
FFmpeg :Run one bat after one bat
16 avril 2018, par AniEncoderwell I tried to run a .bat file after a file gets downloaded by qBittorrent, the .bat will change font and rename it and move it another folder.
There are 3 problems
1. two .bat needed to run...font & rename
2. the file gets copied in to foldersI need to add some gap between EngSub, if i do that, it donot shows in the file output
Change Font
for %%A in (*.mkv) do ffmpeg -i "%%A" -map 0:s:0 "%%A.ass"
ren *.ass *.txt
setlocal
@echo off
call :FindReplace "Open Sans Semibold" "CronosPro-Bold" "*.txt"
call :FindReplace "&H00020713" "&H0000003B" "*.txt"
call :FindReplace ",1.7," ",2," "*.txt"
@echo on
ren *.txt *.ass
for %%A in (*.mkv) do ffmpeg -i "%%A" -i "%%A".ass -c copy -map 0:0 -map 0:1 -map 1:0 -metadata:s:s:0 language=eng -disposition:s:0 default -attach CronosPro-Bold.ttf -metadata:s:3 mimetype=application/x-truetype-font "..\720p\%%A"
del *.ass
:FindReplace <findstr> <replstr> <file>
set tmp="%temp%\tmp.txt"
If not exist %temp%\_.vbs call :MakeReplace
for /f "tokens=*" %%a in ('dir "%3" /s /b /a-d /on') do (
for /f "usebackq" %%b in (`Findstr /mic:"%~1" "%%a"`) do (
echo(&Echo Replacing "%~1" with "%~2" in file %%~nxa
<%%a cscript //nologo %temp%\_.vbs "%~1" "%~2">%tmp%
if exist %tmp% move /Y %tmp% "%%~dpnxa">nul
)
)
del %temp%\_.vbs
:MakeReplace
>%temp%\_.vbs echo with Wscript
>>%temp%\_.vbs echo set args=.arguments
>>%temp%\_.vbs echo .StdOut.Write _
>>%temp%\_.vbs echo Replace(.StdIn.ReadAll,args(0),args(1),1,-1,1)
>>%temp%\_.vbs echo end with
</file></replstr></findstr>Rename
ren "[HorribleSubs]*.mkv" "[hasu]*.mkv"
ren *[* *[1090p][Eng Sub].*
call "1080.bat"
move [hasu]*.* ..\Trash -
Android sws_scale RGB Frame taking long time and cause of latency in the video
17 avril 2018, par AJitI am reading frames from FFMPEG and try to directly draw to surface window in Native android, If i scale image to exact size what we are getting from camera and apply YUV420P to RGBA it take 1ms to scale through
av_image_fill_arrays
but if i try to scale image what i need for surface, then i take 25 to 30ms to scale same frame. so latency is the problem.In below example getting YUV420P pixel format.
Low latency :[ 1ms by sws_scale]
swsContext = sws_getContext(videoCodecContext->width,
videoCodecContext->height,
videoCodecContext->pix_fmt,
videoCodecContext->width,
videoCodecContext->height,
AV_PIX_FMT_RGB0,
SWS_FAST_BILINEAR, NULL, NULL, NULL);
av_image_fill_arrays()
av_read_frame()
avcodec_decode_video2(
sws_scale(swsContext,
(const uint8_t *const *) videoFrame->data,
videoFrame->linesize,
0,
videoCodecContext->height,
pictureFrame->data,
pictureFrame->linesize);
ANativeWindow_lock()
Write all buffer bytes to window.
ANativeWindow_unlockAndPost()Low latency :[ 30ms by sws_scale]
[videoContext Width: 848 Height: 608]
swsContext = sws_getContext(videoCodecContext->width,
videoCodecContext->height,
videoCodecContext->pix_fmt,
1080,
608,
AV_PIX_FMT_RGB0,
SWS_FAST_BILINEAR, NULL, NULL, NULL);Whenever we change context width and height other then videoContext it will take more then 30ms and we are delaying the video.
TRY 1 : Pass the buffer from JNI to Java and create bitmap there to scale later on but createBitmap itself take 500ms so no useful.
TRY 2 : Direct YUV420P to RGB conversion. still long time then
sws_scale
.TRY 3 : Direct write YUV to window bites but it show without color(If anyone have solution here will might helpful).
TRY 4 : Use
yuvlib
, no luck.TRY 5 : Different color combinations and flags in swsContext.
Any help would appreciated.
-
C pointer casting to and from Golang
26 avril 2018, par nevernewI’m writing an app for the windows platform using FFmpeg and it’s golang wrapper goav, but I’m having trouble understanding how to pass the C pointers between C and Golang.
I’ve stripped out all the relevant parts of the C code, the wrapper and my code, shown below :
C code - libavutil/frame.h
#include
typedef struct AVFrame {
#define AV_NUM_DATA_POINTERS 8
uint8_t *data[AV_NUM_DATA_POINTERS];
}Golang goav wrapper
package avutil
/*
#cgo pkg-config: libavutil
#include <libavutil></libavutil>frame.h>
#include
// C code I added:
#include
void SaveFrame(const char* location, uint8_t *data, int width, int height) {
FILE *pFile;
int y;
// Open file
pFile=fopen(location, "wb");
if(pFile==NULL)
return;
// Write header
fprintf(pFile, "P6\n%d %d\n255\n", width, height);
// Write pixel data
for(y=0; y/ Close file
fclose(pFile);
}
*/
import "C"
import (
"unsafe"
)
type Frame C.struct_AVFrame
func Data(f *Frame) *uint8 {
// i think this is the function thats not working?
return (*uint8)(unsafe.Pointer((*C.uint8_t)(unsafe.Pointer(&f.data))))
}
func SaveFrame(location string, data *uint8, width int, height int) {
C.SaveFrame(C.CString(location), unsafe.Pointer(data), C.int(width), C.int(height))
}My Golang code
package main
import "github.com/giorgisio/goav/avutil"
func main() {
var frame *avutil.Frame
var data *uint8
//... initialize frame
data = avutil.Data(frame)
avutil.SaveFrame("frame0.ppm", data, 1920, 1080)
}When I try to save the frame, the resulting image is garbled because the pointer is wrong, how do i fix this ?