old.mkv, and the new one will get the original name with suffix. c -r -k : and keep the intermediate video files (not by default)"Įcho Reading all directories for MKV files, and verify whether they have Mpeg-4p2, a H264 or XVid or DivX or a H263 track in them.Įcho If so, it will be extracted with mkvextract and converted to H265 with ffmpeg.Įcho If remuxed, the original will be named to. c -r : convert and remux into new resulting video"Įcho "\. c : convert the video track in those candidates to H.265 (x265)"Įcho "|. # extend for your purposes -) I've run this script for over a year.Įcho "| no args : scan directory tree for candidates"Įcho "|. # Extract old format video tracks from each MKV file in the given directories and transcode them to e.g. To clarify, what I'm after is the result: one video, one audio and all subtitles. Result: No video, no audio, all subtitles.Īs far as I can tell from the manual, -c:s copy is supposed to copy all the streams, not just the default one, but it won't. Result: All video, all audio, all subtitles.įfmpeg -i IN.mkv -c:v libx264 -threads 4 -speed 1 -f matroska -c:s copy -map 0:s OUT.mkv Result: One video stream, one audio stream, one subtitle stream.įfmpeg -i IN.mkv -c:v libx264 -threads 4 -speed 1 -f matroska -map 0 OUT.mkv Result: One video stream, one audio stream, no subtitle streams.įfmpeg -i IN.mkv -c:v libx264 -threads 4 -speed 1 -f matroska -c:s copy OUT.mkv stream 20: subtitle (dvdsub), -sid 14, -slang spaįfmpeg -i IN.mkv -c:v libx264 -threads 4 -speed 1 -f matroska OUT.mkv stream 19: subtitle (dvdsub), -sid 13, -slang ita stream 18: subtitle (dvdsub), -sid 12, -slang fre stream 17: subtitle (dvdsub), -sid 11, -slang swe stream 16: subtitle (dvdsub), -sid 10, -slang por stream 15: subtitle (dvdsub), -sid 9, -slang nor stream 14: subtitle (dvdsub), -sid 8, -slang ice stream 13: subtitle (dvdsub), -sid 7, -slang fin stream 12: subtitle (dvdsub), -sid 6, -slang dut stream 11: subtitle (dvdsub), -sid 5, -slang dan stream 10: subtitle (dvdsub), -sid 4, -slang ara stream 9: subtitle (dvdsub), -sid 3, -slang spa stream 8: subtitle (dvdsub), -sid 2, -slang ita stream 7: subtitle (dvdsub), -sid 1, -slang fre stream 6: subtitle (dvdsub), -sid 0, -slang eng stream 5: audio (ac3), -aid 4, -alang eng, Stereo stream 4: audio (ac3), -aid 3, -alang spa, Surround 5.1 stream 3: audio (ac3), -aid 2, -alang ita, Surround 5.1 stream 2: audio (ac3), -aid 1, -alang fre, Surround 5.1 stream 1: audio (ac3), -aid 0, -alang eng, Surround 5.1 The current input file I'm working with has these streams, but other files will have different streams. #Ffmpeg map first video and audio multiple how to#Now I can't figure out how to let ffmpeg pick its default video stream and default audio stream and then all subtitles. I want to write a generic command that works without me having to specify exact stream numbers. The above command keep the first video and audio synchronized but the second video is always delayed a little bit.I'm trying to re-encode video streams from a Matroska file to save space, while keeping all the subtitles as-is, using ffmpeg. map -vcodec libx264 -preset ultrafast -pix_fmt yuv420p -strict 2 -r 15 -tune zerolatency -map -c:a aac -b:a 128k fileName rtsp_transport tcp -probesize 32 -analyzeduration 0 -i tcp -probesize 32 -analyzeduration 0 -i "setpts='PTS-STARTPTS',crop=iw/2:ih:ow/2:0 setpts='PTS-STARTPTS',crop=iw/2:ih:ow/2:0 hstack=inputs=2 asetpts='PTS-STARTPTS'" Warning messages from FFMPEG, these appear constantly when I run the above command: Queue input is backward in time.49 bitrate= 5.8kbits/s dup=0 drop=142 speed=0.985x "codec_long_name": "AAC (Advanced Audio Coding)", This could happen because the audio and the video of the stream that comes from the IP camera has different start_pts and start_time. The above command saves both videos synchronized but the audio is either delayed or comes too early. map -c:v libx265 -preset ultrafast -map -c:a aac -b:a 128k fileName What I did: Both IP cameras are configured with the same NTP server Problem: I can either synchronize the videos and then the audio is not synchronized or I can synchronize one of the videos with the audio and then the other video is not synchronized. Goal: I want to capture 2 IP cameras and merge their video streams one of the audio.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |