
Recherche avancée
Médias (1)
-
MediaSPIP Simple : futur thème graphique par défaut ?
26 septembre 2013, par
Mis à jour : Octobre 2013
Langue : français
Type : Video
Autres articles (70)
-
Websites made with MediaSPIP
2 mai 2011, parThis page lists some websites based on MediaSPIP.
-
Participer à sa traduction
10 avril 2011Vous pouvez nous aider à améliorer les locutions utilisées dans le logiciel ou à traduire celui-ci dans n’importe qu’elle nouvelle langue permettant sa diffusion à de nouvelles communautés linguistiques.
Pour ce faire, on utilise l’interface de traduction de SPIP où l’ensemble des modules de langue de MediaSPIP sont à disposition. ll vous suffit de vous inscrire sur la liste de discussion des traducteurs pour demander plus d’informations.
Actuellement MediaSPIP n’est disponible qu’en français et (...) -
Creating farms of unique websites
13 avril 2011, parMediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)
Sur d’autres sites (13001)
-
FFMPEG stream video to Youtube Live
13 juin 2022, par BlessedHITI have a mov file and I'm using ffmpeg to stream it to youtube live using the following command,


ffmpeg -re -i "episode.mov" -pix_fmt yuvj420p -x264-params keyint=48:min-keyint=48:scenecut=-1 -b:v 4500k -b:a 128k -ar 44100 -acodec aac -vcodec libx264 -preset medium -crf 28 -threads 4 -f flv "rtmp://a.rtmp.youtube.com/live2/YOUTUBE.LIVESTREAM.KEY"



But im getting the following message on youtube,


YouTube is not receiving enough video to maintain smooth streaming. As such, viewers will experience buffering



My ffmpeg output showed my bitrate being between 800 - 1000 mbps, way lower than what i have specified in my ffmpeg command.


I am using a not so powerful virtual machine, and so i thought this might be why i am not getting the desired bitrate.


To overcome my hardware limitations, I then decided to encode the file for streaming using this command :


ffmpeg -i episode.mov -c:v libx264 -preset medium -b:v 4500k -maxrate 4500k -bufsize 6000k -vf "scale=1280:-1,format=yuv420p" -g 50 -c:a aac -b:a 128k -ac 2 -ar 44100 episode.flv



Then I stream copy the file using :


ffmpeg -re -i episode.flv -c copy -f flv "rtmp://a.rtmp.youtube.com/live2/YOUTUBE.LIVESTREAM.KEY"



And that seems to give me a stream that youtube is happy with.


My question is, is there a way I can rewrite my ffmpeg command to livestream with the desired bitrate without needing to first encode my mov to another file or is adding more memory the only way forward here ?


-
Ffmpeg - How can I create HLS multiple language streams, in multiple qualities ?
28 avril 2022, par Daniel EllisPreface


I'm working on converting videos from 4k to multiple qualities with multiple languages but am having issues with the multiple languages overlaying, sometimes losing quality and sometimes being out of sync. (this is less of a problem in the German audio, as this is voice over anyhow)


We as a team are complete noobs in terms of Video / Audio + HLS — I'm a front end developer who has no experience of this so apologies if my question is poorly phrased



Videos


I have the video in a 4k format and have removed the original sound as I have English and German audio files that need to be overlayed. I am then taking these files and throwing them together into a .ts file like this :


$ ffmpeg -i ep03-ns-4k.mp4 -i nkit-ep3-de-output.m4a -i nkit-ep3-en-output.m4a \
> -thread 0 -muxdelay 0 -y \
> -map 0:v -map 1 -map 2 -movflags +faststart -refs 1 \
> -vcodec libx264 -acodec aac -profile:v baseline -level 30 -ar 44100 -ab 64k -f mpegts out.ts 



This outputs a 4k
out.ts
video, with both audio tracks playing.

The hard part


This is where I'm finding it tricky, I now need to convert this single file into multiple quality levels (480, 720, 1080, 1920) and I attempt this with the following command :


ffmpeg -hide_banner -y -i out.ts \
-crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -ar 48000 \
-map 0:v:0 -map 0:v:0 -map 0:v:0 -map 0:v:0 \
-c:v:0 h264 -profile:v:0 main -filter:v:0 "scale=w=848:h=480:force_original_aspect_ratio=decrease" -b:v:0 1400k -maxrate:v:0 1498k -bufsize:v:0 2100k \
-c:v:1 h264 -profile:v:1 main -filter:v:1 "scale=w=1280:h=720:force_original_aspect_ratio=decrease" -b:v:1 2800k -maxrate:v:1 2996k -bufsize:v:1 4200k \
-c:v:2 h264 -profile:v:2 main -filter:v:2 "scale=w=1920:h=1080:force_original_aspect_ratio=decrease" -b:v:2 5600k -maxrate:v:2 5992k -bufsize:v:2 8400k \
-c:v:3 h264 -profile:v:3 main -filter:v:3 "scale=w=3840:h=1920:force_original_aspect_ratio=decrease" -b:v:3 11200k -maxrate:v:3 11984k -bufsize:v:3 16800k \
-var_stream_map "v:0 v:1 v:2 v:3" \
-master_pl_name master.m3u8 \
-f hls -hls_time 4 -hls_playlist_type vod -hls_list_size 0 \
-hls_segment_filename "%v/episode-%03d.ts" "%v/episode.m3u8"



This creates the required qualities, but I'm now at a loss of how this might work with the audio


Audio


For the audio I run this command :


ffmpeg -i out.ts -threads 0 -muxdelay 0 -y -map 0:a:0 -codec copy -f segment -segment_time 4 -segment_list_size 0 -segment_list audio-de/audio-de.m3u8 -segment_format mpegts audio-de/audio-de_%d.aac
ffmpeg -i out.ts -threads 0 -muxdelay 0 -y -map 0:a:1 -codec copy -f segment -segment_time 4 -segment_list_size 0 -segment_list audio-en/audio-en.m3u8 -segment_format mpegts audio-en/audio-en_%d.aac




This creates the required audio segments.


The question


I realise this is quite an ask, but is there anything wrong with our inputs ? Is there a way that this can be done a bit more streamlined ?


Any answers are greatly appreciated.


-
Having problem in video stegano, the hiden message always lost
5 avril 2022, par user7025125friend, i am currently looking for a way to video stegano. I successfully in splitting frames from video file and hide messages inside them. But when i combine these frames into video and trying to extract info from the hiden video, i always failed. I guess here is problem with video compression.


Here is my code.


from stegano import lsb
from os.path import isfile, join

import time # install time ,opencv,numpy modules
import cv2
import numpy as np
import math
import os
import shutil
from moviepy.editor import *
from subprocess import call, STDOUT


def split_string(s_str, count=10):
 per_c = math.ceil(len(s_str)/count)
 c_cout = 0
 out_str = ''
 split_list = []
 for s in s_str:
 out_str += s
 c_cout += 1
 if c_cout == per_c:
 split_list.append(out_str)
 out_str = ''
 c_cout = 0
 if c_cout != 0:
 split_list.append(out_str)
 return split_list


def frame_extraction(video):
 if not os.path.exists("./tmp"):
 os.makedirs("tmp") 
 temp_folder = "./tmp"
 print("[INFO] tmp directory is created")

 vidcap = cv2.VideoCapture(video)
 count = 0

 while True:
 success, image = vidcap.read()
 if not success:
 break
 cv2.imwrite(os.path.join(temp_folder, "{:d}.png".format(count)), image)
 count += 1
 print("[INFO] frame {} is extracted".format(count))


def encode_string(input_string, root="./tmp/"):
 split_string_list = split_string(input_string)
 for i in range(0, len(split_string_list)):
 f_name = "{}{}.png".format(root, i)
 secret_enc = lsb.hide(f_name, split_string_list[i])
 secret_enc.save(f_name)
 print("[INFO] frame {} holds {}".format(f_name, lsb.reveal(f_name)))


def decode_string(video):
 frame_extraction(video)
 secret = []
 root = "./tmp/"
 for i in range(len(os.listdir(root))):
 f_name = "{}{}.png".format(root, i)
 print("[INFO] frame {} is decoding".format(f_name))
 secret_dec = lsb.reveal(f_name)
 if secret_dec == None:
 break
 secret.append(secret_dec)
 print("[INFO] secret is {}".format("".join(secret)))
 print(''.join([i for i in secret]))
 # clean_tmp()


def clean_tmp(path="./tmp"):
 if os.path.exists(path):
 shutil.rmtree(path)
 print("[INFO] tmp files are cleaned up")


def main():
 input_string = input("Enter the input string: ")
 f_name = input("enter the name of video: ")

 # 从源文件分离出帧
 frame_extraction(f_name)
 
 # 分离文件路径和扩展名
 file_path, file_extraction = os.path.splitext(f_name)
 
 # 创建输出音频文件
 audio_path = file_path + "_temp.mp3"
 video = VideoFileClip(f_name)
 video.audio.write_audiofile(audio_path)

 # 加密字符
 encode_string(input_string)

 # 从tmp文件夹的图片创建没有声音的视频
 fps=30
 img_root = r"./tmp/"
 # fourcc = cv2.VideoWriter_fourcc(*'mp4v')
 fourcc = cv2.VideoWriter_fourcc(*'XVID')
 video_file_path = file_path + "_temp.avi"
 # 获取tmp文件夹第一张视频的尺寸
 img = cv2.imread(img_root + "0.png")
 height, width, layers = img.shape
 size=(width,height)
 videoWriter = cv2.VideoWriter(video_file_path,fourcc=fourcc,fps=fps,frameSize=size)
 for i in range(len(os.listdir(img_root))):
 frame = cv2.imread(img_root+str(i)+'.png')
 videoWriter.write(frame)
 videoWriter.release()

 # 合并视频和音频 audio_path video_file_path
 video = VideoFileClip(video_file_path)
 audio_clip = AudioFileClip(audio_path)
 video = video.set_audio(audio_clip)
 video.write_videofile(file_path + "_hide.avi")
 clean_tmp()


if __name__ == "__main__":
 while True:
 print("1.Hide a message in video 2.Reveal the secret from video")
 print("any other value to exit")
 choice = input()
 if choice == '1':
 main()
 elif choice == '2':
 decode_string(input("enter the name of video with extension: "))
 else:
 break




I have tried mp4, avi, wov format. But none of them worked.


IF YOU HAVE ANY IDEA OR SUGGESTION GIVEN TO ME, I WOULD BE VERY GRATEFUL