<div dir="ltr">Sorry, wrong list. I will submit my question to ffmpeg-user instead.<div><br></div><div style>/Carl</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/8 Carl Lindqvist <span dir="ltr"><<a href="mailto:lulebo@gmail.com" target="_blank">lulebo@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello<div><br></div><div>I have been experimenting with encoding a single file and removing parts of the stream. I need this function when encoding material with breaks for commercials to remove bars and other funky stuff and sync with the subtitles.</div>

<div><br></div><div>I have done some tests with piping (windows), and I can get this to work pretty well for two arbitrary segments as an example:</div><div><br></div><div><div>(ffmpeg -i inputfile.mp4 -ss 00:10:00 -t 60 -bsf h264_mp4toannexb -vcodec copy -acodec copy -f mpegts -</div>

<div>ffmpeg -i inputfile.mp4 -ss 00:20:00 -t 60 -bsf h264_mp4toannexb -vcodec copy -acodec copy -f mpegts - )| ffmpeg -y -f mpegts -i - -c:v libx264 -preset veryfast -x264opts keyint=75:min-keyint=75:no-scenecut -b:v 704k -minrate 704k -maxrate 704k -bufsize 1500k -profile:v baseline -aspect 16:9 -c:a libvo_aacenc -b:a 96k -ac 2 test.mp4</div>

<div><br></div><div>(this will create a two minute file from two different sections of the input file)</div><div><br></div><div>The problem is the codec copying in the first parts. Since the timecodes might begin in the middle of a GOP, the final ffmpeg will not know what to do until the first I-frame shows up, so it just shows a freeze frame until that happens.</div>

<div><br></div><div>There is a requirement of a fixed gop size of 3 secs for the final output file, so I need to do the encoding again for the final step, no cat can be used on segments.</div><div><br></div>
<div>Is there a good intermediate codec to decode to in the first step? (Preferrably uncompressed to gain performance) I have found yuv4mpegvideo but that only does video. I need the audio as well. Anyone got any smart ideas?</div>
<span class="HOEnZb"><font color="#888888">
<div><br></div><div>/Carl<br></div></font></span></div></div>
</blockquote></div><br></div>