![]() ![]() That ffmpeg command is for AVI, which is straightforward. Otherwise, you could get the video file information with MediaInfo: In which case it would be helpful to know how/with what the MPEG2 files were encoded, and ideally the encoding settings and file extension - MPEG, TS, M2T etc. A bit too late tonight though.the wee hours here. If that doesn't work for you, I could ask around on some of the forums I frequent. Here are the sections of the guide on cutting: If you don't mind scrubbing through the footage to set cut points, your best bet (for freeware) is probably AVIDemux: The thing about MPEG-2 is that the cut has to be made on I-frames, and even then there can be issues - a lot depends on the GOP structure (Open vs Closed). Still, the cuts loop fine (and that includes audio) when played in a loop, so I guess this is indeed frame-accurate.I was hoping you'd say DV or another AVI format. however, even with this, the final video bitrate for me ends up 337 kb/s. The video encoding settings for cut.mp4 seem to be identical to inputvid.mp4 except video bitrate changed from 389 kb/s to 526 kb/s, and also the audio encoding settings are nearly the same, except the sampling rate changed from 44100 to 48000 Hz though that can be regulated with: melt inputvid.mp4 in=7235 out=7349 -consumer avformat:cut.mp4 acodec=aac ar=44100 ab=95k vcodec=libx264 vb=389k ![]() and here is what ffmpeg sees for this file: ffmpeg -i cut.mp4 -f mp4 /dev/null 2>&1 | grep 'Stream\|encoder' encoder : Lavf54.20.4 ![]() Then to check if cut.mp4 loops correctly, use melt again to play it back twice - and play it to an SDL window: melt cut.mp4 cut.mp4 -consumer sdl and melt will cut with the piece between frames 72 into a new file, cut.mp4. Ok, so we can see ffmpeg chooses libx264 and aac encoders for this video then we can enter this in for melt: melt inputvid.mp4 in=7235 out=7349 -consumer avformat:cut.mp4 acodec=aac vcodec=libx264 Say you have an inputvid.mp4 - first check its encoding settings with say ffmpeg (here, I just say I want to encode it again to -f mp4, but as the file /dev/null so the output is discarded I redirect stderr so I can grep through it - note in the middle, the command prompts, and you should answer y with ENTER, so the process proceeds and dumps the useful info this is with ffmpeg 3.3.3 on Ubuntu 14): ffmpeg -i inputvid.mp4 -f mp4 /dev/null 2>&1 | grep 'Stream\|encoder' The only Linux command-line tool I've found so-far, that can cut at exact frame (or, with frame accuracy), is melt ( sudo apt-get install melt). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |