[libav-api] Re-encoding a time interval in existing video

Andrey Utkin andrey.krieger.utkin at gmail.com
Sun Feb 12 02:09:22 CET 2012


I am trying to transcode video only in certail time interval of video
file, simply copying the rest of video AVPackets.
The point is saving time, because videos are large by duration and
picture scale, and only small time amount must be edited using
filters.

The sample of file i must handle is
http://dl.dropbox.com/u/43104344/interval_transcoding.mp4
My code is here
https://github.com/krieger-od/interval_transcoding

I launched it with command
./interval_transcoding -i
http://dl.dropbox.com/u/43104344/interval_transcoding.mp4 -o out.mov
--encode_start 58 --v_bitrate 100000 --loglevel 6
On playback, i get errors, see below.

[h264 @ 0x872e840]AVC: nal size 1296048089
[h264 @ 0x872e840]no frame!
Error while decoding frame!
[h264 @ 0x872e840]error while decoding MB 0 0, bytestream (-6)
[h264 @ 0x872e840]AVC: nal size -1707405113
[h264 @ 0x872e840]concealing 2040 DC, 2040 AC, 2040 MV errors
[h264 @ 0x872e840]error while decoding MB 0 0, bytestream (-20)
[h264 @ 0x872e840]AVC: nal size -1706096540
[h264 @ 0x872e840]concealing 2040 DC, 2040 AC, 2040 MV errors


I've tried to remux source file to mpegts, using -bsf
h264_mp4toannexb, the resulting video&audio was desynchronized,
and after transcoding with command
./interval_transcoding -i orig.ts -o out.ts --encode_start 58
--v_bitrate 100000 --loglevel 6
i got playback error, and grey screen at time my transcoded frames should go.
[h264 @ 0x872e840]Overread VUI by 93 bits

I'm surely missing some point, because i'm not familiar with H.264 and
its flavours.

-- 
Andrey Utkin


More information about the libav-api mailing list