
Recherche avancée
Autres articles (94)
-
Amélioration de la version de base
13 septembre 2013Jolie sélection multiple
Le plugin Chosen permet d’améliorer l’ergonomie des champs de sélection multiple. Voir les deux images suivantes pour comparer.
Il suffit pour cela d’activer le plugin Chosen (Configuration générale du site > Gestion des plugins), puis de configurer le plugin (Les squelettes > Chosen) en activant l’utilisation de Chosen dans le site public et en spécifiant les éléments de formulaires à améliorer, par exemple select[multiple] pour les listes à sélection multiple (...) -
Contribute to a better visual interface
13 avril 2011MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community. -
Support de tous types de médias
10 avril 2011Contrairement à beaucoup de logiciels et autres plate-formes modernes de partage de documents, MediaSPIP a l’ambition de gérer un maximum de formats de documents différents qu’ils soient de type : images (png, gif, jpg, bmp et autres...) ; audio (MP3, Ogg, Wav et autres...) ; vidéo (Avi, MP4, Ogv, mpg, mov, wmv et autres...) ; contenu textuel, code ou autres (open office, microsoft office (tableur, présentation), web (html, css), LaTeX, Google Earth) (...)
Sur d’autres sites (10294)
-
How to set custom handler_name metadata for subtitle stream using FFMPEG
9 mars 2021, par AWainbI'm currently using FFMPEG to embed subtitles into my MP4 files and I am stumped trying to figure out how to custom set the "handler_name" metadata tag on my subtitle stream so I can control the name that is displayed when selecting the subtitle within a player like MPC-HC (Media Player Classic) ?



My current command to embed the subtitle is :



ffmpeg -i "video.mp4" -sub_charenc UTF-8 -i "video.srt" -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language=eng -metadata:s:s:0 handler_name="English" -id3v2_version 3 -write_id3v1 1 "subbed_video.mp4"




Output :



C:\path\to>ffmpeg -y -i "video.mp4" -sub_charenc UTF-8 -i "video.srt" -c:v copy -c:a copy -c:s mov_text -metadata:s:s:0 language="eng" -metadata:s:s:0 handler_name="English" -id3v2_version 3 -write_id3v1 1 "subbed_video.mp4"
ffmpeg version N-68482-g92a596f Copyright (c) 2000-2014 the FFmpeg developers
 built on Dec 16 2014 02:53:08 with gcc 4.9.2 (GCC)
 configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable
 libavutil 54. 15.100 / 54. 15.100
 libavcodec 56. 15.100 / 56. 15.100
 libavformat 56. 15.105 / 56. 15.105
 libavdevice 56. 3.100 / 56. 3.100
 libavfilter 5. 3.101 / 5. 3.101
 libswscale 3. 1.101 / 3. 1.101
 libswresample 1. 1.100 / 1. 1.100
 libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf55.34.101
 Duration: 01:27:44.17, start: 0.000000, bitrate: 878 kb/s
 Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x536 [SAR 1:1 DAR 160:67], 842 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac (HE-AAC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 32 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
 Metadata:
 handler_name : SubtitleHandler
Input #1, srt, from 'video.srt':
 Duration: N/A, bitrate: N/A
 Stream #1:0: Subtitle: subrip
Output #0, mp4, to 'subbed_video.mp4':
 Metadata:
 major_brand : isom
 minor_version : 512
 compatible_brands: isomiso2avc1mp41
 encoder : Lavf56.15.105
 Stream #0:0(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 1280x536 [SAR 1:1 DAR 160:67], q=2-31, 842 kb/s, 24 fps, 24 tbr, 12288 tbn, 12288 tbc (default)
 Metadata:
 handler_name : VideoHandler
 Stream #0:1(und): Audio: aac ([64][0][0][0] / 0x0040), 48000 Hz, stereo, 32 kb/s (default)
 Metadata:
 handler_name : SoundHandler
 Stream #0:2(eng): Subtitle: mov_text ([8][0][0][0] / 0x0008) (default)
 Metadata:
 handler_name : English
 encoder : Lavc56.15.100 mov_text
Stream mapping:
 Stream #0:0 -> #0:0 (copy)
 Stream #0:1 -> #0:1 (copy)
 Stream #0:2 -> #0:2 (mov_text (native) -> mov_text (native))
Press [q] to stop, [?] for help
frame=126337 fps=13751 q=-1.0 Lsize= 564499kB time=01:27:44.17 bitrate= 878.5kbits/s
video:541239kB audio:20564kB subtitle:39kB other streams:0kB global headers:0kB muxing overhead: 0.472881%




The command completes sucessfully, but when I run :



ffmpeg -i "C:\path\to\subbed_video.mp4"




it shows :



Stream #0:2(eng): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default)
Metadata:
 handler_name : SubtitleHandler




Even though the output from the command shows :



Stream #0:2(eng): Subtitle: mov_text ([8][0][0][0] / 0x0008) (default)
Metadata:
 handler_name : English
 encoder : Lavc56.15.100 mov_text




No matter what options I have tried or what order I place the -metadata tags in, this tag simply will not set with FFMPEG ? I find it really ugly to see SubtitleHandler [eng] (tx3g) (English) within my player's menu instead of simply saying English.



Now, I can work around this issue by using MP4BOX to embed the subtitles into my mp4's using :



MP4BOX -lang eng -add "video.srt:name=English" "video.mp4" -out "subbed_video.mp4"




Adding "name=English" allows me to set the subtitle stream's "handler_name" to "English" ; which displays perfectly in FFMPEG and MPC-HC, but the problem is that I do not want my app to be dependent on an additional external tool like MP4BOX if it can be avoided ?



I would greatly appreciate any advice regarding how to properly set the "handler_name" tag on my subtitle stream using FFMPEG, or maybe a confirmation as to whether FFMPEG can even handle this tag seeing as it is not technically listed in FFMPEG's valid metadata tag list ?



P.S. As an alternative to FFMPEG, I would be willing to use AtomicParsley to set the "handler_name" as I will already be using it to set advanced metadata on the "subbed_video.mp4" after I embed the subtitles. It does seem like it would be possible to do with AtomicParsley, but I have not been able to understand half the help information with regards to setting custom ATOM's.



TIA !!


-
how to explicitly specify matroska format file to be VFR
19 janvier 2012, par UlteriorI am moving my code performing AVI recording with ffmpeg library to matroska format due to native support of VFR stated by format. Changing guess_format to
matroska
not touching any other settings produced an mkv file which seems to be ok. But the MediaInfo reports it to be CFS (30).How do I explicitly state that its VFR ?
Format : Matroska
File size : 5.27 MiB
Duration : 8s 0ms
Overall bit rate : 5 528 Kbps
Writing application : Lavf52.78.1
Writing library : Lavf52.78.1
Video
ID : 1
Format : MPEG-4 Visual
Format profile : Simple@L1
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : V_MPEG4/ISO/ASP
Codec ID/Info : Advanced Simple Profile
Duration : 8s 0ms
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 30.000 fps
Color space : YUV
Bit depth : 8 bits
Scan type : Progressive
Writing library : Intel(R) MPEG-4 encoder based on Intel(R) IPP 6.1 build 137.36[6.1.137.779]
Language : English
Audio
ID : 2
Format : MPEG Audio
Codec ID : A_MPEG/L3
Codec ID/Hint : MP3
Duration : 8s 0ms
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Language : English -
ffmpeg : map audio and subtitle stream of (different) specific language only
24 juillet 2019, par RocketNutsI have a bunch of video files with multiple audio and subtitle streams (in different languages). The streams contain metadata specifying which stream is which langauge. I want to copy all files but maintaining only the spanish audio streams, and the english subtitle streams (and the video stream of course).
Unfortunately, not all videos contain the same language streams at the same index, so instead of using something like
-map 0:a:2
I am trying to select the streams based on metadata.However, if I try the following : (based on answers found in similar questions like this and this)
ffmpeg -i input.mkv -map 0:v -map 0:a:m:language:spa -map 0:s:m:language:eng -c copy output.mkv
It still copies the first audio and first subtitle stream, no matter which stream is which language. In other words, this behaves just like
-map 0:v -map 0:a:0 -map 0:s:0
which isn’t what I need.Is there a different
map
argument I can use to make sure it picks only the spanish audio stream and only the english subtitle stream, regardless of their index in the input file ?