
Recherche avancée
Médias (1)
-
Somos millones 1
21 juillet 2014, par
Mis à jour : Juin 2015
Langue : français
Type : Video
Autres articles (53)
-
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 -
Déploiements possibles
31 janvier 2010, parDeux types de déploiements sont envisageable dépendant de deux aspects : La méthode d’installation envisagée (en standalone ou en ferme) ; Le nombre d’encodages journaliers et la fréquentation envisagés ;
L’encodage de vidéos est un processus lourd consommant énormément de ressources système (CPU et RAM), il est nécessaire de prendre tout cela en considération. Ce système n’est donc possible que sur un ou plusieurs serveurs dédiés.
Version mono serveur
La version mono serveur consiste à n’utiliser qu’une (...)
Sur d’autres sites (9219)
-
ffmpeg m4a/m4b/mp4 output file's "Time" value is incorrect when read into iTunes
2 juin 2019, par PistoletPierreI’m using ffmpeg to convert audiobooks to m4a/m4b/mp4. All seems to work until trying to play them in iTunes. It plays in VLC, QuickTime, and MacOS’s Quicklook without issue.
"So why are you posting here ? This isn’t an iTunes forum."
I’m hoping this is iTunes being picky about file formats and that I can add some magic argument to my ffmpeg command and have it spit out something that iTunes can read.
Below is the bash function I’m using to do the conversion. I’ve tried m4a/mp4/m4b as values for TEMP_FILE_EXTENSION and tried opening the intermediate file as well. It’s always the same corrupted "Time" value when you put it in iTunes.
dedrm_audible () {
# Check for AtomicParsley, ffmpeg, and 3 args
if (! type AtomicParsley >/dev/null 2>/dev/null) || (! type ffmpeg >/dev/null 2>/dev/null) || [ ! $# -eq 3 ]; then
echo "Usage:"
echo " dedrm_audible <path to="to"> <activation bytes="bytes"> <path to="to" output="output" file="file">"
echo " Note: AtomicParsley and ffmpeg must be in PATH variable"
return
fi
local ORIGINAL_PWD="$(pwd)"
local TEMP_DIR="/tmp/audible"
local AUDIOBOOK_FILE="$1"
local ACTIVATION_BYTES="$2"
local OUTPUT_FILE="$3"
local FULL_AUDIOBOOK_PATH="$(realpath "${AUDIOBOOK_FILE}")"
local OUTPUT_PATH="$(realpath "${OUTPUT_FILE}")"
local TEMP_FILE_EXTENSION="m4a"
mkdir -p "${TEMP_DIR}"
cd "${TEMP_DIR}"
# Extract the book cover
ffmpeg -activation_bytes "${ACTIVATION_BYTES}" -i "${FULL_AUDIOBOOK_PATH}" -vcodec copy artwork.png
# Convert the audio
ffmpeg -activation_bytes "${ACTIVATION_BYTES}" -i "${FULL_AUDIOBOOK_PATH}" -vn -c:a copy -v debug output.${TEMP_FILE_EXTENSION}
# Add the cover to the new file
AtomicParsley output.${TEMP_FILE_EXTENSION} --artwork artwork.png --overWrite
# Put it where you want it and clean up
cp output.${TEMP_FILE_EXTENSION} "${OUTPUT_PATH}"
rm artwork.png
rm output.${TEMP_FILE_EXTENSION}
cd "${ORIGINAL_PWD}"
}
</path></activation></path>It goes off without a hitch. The new file is there waiting for me, with all the metadata including the cover when I do a "Get Info" or "Quick look" on it (I’m on MacOS). But when opening it and trying to play it in iTunes, the "time" field is way off and it immediately skips to the next song/audiobook in the queue.
Attempts to convert it within iTunes fail immediately - too quickly to see what’s happening. The errors in the console simply say "Assert failure :" (with nothing after the colon).
edit : Tommy answered the question. Here’s a working bash function :
dedrm_audible () {
# Check for AtomicParsley, ffmpeg, and 3 args
if (! type AtomicParsley >/dev/null 2>/dev/null) || (! type ffmpeg >/dev/null 2>/dev/null) || [ ! $# -eq 3 ]; then
echo "Usage:"
echo " dedrm_audible <path to="to"> <activation bytes="bytes"> <path to="to" output="output" file="file">"
echo " Note: AtomicParsley and ffmpeg must be in PATH variable"
return
fi
local ORIGINAL_PWD="$(pwd)"
local TEMP_DIR="/tmp/audible"
local AUDIOBOOK_FILE="$1"
local ACTIVATION_BYTES="$2"
local OUTPUT_FILE="$3"
# Alternative to realpath (since I read somewhere that it's not there by default on some systems): OUTPUT_PATH="$( cd "$( dirname "$OUTPUT_FILE" )" && pwd )"
local FULL_AUDIOBOOK_PATH="$(realpath "${AUDIOBOOK_FILE}")"
local AUDIOBOOK_NAME="${$(basename "${FULL_AUDIOBOOK_PATH}")%.aax}.m4a"
local OUTPUT_PATH="$(realpath "${OUTPUT_FILE}")"
local TEMP_FILE_EXTENSION="m4a"
mkdir -p "${TEMP_DIR}"
cd "${TEMP_DIR}"
cp "${FULL_AUDIOBOOK_PATH}" "${AUDIOBOOK_NAME}"
# Extract the book cover
ffmpeg -activation_bytes "${ACTIVATION_BYTES}" -i "${AUDIOBOOK_NAME}" -vcodec copy artwork.png
# Convert the audio
ffmpeg -activation_bytes "${ACTIVATION_BYTES}" -i "${AUDIOBOOK_NAME}" -vn -c:a copy -v debug output.${TEMP_FILE_EXTENSION}
# Add the cover to the new file
AtomicParsley output.${TEMP_FILE_EXTENSION} --artwork artwork.png --overWrite
# Put it where you want it and clean up
mv output.${TEMP_FILE_EXTENSION} "${OUTPUT_PATH}"
rm artwork.png
rm "${AUDIOBOOK_NAME}"
cd "${ORIGINAL_PWD}"
}
</path></activation></path> -
OpusError while using ffmpeg library in discord.py
18 avril 2021, par The Assignment NerdWhile playing a local file or youtube audio, I get
OpusError: invalid argument
error

The play command looks like :


# bot.py
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
from models import *
from discord.voice_client import VoiceClient
import logging
from config import *
import youtube_dl
from youtube_dl import YoutubeDL

@bot.command()
async def play(ctx):
 user=ctx.author
 voice_channel=user.voice.channel
 channel=None
 # only play music if user is in a voice channel
 if voice_channel:
 # grab user's voice channel
 channel=voice_channel.name
 await ctx.send('User is in channel: '+ channel)
 # create StreamPlayer
 vc = await voice_channel.connect()
 url="https://www.youtube.com/watch?v=AOeY-nDp7hI"
 YDL_OPTIONS = {'format': 'bestaudio', 'noplaylist':'True'}
 FFMPEG_OPTIONS = {'before_options': '-reconnect 1 -reconnect_streamed 1 -reconnect_delay_max 5', 'options': '-vn'}
 voice = discord.utils.get(bot.voice_clients, guild=ctx.guild)
 print(0)
 if not voice.is_playing():
 print("1")
 with YoutubeDL(YDL_OPTIONS) as ydl:
 info = ydl.extract_info(url, download=False)
 print(2)
 URL = info['formats'][0]['url']
 print(3)
 voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
 print(4)
 voice.is_playing()
 print("Strated playing")
 else:
 await ctx.send("Already playing song")
 return
 else:
 await ctx.send('User is not in a channel.')



My error :


0
1
[youtube] AOeY-nDp7hI: Downloading webpage
[youtube] Downloading just video AOeY-nDp7hI because of --no-playlist
2
3
Ignoring exception in command play:
Traceback (most recent call last):
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 85, in wrapped
 ret = await coro(*args, **kwargs)
 File "/Users/mohit/programming/discord/area-51-helper/main.py", line 115, in play
 voice.play(discord.FFmpegPCMAudio(URL, **FFMPEG_OPTIONS))
 File "/opt/homebrew/lib/python3.9/site-packages/discord/voice_client.py", line 564, in play
 self.encoder = opus.Encoder()
 File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 291, in __init__
 self.set_fec(True)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 326, in set_fec
 _lib.opus_encoder_ctl(self._state, CTL_SET_FEC, 1 if enabled else 0)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/opus.py", line 92, in _err_lt
 raise OpusError(result)
discord.opus.OpusError: invalid argument

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/bot.py", line 939, in invoke
 await ctx.command.invoke(ctx)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 863, in invoke
 await injected(*ctx.args, **ctx.kwargs)
 File "/opt/homebrew/lib/python3.9/site-packages/discord/ext/commands/core.py", line 94, in wrapped
 raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: OpusError: invalid argument



I'm using these version


discord.py==1.0.1
ffmpeg==4.3.2
youtube_dl==2021.4.17



-
Non-monotonous DTS in output stream when concat videos using ffmpeg
8 février 2018, par no nameI have three videos which I want to concat together the problem it works fine for some videos but when I test a specific video it gives me an error and cause the resulting video to show in a strange way and everything is moving very fast in the video like I was forward up the video
this the code I used to add the video together from a file this the out.txtfile 'D:/Build/start.mp4'
file 'D:/Build/a.mp4'
file 'D:/Build/Song & Lyrics/2f.mp4'the command i used with ffmpeg
ffmpeg -f concat -safe 0 -i out.txt -c copy -y go.mp4
i faced this error
[mov,mp4,m4a,3gp,3g2,mj2 @ 05c0dbc0] Auto-inserting h264_mp4toannexb bitstream filter
Input #0, concat, from 'out.txt':
Duration: N/A, start: 0.000000, bitrate: 280 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 155 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Metadata:
creation_time : 2018-02-08T13:25:49.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 02/08/2018.
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s
Metadata:
creation_time : 2018-02-08T13:25:49.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 02/08/2018.
Output #0, mp4, to 'go.mp4':
Metadata:
encoder : Lavf58.7.100
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], q=2-31, 155 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 90k tbc
Metadata:
creation_time : 2018-02-08T13:25:49.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 02/08/2018.
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s
Metadata:
creation_time : 2018-02-08T13:25:49.000000Z
handler_name : ISO Media file produced by Google Inc. Created on: 02/08/2018.
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
[mov,mp4,m4a,3gp,3g2,mj2 @ 05c38840] Auto-inserting h264_mp4toannexb bitstream filter
[mp4 @ 061b8f00] Non-monotonous DTS in output stream 0:0; previous: 624624, current: 88735; changing to 624625. This may result in incorrect timestamps in the output file.
[mp4 @ 061b8f00] Non-monotonous DTS in output stream 0:0; previous: 624625, current: 89247; changing to 624626. This may result in incorrect timestamps in the output file.
[mp4 @ 061b8f00] Non-monotonous DTS in output stream 0:0; previous: 624626, current: 89759; changing to 624627. This may result in incorrect timestamps in the output file.
.....
[mov,mp4,m4a,3gp,3g2,mj2 @ 05c38840] Auto-inserting h264_mp4toannexb bitstream filtereed=69.7x
frame= 8991 fps=2903 q=-1.0 Lsize= 8378kB time=00:05:58.22 bitrate= 191.6kbits/s speed= 116x
video:2469kB audio:5625kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 3.500685%so what the problem make this error. the problem appear when i use this new start.mp4 to be merge with my videos i tried on other ones and it worked fine.
Update
i tested to convert the videos to MTS formate then concate them as an answer to similar problem but the problem is when i convert the mp4 videos to this formate the size of the file be too large from 6 MB to 42 MB !! so if there is a better answer. or a way to make the file still same size or less
the linke of the answer is here but it worked fine
Thanks in advance