
	Expected: a title clip you have 
	— or created —, of SAME IMAGE SIZE 
	(in pixels) AND SAME FRAME RATE, as 
	the one(s) it will be appended to 
	(see below).



———————————————————————————————————————————
Easily * add a title clip: recoded, 
+ join  several clips: without recoding, 
to get a complete video 

       Tested OK under Windows XP & 7.
       [ + "SPS-id method": see at bottom ]

———————————————————————————————————————————


	* One, or the "last" difficulty, though: 
	  this first command line settings: 

x264\x264 --crf 18 --profile main --level 4 --ref 1 --keyint 30 --bframes 0 --sar 1:1 -o intro.264 1__TITLE-to-append_w-sound.avi

	NEED to be MODIFIED, to match the 
	technical specifications of YOUR 
	clips (use "MediaInfo", freeware, 
	to take note of those required 
	settings). 



The batch assumes you have — or 
have prepared — a TITLE CLIP, 

   AND RENAMED IT:

"1__TITLE-vid_to-append__w-sound.avi"

   to be added to some "original" MP4 
   contained AVC H.264 clip, 

   AND RENAMED IT:
 
"2__ORIG-vid.mp4" 

	or several original clips: 
	in that case, modify the 
	batch (see below). 


Note · Although care has been taken to avoid 
audio desynchronisation (title clip "qaac" 
recoded...), it still occurs with Full HD 
videos: in OLD PCs, somewhat if not a lot 
more, than with fully recoded (or encoded all 
at once) videos... 


The title clip should be in .avi container, 
with an uncompressed Wav audio track: that's 
expected — and the most probable, if you want 
to preserve visual + audio quality, 

	since you may (in general) overlay 
	text on some video; or even onto a 
	still image (or plain color, or black 
	background...), that you'll save as 
	an .avi video: 

if you need to apply "tough" compression 
— i.e video bitrate between ~200 & 700 kbs —  
especially to a larger image than 640 × 480 
pixels, try to avoid very saturated / bright 
colors, as they usually, and visibly suffer 
from such bitrates... 

Keep in mind the fact that the title clip 
will be recoded. 



    To append more original clips 
    (no recode), use any plain texte editor 
    ("Notepad" etc.) to modify the batch. 
    Example: 


	replace: 


..\_tools\ffmpeg -i intro-w-sound.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
..\_tools\ffmpeg -i 2__ORIG-vid.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts

..\_tools\ffmpeg -i "concat:intermediate1.ts|intermediate2.ts" -c copy -bsf:a aac_adtstoasc RESULT-test__with-sound.mp4


	with (this example appends one more original 
	clip: here "003.mp4"); modify its line to  
	intermediate3.ts   and add   |intermediate3.ts  
	 to last line (& so on): 


..\_tools\ffmpeg -i intro-w-sound.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
..\_tools\ffmpeg -i 2__ORIG-vid.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts

..\_tools\ffmpeg -i 003.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts

..\_tools\ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts" -c copy -bsf:a aac_adtstoasc RESULT-test__with-sound.mp4



	To rename a BUNCH of clips — to simple 
	& short names (recommended), you can use 
	"Renamer" (freeware). 


To prepare a title clip, many 
freeware (+ commercial) tools 
are available... 

If you don't have the rather expensive 
"Sony Vegas" (even an old version 4 
or 5 does very well), the freeware 
"AviUtil: ExtraPack version!" is as 
advanced, to apply still or animated 
text to some background (still or ani-
mated also); 

or even, as basic as the old "Windows 
Movie Maker" (with its scrolling credits 
option)... 


____________________________________________________________
____________________________________________________________



[  To append more original clips, a method using 
   an external list is easier, but I couln't get 
   it to work right: result frame rate is wrong... 


	Replace the 3 lines lines with: 

..\_tools\ffmpeg -f concat -i 3__Join-FFMPEG_list_(optional).txt -c copy RESULT__w-sound.mp4

	and, in that case, also modify 
	"3__Join-FFMPEG_list_(optional).txt"

	( in "(concat_cmd-version+ext-txt-list__fps-problems)" 
	subfolder and move the two files to parent folder) 


	from: 

file 'intro-w-sound.mp4'
file '2__ORIG-vid.mp4'


	to: 

file 'intro-w-sound.mp4'
file '2__ORIG-vid.mp4'
file '003.mp4'
file '004.mp4'
file '005.mp4'
(etc.) 


BUT first, I need information on 
how to modify this command line:
 
..\_tools\ffmpeg -f concat -i 3__Join-FFMPEG_list_(optional).txt -c copy RESULT__w-sound.mp4

in order to maintain the right 
frame rate...  ]


____________________________________________________________
____________________________________________________________


Additional batches "3__(sps-id_method).bat" 
and "4__(sps-id_method_slilent-result).bat"



   "3__(sps-id_method).bat" outputs a test / 
   sample video with sound. 


I hope the "SPS-id" instruction (see below) is still 
included, (even) in that case, as the batch is exactly 
the same as the main one : 
"__TEST__incl-Wav-to-AAC+mux__CLICK-HERE.bat", 

except for the "x264" encoding cmdline, that contains 
--sps-id 2 



   "4__(sps-id_method_silent-result).bat" 
   outputs a silent test / sample. 


The "x264" encoding cmdline is the same again, 
with  --sps-id 2  added, but the rest is different: 

it uses "MP4Box" (not "FFMpeg), and "binary join", 
to append the title clip to the original video. 
With that batch, you would have to manually extract 
the audio tracks of both videos, join them, and "mux" 
the result with the joined video. 



Note · In the "480-example" subfolder, 
the "2__ORIG-vid.mp4" sample is special... 

It comes from little still camera, with a 
640 × 480 pixels video option. The videos 
it produces don't respect some standard, 
the consequence being: append to its videos 
any clip from other origin (than the camera: 
"Sanyo Xacti CG9"), is either very difficult, 
or even impossible... 

At "Videohelp.com", an advanced user suggested 
the "SPS-id" method, that works in 100% of the 
cases — and warned: it's a last resort (only 
use it if NOTHING else works)!

My friends, who own that camera, had been 
waiting for a LONG time, to find some no-
recode (!) solution... The "SPS-id" method 
worked at once. 

To help another user — unable at the time 
to join a title to a bunch of clips (sample 
in "1080-example" subfolder)—, that same 
specialist proposed another method, after 
indicating that the "SPS-id" one was not 
required in that specific case. 

I then (at once) tried, at random... 
to apply that 2nd method to "my" case. 
It worked as well... 
—————————————————

	Nevertheless, I keep in this 
whole folder those two additional batches, 
that apply the "SPS-id" method — in case 
the main one wouldn't work with your 
(specific) video(s) — and if you REALLY 
can't find some other solution... 

 



