Show pageOld revisionsBacklinksBack to top You've loaded an old revision of the document! If you save it, you will create a new version with this data. Media Files ====== 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. <verbatim> FILE *fd = fopen("hidden.file","w"); unlink("hidden.file"); fprintf(fd,"This is hidden information\n"); ... fclose(fd); </verbatim> ===== ffmpeg ===== ==== Create video from image ==== <verbatim> % ffmpeg -loop_input -i image.jpg -r 29.97 -t 10 -qscale 2 video.mpg </verbatim> Where ''-t'' is the duration in seconds ==== Combine audio and video ==== <verbatim> % ffmpeg -i sound.mp3 -i video.avi final.avi </verbatim> ==== Cut scene from dvr-ms file ==== <verbatim> % 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 </verbatim> Where ''-ss'' is start time in seconds, ''-t'' is duration in seconds ==== Convert ''mkv'' to ''mpg'' file ==== <verbatim> % 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 </verbatim> SavePreviewCancel Edit summary Note: By editing this page you agree to license your content under the following license: CC Attribution-Share Alike 4.0 International codingtips.1790121901.txt.gz Last modified: 2026/09/23 00:05by 127.0.0.1