![]() ![]() ![]() Lazily enough, I created a temporary directory on Desktop where I was storing the intermediate files as well as a single resulting video file. Video-15-sec Canal-1 Videos-1 (concatenate.mp4 files from) + 1 song -> Folder Export-all-Videosname of the song.mp4 Videos-2 (concatenate. The video created will be exported in a separate folder Export-all-Videos. First, it read two command line arguments, with the first ( $1) containing the path to the video file and with the second ( $2) storing the path to the file with the timestamps. All the songs and Videos folders in loop, until all my songs are done. Once such file was ready, I applied the following script:Įcho "Video cutting and assembling: $video_file "Įcho "Timestamps file: $timestamps_file "ĭo # Make array from the line (space-separated timestamps)Ĭlip_end = $ -gt 1 ] thenįfmpeg -y -f concat -safe 0 -i "$filelist " -c copy "$tmp_dir /merged.mp4" fi My approach to recording timestamps was to create a line for each “good” small portion of the video I wanted to produce, delimited with a starting and ending timestamp im the format of HH:MM::SS: 01:26:10 01:44:04 And when I concat, in the console,ffmpeg show below info: mp4 000001fe0193b700 Application provided duration: 2585263321 / timestamp: 6303355764 is out of range for mov/mp4 format mp4 000001fe0193b700 pts has no value mp4 000001fe0193b700 Application provided duration: 2585443321 / timestamp: 6303535765 is out of range for mov/mp4. Once I was done with a portion of the original file that would further constitute a smaller clip with removed “bad” parts, I ran a bash script utilizimg ffmpeg to cut the big video in a set of smaller ones and then assemble them back in one single file. My overall workflow was quite simple: I was rewatching the videos in VLC and recorded timestamps I wanted to cut away in a text file. ffmpeg -i INPUT.mp4 -i FFMETADATAFILE.txt -mapmetadata 1 -codec copy OUTPUT. In this blog post I am going to summarize my experience with this task. ffmpeg doesnt mutate the existing video, but instead creates a new video with the new metadata, existing video and existing audio. Surely, I wanted to do this programmatically using ffmpeg. Most parts of the videos contained the content I wanted to preserve, but I wanted to cut away some small portions and, additionally, split the big video files into a series of smaller ones. This summer I had a task of processing a large collection of videos that I recorded myself while teaching a course at NTNU. Concatenating Videos With a Single Audio Stream Supply input files with the -i flags Use -filtercomplex to select streams from the input.1.
0 Comments
Leave a Reply. |