Hello! I am trying to concatenate two files. A shorter segment of a video (anime opening, around 1:30) and the longer segment (the chapter "proper"), so the order is important (that the opening go first). These are the files:
withCode:General Unique ID : 131527284938348273810489966922907112581 (0x62F33BD0EC7389356A6A4B99FE99D485) Complete name : E:\Base\Videos\Animés\Vien\prueba2\1.mkv Format : Matroska Format version : Version 4 File size : 38,1 MiB Duration : 1 min 29 s Overall bit rate : 3 556 kb/s Frame rate : 23,976 FPS Encoded date : 2017-09-14 06:30:47 UTC Writing application : mkvmerge v15.0.0 ('Duel with the Devil') 64-bit Writing library : libebml v1.3.5 + libmatroska v1.4.5 Attachments : Perpetua Italic.ttf Vídeo ID : 1 Format : AVC Format/Info : Advanced Video Codec Format profile : High 10@L4 Format settings : CABAC / 16 Ref Frames Format settings, CABAC : Sí Format settings, Reference frames : 16 fotogramas Codec ID : V_MPEG4/ISO/AVC Duration : 1 min 29 s Bit rate : 3 355 kb/s Width : 718 píxeles Height : 480 píxeles Display aspect ratio : 4:3 Original display aspect ratio : 4:3 Frame rate mode : Constante Frame rate : 23,976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 10 bits Scan type : Progresivo Bits/(Pixel*Frame) : 0.406 Stream size : 35,9 MiB (94%) Writing library : x264 core 119 r2106+636 fcb18f7 Encoding settings : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / fade_compensate=0.00 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / fgo=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=400 / keyint_min=5 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=15.0 / qcomp=0.70 / qpmin=0 / qpmax=35 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:0.80 Default : Sí Forced : No Color range : Limited Matrix coefficients : BT.470 System B/G Audio ID : 2 Format : AC-3 Format/Info : Audio Coding 3 Commercial name : Dolby Digital Format settings : Dolby Surround Codec ID : A_AC3 Duration : 1 min 29 s Bit rate mode : Constante Bit rate : 192 kb/s Channel(s) : 2 canales Channel layout : L R Sampling rate : 48,0 kHz Frame rate : 31,250 FPS (1536 SPF) Compression mode : Con pérdida Delay relative to video : 14 ms Stream size : 2,05 MiB (5%) Title : Japonés Language : Japonés Service kind : Complete Main Default : Sí Forced : No Dialog Normalization : -27 dB compr : -0.56 dB dynrng : 3.70 dB dsurmod : Dolby Surround encoded dialnorm_Average : -27 dB dialnorm_Minimum : -27 dB dialnorm_Maximum : -27 dB Texto ID : 3 Format : ASS Codec ID : S_TEXT/ASS Codec ID/Info : Advanced Sub Station Alpha Duration : 1 min 8 s Bit rate : 216 b/s Frame rate : 0,278 FPS Count of elements : 19 Compression mode : Sin pérdida Stream size : 1,80 KiB (0%) Title : Inglés Language : Inglés Default : Sí Forced : No
Seeing this thread (https://forum.videohelp.com/threads/393275-Codec-Private-Data-Does-Not-Match-%28Mergin...-MKVToolnix%29) plus the concatenate wiki (https://trac.ffmpeg.org/wiki/Concatenate), I ended up using this code in the post:Code:General ID única : 17670253547596844261564826429857562652 (0xD4B2AC3583C77CECE71E844A3DD801C) Nombre completo : E:\Base\Videos\Animés\Vien\prueba2\2.mkv Formato : Matroska Formato de la versión : Version 4 Tamaño de archivo : 483 MiB Duración : 22 min 17 s Tasa de bits general : 3 028 kb/s Velocidad de fotogramas : 24,000 FPS Fecha de codificación : 2017-09-14 06:15:46 UTC Aplicación de codifición : mkvmerge v15.0.0 ('Duel with the Devil') 64-bit Librería de codificación : libebml v1.3.5 + libmatroska v1.4.5 Attachments : GillSansStd.otf / GillSansStd-Italic.otf / Paint HandRegular.ttf / Perpetua Italic.ttf / Un Dotum.ttf Vídeo ID : 1 Formato : AVC Formato/Info : Advanced Video Codec Formato del perfil : High 10@L4 Ajustes del formato : CABAC / 16 Ref Frames Ajustes del formato, CABAC : Sí Ajustes del formato, RefFrames : 16 fotogramas ID códec : V_MPEG4/ISO/AVC Duración : 22 min 17 s Tasa de bits : 2 810 kb/s Ancho : 718 píxeles Alto : 480 píxeles Relación de aspecto : 4:3 Relación de aspecto original : 4:3 Modo velocidad fotogramas : Constante Velocidad de fotogramas : 24,000 FPS Espacio de color : YUV Submuestreo croma : 4:2:0 Profundidad bits : 10 bits Tipo barrido : Progresivo Bits/(píxel*fotograma) : 0.340 Tamaño de pista : 448 MiB (93%) Librería de codificación : x264 core 119 r2106+636 fcb18f7 Opciones de codificación : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / fade_compensate=0.00 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / fgo=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=400 / keyint_min=5 / scenecut=40 / intra_refresh=0 / rc=crf / mbtree=0 / crf=15.0 / qcomp=0.70 / qpmin=0 / qpmax=35 / qpstep=4 / ip_ratio=1.40 / pb_ratio=1.30 / aq=1:0.80 Default : Sí Forced : No Rango de color : Limited Coeficientes matriz : BT.470 System B/G Audio ID : 2 Formato : AC-3 Formato/Info : Audio Coding 3 Nombre comercial : Dolby Digital Ajustes del formato : Dolby Surround ID códec : A_AC3 Duración : 22 min 17 s Tipo de tasa de bits : Constante Tasa de bits : 192 kb/s Canal(es) : 2 canales Channel layout : L R Velocidad de muestreo : 48,0 kHz Velocidad de fotogramas : 31,250 FPS (1536 SPF) Modo de compresión : Con pérdida Retraso relativo al vídeo : 4 ms Tamaño de pista : 30,6 MiB (6%) Título : Japonés Idioma : Japonés Service kind : Complete Main Default : Sí Forced : No Dialog Normalization : -27 dB compr : 5.46 dB dynrng : 5.60 dB dsurmod : Dolby Surround encoded dialnorm_Average : -27 dB dialnorm_Minimum : -27 dB dialnorm_Maximum : -27 dB Texto #1 ID : 3 Formato : ASS ID códec : S_TEXT/ASS ID códec/Info : Advanced Sub Station Alpha Duración : 22 min 14 s Tasa de bits : 142 b/s Velocidad de fotogramas : 0,216 FPS Count of elements : 288 Modo de compresión : Sin pérdida Tamaño de pista : 23,2 KiB (0%) Título : Español Idioma : Español Default : Sí Forced : No Texto #2 ID : 4 Formato : ASS ID códec : S_TEXT/ASS ID códec/Info : Advanced Sub Station Alpha Duración : 22 min 14 s Tasa de bits : 115 b/s Velocidad de fotogramas : 0,214 FPS Count of elements : 285 Modo de compresión : Sin pérdida Tamaño de pista : 18,8 KiB (0%) Título : Inglés Idioma : Inglés Default : No Forced : No Menú 00:00:00.000 : Opening Credits / Episode 1 00:21:22.990 : Ending Credits 00:22:07.493 : Preview of episode 2
which does its job perfectly, because it does all I need (keeps the attachments; maps the subs, in this case, correctly, since I want the opening sub file to be merged to the first chapter sub file; seems to seamlessly merge the two videos), but it does have one problem: it merges the opening at the end, even if I name it "1" and the other "2", for example. I don't understand which part of the code tells in which order to merge the files.Code:(for %%a in (*.mkv) do @echo file '%%a') > "filelist.txt" ffmpeg -y -f concat -i "filelist.txt" -map 0 -c copy -bsf:v "h264_mp4toannexb,dump_extra=freq=k" "output.mkv"
I have tried using something like:
with the filelist.txt already prepared in order, but it gives an error.Code:ffmpeg -y -f concat -i "filelist.txt" -map 0 -c copy -bsf:v "h264_mp4toannexb,dump_extra=freq=k" "output.mkv"
If I use:
the order is correct, but the "mapping" of tracks is not (since there's no map option, of course), and I lose one subtitle and the attachments, for example.Code:ffmpeg -y -f concat -i "filelist.txt" -c copy -bsf:v "h264_mp4toannexb,dump_extra=freq=k" "output.mkv"
Any help is appreciated, I hope the thread has been clear. Thank you.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 1 of 1
Thread
Similar Threads
-
View files sorted on order Day in Windows?
By ConverterCrazy in forum Off topicReplies: 2Last Post: 11th Aug 2023, 12:00 -
Keys Are In Random Order
By yarrak in forum Video Streaming DownloadingReplies: 6Last Post: 27th Jan 2022, 12:01 -
Field order inversion using ffmpeg
By cjdavis83 in forum Video ConversionReplies: 6Last Post: 28th Dec 2021, 18:00 -
Re-authoring Bluray from concatenated files?
By tommy2010 in forum Blu-ray RippingReplies: 0Last Post: 22nd Aug 2020, 16:57 -
Order of operations in restoration
By Joey Bagodonuts in forum RestorationReplies: 16Last Post: 23rd May 2020, 15:34