Recherche avancée

Médias (91)

Autres articles (14)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Other interesting software

    13 avril 2011, par

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website : http://videopress.com/
    License : GNU/GPL v2
    Source code : (...)

  • Qu’est ce qu’un éditorial

    21 juin 2013, par

    Ecrivez votre de point de vue dans un article. Celui-ci sera rangé dans une rubrique prévue à cet effet.
    Un éditorial est un article de type texte uniquement. Il a pour objectif de ranger les points de vue dans une rubrique dédiée. Un seul éditorial est placé à la une en page d’accueil. Pour consulter les précédents, consultez la rubrique dédiée.
    Vous pouvez personnaliser le formulaire de création d’un éditorial.
    Formulaire de création d’un éditorial Dans le cas d’un document de type éditorial, les (...)

Sur d’autres sites (2875)

  • FFmpeg output video is not seekable. Output video is not playing instantly instead browser loads it completely then plays it

    19 février 2024, par Mohit56

    Hi I am using ffmpeg to transcode video. In my code I have used 'fluent-ffmpeg' npm package with nodeJs and 'aws-sdk' to save output video by writestream into s3 bucket.

    


    Problem
-> Video is getting transcoded and I am successfully able to save the video into s3 bucket but. As I paste the object_url of that video into browser and try to play, but that video is not playing instantly I have checked on 'developer console tool' browser is loading all the video once that is done then only it starts playing that is a problem.

    


    ->Let say if I have output video of size 10GB on that case browser will load all 10GB data then only it will start playing that video.

    


    ->If I am not using writestream approach and directly upload the video into local directory first then upload into s3 bucket, In this case if I play the video using object URL then that video plays instantly. In this case I don't have to wait for whole 10GB video to load then play it which is good.

    


    -> Can anybody help me to fix my writestream solution because I don't want to save the output video into my localdirectory. I want to writestream the output video directly into s3 bucket.

    


    Code Snippet

    


    const ffmpeg = require('fluent-ffmpeg');
const AWS = require('aws-sdk'); 
const stream = require("stream");

//set up your aws connection

const command = ffmpeg(inputVideoURL) 
.outputOptions(['-movflags', 'frag_keyframe']) 
.size('854x480') // set the desired resolution (480p) .outputFormat('mp4') 
.videoCodec('libx264') 
.audioCodec('aac') 
.on('progress',(p)=>{ console.log(p) }) 
.on('stderr',(err)=>console.log(err)) 
.on('start', commandLine => console.log('Spawned FFmpeg with command: ' + commandLine)) 
.on('end', () => console.log('Transcoding finished.')) 
.on('error', err => console.error('Error:', err))

//=>To save file into s3 using write steam. command.writeToStream(uploadFolderFileWriteStream('StreamCheck/output2.mp4'));

function uploadFolderFileWriteStream(fileName) { try { const pass = new stream.PassThrough();

const params = {
  Bucket: bucketName,
  Key: fileName,
  Body: pass,
  ACL: "public-read",
  ContentType:'video/mp4' ,
};

const upload = s3.upload(params);

upload.on('error', function(err) {
  console.log("Error uploading to S3:", err);
});

upload.send(function(err, data) {
  if(err) console.log(err);
  else console.log("Upload to S3 completed:", data);
});

return pass;

} catch (err) { console.log("[S3 createWriteStream]", err); } }


    


    I have tried below option as well be all of them not worked 
-> .addOption("-movflags frag_keyframe+empty_moov") 
-> .addOption('-movflags', 'frag_keyframe+empty_moov') 
-> .addOutputOption("-movflags +faststart")
-> .addOption('-movflags', 'faststart+frag_keyframe+empty_moov+default_base_moof')


    


  • discord.py ffmpeg song plays too quickly at the beginning

    30 mai 2023, par C-Gian

    I built a discord bot using discord.py and ffmpeg, it works but the song in the first 0-5 seconds plays too fast, I think it's buffering so I tried to use asyncio.sleep but didn't work, suggestions to solve the problem ?

    


    play func :

    


    with youtube_dl.YoutubeDL(self.opts) as ydl:
    await asyncio.sleep(0.1)
    ydl.cache.remove()
    await asyncio.sleep(0.1)
    info = ydl.extract_info(url, download=False)
    raw_url_song = info['formats'][0]['url']
    await self.real_play(ctx, raw_url_song)


    


    real_play func :

    


    source = await discord.FFmpegOpusAudio.from_probe(processed_url_song, **self.FFMPEG_OPTIONS)
await asyncio.sleep(0.5)
self.vc.play(source, after=lambda e: asyncio.run_coroutine_threadsafe(self.real_play(ctx, processed_url_song), self.client.loop))


    


    these are the options :

    


    self.FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
self.OPTIONS = {'format': 'bestaudio'}
self.opts = {'extract_flat': True, 'skip_download': True}


    


    the functions are separate because I do something else (such as playlists), I have reported only the essential code to understand the problem, and the cache remove is essential to reduce the occurence of HTTP 404 forbidden error, btw also without cache remove the problem persists

    


  • AC3 decoding throws error number -16976906 ... vlc plays well

    23 décembre 2022, par user1940163

    I have got a mpeg ts file with following composition (shown by ffprobe)

    


    ffprobe version N-109444-geef763c705 Copyright (c) 2007-2022 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --enable-openssl
  libavutil      57. 43.100 / 57. 43.100
  libavcodec     59. 55.103 / 59. 55.103
  libavformat    59. 34.102 / 59. 34.102
  libavdevice    59.  8.101 / 59.  8.101
  libavfilter     8. 53.100 /  8. 53.100
  libswscale      6.  8.112 /  6.  8.112
  libswresample   4.  9.100 /  4.  9.100
[mpegts @ 0x56201c2c1cc0] Could not find codec parameters for stream 1 (Audio: ac3 ([129][0][0][0] / 0x0081), stereo, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpegts, from 'ff_vlc.ts':
  Duration: 00:10:00.02, start: 1.400000, bitrate: 1839 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
  Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 856x480 [SAR 320:321 DAR 16:9], 30 fps, 59.94 tbr, 90k tbn
  Stream #0:1[0x101](spa): Audio: ac3 ([129][0][0][0] / 0x0081), stereo, fltp


    



    


    I intend to transcode this so that I copy the video as it is but the audio will be encoded to aac ...so that I can play it in the browser.

    


    I use the following ffmpeg command to attempt that

    


    ffmpeg -i ff_vlc.ts -vcodec copy -acodec aac -map 0:v:0 -map 0:a:0 ff_vlc_2.ts


    


    this throws errors with -16976906 as follows..........( I have clipped the repetitive excessively long output)

    


    ffmpeg -i ff_vlc.ts -vcodec copy -acodec aac -map 0:v:0 -map 0:a:0 ff_vlc_2.ts
ffmpeg version N-109444-geef763c705 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --enable-openssl
  libavutil      57. 43.100 / 57. 43.100
  libavcodec     59. 55.103 / 59. 55.103
  libavformat    59. 34.102 / 59. 34.102
  libavdevice    59.  8.101 / 59.  8.101
  libavfilter     8. 53.100 /  8. 53.100
  libswscale      6.  8.112 /  6.  8.112
  libswresample   4.  9.100 /  4.  9.100
[mpegts @ 0x55b4369b2440] Could not find codec parameters for stream 1 (Audio: ac3 ([129][0][0][0] / 0x0081), stereo, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, mpegts, from 'ff_vlc.ts':
  Duration: 00:10:00.02, start: 1.400000, bitrate: 1839 kb/s
  Program 1
    Metadata:
      service_name    : Service01
      service_provider: FFmpeg
  Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709, progressive), 856x480 [SAR 320:321 DAR 16:9], 30 fps, 59.94 tbr, 90k tbn
  Stream #0:1[0x101](spa): Audio: ac3 ([129][0][0][0] / 0x0081), stereo, fltp
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (ac3 (native) -> aac (native))
Press [q] to stop, [?] for help
Error while decoding stream #0:1: Error number -16976906 occurred
    Last message repeated 17065 times
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Error while decoding stream #0:1: Error number -16976906 occurred
    Last message repeated 2 times
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Error while decoding stream #0:1: Error number -16976906 occurred
    Last message repeated 2 times
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Error while decoding stream #0:1: Error number -16976906 occurred
    Last message repeated 2 times
....
....
....(repetitive output clipped and removed)
....
....
    Last message repeated 2 times
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Error while decoding stream #0:1: Error number -16976906 occurred
    Last message repeated 2 times
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Error while decoding stream #0:1: Error number -16976906 occurred
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
Too many packets buffered for output stream 0:0.
Error submitting a packet to the muxer for output stream #0:0.
[abuffer @ 0x56289e5ab100] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
    Last message repeated 1 times
[abuffer @ 0x56289e5ab100] Error setting option time_base to value 1/0.
[graph_0_in_0_1 @ 0x5628a3f5e800] Error applying options to the filter.
Error reinitializing filters!
Error while filtering: Numerical result out of range
Finishing stream 0:1 without any data written to it.
[abuffer @ 0x56289b2b89c0] Value inf for parameter 'time_base' out of range [0 - 2.14748e+09]
    Last message repeated 1 times
[abuffer @ 0x56289b2b89c0] Error setting option time_base to value 1/0.
[graph_0_in_0_1 @ 0x56289a63e780] Error applying options to the filter.
Error configuring filter graph
Conversion failed!


    



    


    I tried the above even with this command

    


    ffmpeg -analyzeduration 2147483647 -probesize 2147483647 -i ff_vlc.ts -vcodec copy -acodec aac -map 0:v:0 -map 0:a:0 ff_vlc_2.ts


    


    Still get the same errors. Only changed lines in the output are

    


    [mpegts @ 0x55e1b757d580] Failed to allocate buffers for seekback
[mpegts @ 0x55e1b757d580] Could not find codec parameters for stream 1 (Audio: ac3 ([129][0][0][0] / 0x0081), stereo, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' (2147483647) and 'probesize' (2147483647) options


    



    


    VLC player has no problems in playing this audio ... only ffmpeg cannot decode.

    


    How do I fix this ?

    


    Please help
Thanks