
Recherche avancée
Autres articles (8)
-
Menus personnalisés
14 novembre 2010, parMediaSPIP utilise le plugin Menus pour gérer plusieurs menus configurables pour la navigation.
Cela permet de laisser aux administrateurs de canaux la possibilité de configurer finement ces menus.
Menus créés à l’initialisation du site
Par défaut trois menus sont créés automatiquement à l’initialisation du site : Le menu principal ; Identifiant : barrenav ; Ce menu s’insère en général en haut de la page après le bloc d’entête, son identifiant le rend compatible avec les squelettes basés sur Zpip ; (...) -
Le plugin : Podcasts.
14 juillet 2010, parLe problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
Types de fichiers supportés dans les flux
Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...) -
Mise à disposition des fichiers
14 avril 2011, parPar défaut, lors de son initialisation, MediaSPIP ne permet pas aux visiteurs de télécharger les fichiers qu’ils soient originaux ou le résultat de leur transformation ou encodage. Il permet uniquement de les visualiser.
Cependant, il est possible et facile d’autoriser les visiteurs à avoir accès à ces documents et ce sous différentes formes.
Tout cela se passe dans la page de configuration du squelette. Il vous faut aller dans l’espace d’administration du canal, et choisir dans la navigation (...)
Sur d’autres sites (3543)
-
FFMPEG not exporting audio OR exports audio with still video
7 septembre 2021, par Zak44Trying to utilize ffmpeg to convert a mp4 to DNxHD, then wrap it in an MXF. The ultimate goal is to get this into Avid Media Composer. I've been having issues with this particular command, where no audio is ever exported :


ffmpeg -y -r 24 -i Test_fix.mp4 -vcodec dnxhd -vsync drop -b:v 36M -s 1920x1080 -threads 2 -vf colormatrix=bt601:bt709 -c:a aac -f rawvideo BLAH.mov



If I tweak the above command by removing the force of the "rawvideo" option I get audio, however the video then sits on the first frame and never advances :


ffmpeg -y -r 24 -i Test_fix.mp4 -vcodec dnxhd -vsync drop -b:v 36M -s 1920x1080 -threads 2 -vf colormatrix=bt601:bt709 -c:a aac -r 24 BLAH.mov



What exactly am I doing wrong ? Here is the output from running the second time :


ffmpeg -y -r 24 -i Test_fix.mp4 -vcodec dnxhd -vsync drop -b:v 36M -s 1920x1080 -threads 2 -vf colormatrix=bt601:bt709 -c:a aac -r 24 BLAH.mov
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
 built with Apple clang version 12.0.0 (clang-1200.0.32.29)
 configuration: --prefix=/usr/local/Cellar/ffmpeg/4.4_2 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-avresample --enable-videotoolbox
 libavutil 56. 70.100 / 56. 70.100
 libavcodec 58.134.100 / 58.134.100
 libavformat 58. 76.100 / 58. 76.100
 libavdevice 58. 13.100 / 58. 13.100
 libavfilter 7.110.100 / 7.110.100
 libavresample 4. 0. 0 / 4. 0. 0
 libswscale 5. 9.100 / 5. 9.100
 libswresample 3. 9.100 / 3. 9.100
 libpostproc 55. 9.100 / 55. 9.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Test_fix.mp4':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42mp41
 creation_time : 2021-07-01T17:19:54.000000Z
 Duration: 00:01:05.75, start: 0.000000, bitrate: 6336 kb/s
 Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 960x540 [SAR 1:1 DAR 16:9], 6016 kb/s, 24 fps, 24 tbr, 24k tbn, 48 tbc (default)
 Metadata:
 creation_time : 2021-07-01T17:19:54.000000Z
 handler_name : ?Mainconcept Video Media Handler
 vendor_id : [0][0][0][0]
 encoder : AVC Coding
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
 Metadata:
 creation_time : 2021-07-01T17:19:54.000000Z
 handler_name : #Mainconcept MP4 Sound Media Handler
 vendor_id : [0][0][0][0]
Stream mapping:
 Stream #0:0 -> #0:0 (h264 (native) -> dnxhd (native))
 Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
Output #0, mov, to 'BLAH.mov':
 Metadata:
 major_brand : mp42
 minor_version : 0
 compatible_brands: mp42mp41
 encoder : Lavf58.76.100
 Stream #0:0(eng): Video: dnxhd (DNXHD) (AVdn / 0x6E645641), yuv422p(tv, bt709/unknown/unknown, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 36000 kb/s, 24 fps, 12288 tbn (default)
 Metadata:
 creation_time : 2021-07-01T17:19:54.000000Z
 handler_name : ?Mainconcept Video Media Handler
 vendor_id : [0][0][0][0]
 encoder : Lavc58.134.100 dnxhd
 Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
 Metadata:
 creation_time : 2021-07-01T17:19:54.000000Z
 handler_name : #Mainconcept MP4 Sound Media Handler
 vendor_id : [0][0][0][0]
 encoder : Lavc58.134.100 aac
[mov @ 0x7fd129013000] Timestamps are unset in a packet for stream 0. This is deprecated and will stop working in the future. Fix your code to set the timestamps properly
[mov @ 0x7fd129013000] Encoder did not produce proper pts, making some up.
frame= 1577 fps=133 q=1.0 Lsize= 290993kB time=00:01:05.70 bitrate=36279.7kbits/s speed=5.54x
video:290168kB audio:809kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.005816%
[aac @ 0x7fd129019000] Qavg: 22541.643



-
node.js ffmpeg spawn child_process unexpected data output
5 septembre 2021, par PLNR
I'm rather new to backend stuff, so please excuse, if my question is trivial.

For an Intranet project, I want to present a video element in a webpage (React, HLS.js Player).

The video sources are mpeg-ts streams delivered as udp multicast.

A small node.js / express server should handle the ffmpeg commands, to transcode the multicast to hls to display them in a browser.



Problem is the Output :

The output is emitted on stderr... even the process is working as expected.

Here is the respective code I wrote for transcoding so far :

const express = require("express");
const { spawn, exec } = require("child_process");
const process = require("process")

let ls;

const app = express();

app.get('/cam/:source', (body) => {
 const cam = body.params.source;
 console.log(cam);

 let source = "udp://239.1.1.1:4444";
 let stream = "/var/www/html/streams/tmp/cam1.m3u8"


 stream = spawn("ffmpeg", ["-re", "-i", source, "-c:v", "libx264", "-crf", "21", "-preset", "veryfast", "-c:a", "aac", "-b:a", "128k", "-ac", "2", "-f", "hls", "-hls_list_size", "5", "-hls_flags", "delete_segments", stream], {detached: true});

 stream.stdout.on("data", data => {
 console.log(`stdout: ${data}`);
 });

 stream.stderr.on("data", data => {
 console.log(`stderr: ${data}`);
 });

 stream.on("error", error => {
 console.log(`error: ${error.message}`);
 });

 stream.on("close", code => {
 console.log(`child process exited with code ${code}`);
 });
})

app.listen(5000, ()=> {
 console.log('Listening');
})



This is maybe only cosmetics, but it makes me wondering.

Here is the terminal output :

[nodemon] starting `node server.js`
Listening
camera stream reloaded
stderr: ffmpeg version 4.3.2-0+deb11u1ubuntu1 Copyright (c) 2000-2021 the FFmpeg developers
 built with gcc 10 (Ubuntu 10.2.1-20ubuntu1)

 --shortend--


pid: 4206
stderr: frame= 8 fps=0.0 q=0.0 size=N/A time=00:00:00.46 bitrate=N/A speed=0.931x 
pid: 4206
stderr: frame= 21 fps= 21 q=26.0 size=N/A time=00:00:00.96 bitrate=N/A speed=0.95x 
pid: 4206
stderr: frame= 33 fps= 22 q=26.0 size=N/A time=00:00:01.49 bitrate=N/A speed=0.982x 
pid: 4206
stderr: frame= 46 fps= 23 q=26.0 size=N/A time=00:00:02.00 bitrate=N/A speed=0.989x 
pid: 4206
stderr: frame= 58 fps= 23 q=26.0 size=N/A time=00:00:02.49 bitrate=N/A speed=0.986x 
pid: 4206



and so on...



Any helpful information would be highly appreciated !

Many thanks in advance

-
Spaces in FFMPEG Input Thwart Execution
2 septembre 2021, par WoolwitWhat's so baffling, is why spaces in the audio input seem to work fine, but spaces in the video input break things.
This fetches random images from a directory, pairs them with random audio clips and joins them into an mp4 video.


def makeAudioImgMovs():
 randImgs = getImgs()
 compAudClips = makeAudioClips()
 audioJpgs = dict(zip(randImgs,compAudClips)) #Heres where we join the completed audio clips and the jpgs into a dict
 for jpg, aud in audioJpgs.items():
 print(f'The img is {jpg}, the type of the img is {type(jpg)} the aud is {aud} the type of the aud is {type(aud)}')
 subprocess.call('ffmpeg -hide_banner -loglevel error -loop 1 -i "{0}" -i "{1}"\
 -filter:v \
 "fade=in:st=0:d=1, fade=out:st=10:d=1,scale=720:480:force_original_aspect_ratio=decrease,pad=720:480:(ow-iw)/2:(oh-ih)/2,setsar=1" \
 -filter:a "afade=in:st=0:d=1, afade=out:st=10:d=1" \
 -c:v libx264 -t 11 -pix_fmt yuv420p -preset faster -shortest -c:a aac {2}.mp4'.format(jpg,aud,timePath/(pathlib.Path(jpg).stem)),shell=True)
makeAudioImgMovs()



The print statement is writing what is in the dict of audioJpgs list. For example...


The img is 2021-09-02-1-40/ponty_me.jpg, the type of the img is
the aud is 2021-09-02-1-40/Jms Brn like it is like it was.aiff the type of the aud is 

The img is 2021-09-02-1-40/1966taxiToMassFromMomBack 2.tiff, the type of the img is
the aud is 2021-09-02-1-40/Lola_Fay.mp3 the type of the aud is 

[NULL @ 0x7fe503021400] Unable to find a suitable output format for '2021-09-02-1-40/1966taxiToMassFromMomBack'
2021-09-02-1-40/1966taxiToMassFromMomBack : Invalid argument


The img is 2021-09-02-1-40/1966taxiToMassFromMomBack 5.tiff, the type of the img is
the aud is 2021-09-02-1-40/M Miller Lonnie's Lament.aiff the type of the aud is 

[NULL @ 0x7fd32a854c00] Unable to find a suitable output format for '2021-09-02-1-40/1966taxiToMassFromMomBack'
2021-09-02-1-40/1966taxiToMassFromMomBack : Invalid argument


The img is 2021-09-02-1-40/10_021390_danny ? 1_jpg.jpg, the type of the img is
the aud is 2021-09-02-1-40/i_got_to_rock.mp3 the type of the aud is 

[NULL @ 0x7f8449835800] Unable to find a suitable output format for '2021-09-02-1-40/10_021390_danny ?'
2021-09-02-1-40/10_021390_danny ? : Invalid argument


The img is 2021-09-02-1-40/11_021390_danny_2_jpg.jpg, the type of the img is
the aud is 2021-09-02-1-40/M Miller Power.aiff the type of the aud is 

The last pair of img/aud complete fine and write an mp4. Notice there, that the audio file has spaces in it !
Notice that the errors 'Invalid argument' get thrown where there is a space in the jpg file name.


Help greatly appreciated.