====== Coding Tips ======
===== C =====
==== How to hide a temporary file ====
This works because the filename and data are stored separately. The filename can be unlinked, and the data will only be released once the file stream is closed.
FILE *fd = fopen("hidden.file","w");
unlink("hidden.file");
fprintf(fd,"This is hidden information\n");
...
fclose(fd);
===== ffmpeg =====
==== Create video from image ====
% ffmpeg -loop_input -i image.jpg -r 29.97 -t 10 -qscale 2 video.mpg
Where ''-t'' is the duration in seconds
==== Combine audio and video ====
% ffmpeg -i sound.mp3 -i video.avi final.avi
==== Cut scene from dvr-ms file ====
% ffmpeg -y -ss 1250 -t 81 -i input.dvr-ms -vcodec copy -acodec copy -f dvd out.mpg
% ffmpeg -sameq -i out.mpg final.mp4
Where ''-ss'' is start time in seconds, ''-t'' is duration in seconds
==== Convert ''mkv'' to ''mpg'' file ====
% ffmpeg -i input_video.mkv -target ntsc-dvd -acodec mp2 -ab 192 -ac 2 -ar 48000 -b 4096 -r 29.97 -s 720x480 -vcodec mpeg2video -y output_video.mpg