
Recherche avancée
Autres articles (80)
-
Submit enhancements and plugins
13 avril 2011If you have developed a new extension to add one or more useful features to MediaSPIP, let us know and its integration into the core MedisSPIP functionality will be considered.
You can use the development discussion list to request for help with creating a plugin. As MediaSPIP is based on SPIP - or you can use the SPIP discussion list SPIP-Zone. -
Le profil des utilisateurs
12 avril 2011, parChaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...) -
Configurer la prise en compte des langues
15 novembre 2010, parAccéder à la configuration et ajouter des langues prises en compte
Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)
Sur d’autres sites (12732)
-
Query on ffmpeg's concat demuxer parameters to end segments at outpoint timestamps and retain most properties same as input (fps, time_base etc)
17 octobre 2024, par codeIn order to concatenate video files of matching fps, codec, resolution, time_base (in fact some are segments from same video), ffmpeg concat demuxer (to prevent re-encoding) approach has been used.
But ffmpeg did not stop concatenating segments at outpoint time specified in input demuxer text file !


(Note : From Python code programmatically via sub-process approach, ffmpeg has been invoked )


input.txt file for concat demuxer contained :


ffconcat version 1.0
file 'numbered.mp4'
inpoint 2.083333
outpoint 2.166667




(the time stamps provided above are of 50th (frame pts 49 in video, this is a keyframe) to 52nd (frame pts 51 in video, non-key frame), total 3 consecutive frames, inpoints given in this query are of a key-frame


(video file referred in it i.e 'numbered.mp4' has each frame displaying its frame number ; it has h264 high coded 480p resolution, 10-seconds long with 240 frames and 24fps , <1MB in size shared at : https://filetransfer.io/data-package/F5caZ0xT#link )


ffmpeg command invoked programmatically with parameters :




ffmpeg -f concat -safe 0 -fflags +genpts -i -c copy -video_track_timescale 24




Output snippet contained :




frame= 5 fps=0.0 q=-1.0 Lsize= 28KiB time=00:00:00.12 bitrate=1857.8kbits/s speed= 56x




Problem 1 : It Shows there are 5 frames ! ffmpeg has concatenated 2 more frames beyond outpoint timestamp !


Query 1) : What are right parameter values to be given to ffmpeg concat demuxer method(or in concat demuxer input file) to make ffmpeg concatenate segments accurately till frames matching outpoint timestamp without overshooting or concatenating frames beyond outpoint timestamps ?


Problem2 : When another segment from same input file is referenced in concat demuxer input file, frame pts and timestamps were messed up in resultant output !


concat demuxer input file content(updated) :


ffconcat version 1.0
file 'numbered.mp4'
inpoint 0
outpoint 0.125000
file 'numbered.mp4'
inpoint 2.083333
outpoint 2.166667




command invoked was :


ffmpeg -f **concat **-safe 0 -fflags +genpts -i \ -c copy 
 -video_track_timescale 24 \



ffprobe output (on above output file, edited to reduce size) :



key_frame=1, pts=0
 pts_time=0.000000
key_frame=0, pts=1
 pts_time=0.041667
key_frame=0, pts=2
 pts_time=0.083333
key_frame=0, pts=3
 pts_time=0.125000
key_frame=0, pts=4
 pts_time=0.166667
key_frame=1, pts=3
 pts_time=0.125000
key_frame=0, pts=6
 pts_time=0.250000
key_frame=0, pts=5
 pts_time=0.208333
key_frame=0, pts=7
 pts_time=0.291667
key_frame=0, pts=7
 pts_time=0.291667



Confirms both pts and pts_time values are messed up (though segments referred in demuxer input file were several frames away with no overlapping ).


Query 2) What are accurate parameters to be given to concatenate segments represented by input demuxer file without causing this pts or pts_time issues ?


(In this test, all segments referred by demuxer have same parameters and are different segments of same video file itself ! so mismatch in codec parameters may not be the cause )


problem 3 : while input video had bitrate of 412654 (412.654kbps), concat demuxer resulted in output file with bitrate 1318777 (1.318 Mbps) over 3x the input bitrate.


Query 3) : What are accurate parameters to be given to retain all (almost) codec parameters same as input video and only perform concatenation without modifying time_base or framerate ?


Note : when -video_track_timescale 24 parameter is not provided as input parameter to concat demuxer, time_base in resultant output was different value (1/1000 ) instead of input files' time_base 1/24 !


( when the Pts times are messed up, Non-monotonic DTS .. errors were observed in output : [vost#0:0/copy @ 000002c1b9b41140] Non-monotonic DTS ; previous : 2, current : 1 ; changing to 3. This may result in incorrect timestamps in the output file..)


To clarify, reason to use concat demuxer is to prevent re-encoding video, final usage would be to concatenate some segments of input video file with a few more video files all containing same codec parameters like fps,resolution,time_base etc.


Query 4) : Is it accurate at frame level to take pts_time values from ffprobe output and use these in ffmpeg concat demuxer input file for inpoint/outpoint values ?


(as ffprobe pts_time values possibly might be aligned with ffmpeg expectations, thought of taking pts_time values from ffprobe command output instead of venturing into computing frame start time)


the small (<1MB) input video file used in this test has been shared at : https://filetransfer.io/data-package/F5caZ0xT#link


input video file's ffprobe output has been pasted(trimmed to save space) :


"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "High",
"codec_type": "video",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 640,
"height": 480,
"coded_width": 640,
"coded_height": 480,
"closed_captions": 0,
"film_grain": 0,
"has_b_frames": 2,
"sample_aspect_ratio": "1:1",
"display_aspect_ratio": "4:3",
"pix_fmt": "yuv420p",
"level": 41,
"color_range": "tv",
"color_space": "smpte170m",
"chroma_location": "left",
"field_order": "progressive",
"refs": 1,
"is_avc": "true",
"nal_length_size": "4",
"id": "0x1",
"r_frame_rate": "24/1",
"avg_frame_rate": "24/1",
"time_base": "1/24",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 240,
"duration": "10.000000",
"bit_rate": "409628",
"bits_per_raw_sample": "8",
"nb_frames": "240",
"extradata_size": 49,



Searched quite a lot online for a solution but searches didnot result in finding a fix for this concat demuxer situation
I seek helpful answers to the queries presented above, Thanks All


(while some workarounds like converting to raw h264 and then applying time scale again to each segment is suggested in other discussions, in current scenario, the input video file is just 1 so it appears accurate parameters to ffmpeg concat demuxer method are needed and be helpful to others facing similar issue)


-
lavfi : add a new struct for private link properties
5 août 2024, par Anton Khirnovlavfi : add a new struct for private link properties
Specifically those that should be visible to filters, but hidden from
API callers. Such properties are currently located at the end of the
public AVFilterLink struct, demarcated by a comment marking them as
private. However it is generally better to hide them explicitly, using
the same pattern already employed in avformat or avcodec.The new struct is currently trivial, but will become more useful in
following commits. -
Uncaught Exception : TypeError : Cannot read properties of undefined (reading 'format')
19 mai 2024, par gzhe1056I've been having trouble with sending the video files to be read by ffprobe. I have fluent-ffmpeg and ffprobe installed but this error shows. I'm not sure what I'm missing


index.js


const electron = require('electron')
const {app, BrowserWindow, ipcMain} = electron
const ffmpeg = require('fluent-ffmpeg')
let mainWindow
// const ffmpeg = require('@ffmpeg-installer/ffmpeg');
// app.on('ready', function(){
// console.log('App is ready')
// })
app.on('ready', function(){
 mainWindow = new BrowserWindow({
 webPreferences:{
 nodeIntegration: true,
 contextIsolation: false
 }
 })
 mainWindow.loadURL(`file://${__dirname}/index.html`)
})

ipcMain.on('video:submit', (event, path)=>{
 ffmpeg.ffprobe(path, (err, metadata)=>{
 let duration = metadata.format.duration
 console.log(err)
 mainWindow.webContents.send(
 'video:metadata',
 duration
 )
 })
})



index.html






 <h1>Video info</h1>
 <form>
 <div>
 <label>Select new video</label>
 <input type="file" accept="video/*" />
 </div>
 <input type="submit" value="Get info" />
 </form>
 <h1></h1>
 <code class="echappe-js"><script>&#xA; const electron = require(&#x27;electron&#x27;)&#xA; const {ipcRenderer} = electron&#xA; document.querySelector(&#x27;form&#x27;).addEventListener(&#x27;submit&#x27;, (event)=>{&#xA; event.preventDefault()&#xA; const {path} = document.querySelector(&#x27;input&#x27;).files[0]&#xA; ipcRenderer.send(&#x27;video:submit&#x27;, path)&#xA; })&#xA;&#xA; ipcRenderer.on(&#x27;video:metadata&#x27;, (event,duration)=>{&#xA; document.querySelector(&#x27;#result&#x27;).innerHTML = `Video duration is ${duration} seconds`&#xA; })&#xA; </script>




I tried to reinstall and udpate the ffmpeg nodes but the error still persists