muxer

How to use libavformat to concat 2 video files with same codec (re-muxing)?

丶灬走出姿态 提交于 2019-11-29 22:14:36
问题 I have downloaded videos from CDN in flv format (video H264 and audio AAC) and remux to them to MP4 format. But videos are limited by length. So i've downloaded each video in several parts: started at start point, at point 1, at point 2 (by using seek parameter in url). Each point starts little earlier than ending of previous one. Using av_read_frame i scanned all parts and found that intersecting packets not only have same sizes and order but also their dts/pts shifted from each other by

How can libavformat be used without using other libav libraries?

若如初见. 提交于 2019-11-29 04:03:44
问题 I would like a simple working example of using just libavformat to mux video. There are nice examples (doc/examples/muxing.c) that show encoding with libavcodec, muxing with libavformat and saving the data with libavio. However, there is no example I know of that uses libavformat by itself, feeding in encoded data in a buffer and getting muxed data in a buffer. The difficulty is two-fold: one, adding a stream with avformat_new_stream(AVFormatContext *s, const AVCodec *c) requires a reference

Android encoder muxer: raw h264 to mp4 container

∥☆過路亽.° 提交于 2019-11-28 20:57:38
I created a h264 raw video file, and I was able to mux it with Android MediaMuxer on Android 4.3 and up. Now I need to support Android versions 4.1 and 4.2. I found Jcodec. And there is an example for doing this: https://github.com/jcodec/jcodec/blob/master/samples/main/java/org/jcodec/samples/mux/AVCMP4Mux.java But I'm getting java.nio.ReadOnlyBufferException exception at line 70: H264Utils.encodeMOVPacket(data); I guess this code is not for Android? How do I fix this. Can someone familiar with Jcodec help on this? xy uber.com I gave up on Jcodec. It exposes too many codec internal stuff, and

MediaMuxer error “Failed to stop the muxer”

不羁岁月 提交于 2019-11-28 00:53:27
I'm encoding Camera preview data using MediaCodec with mime-type "video/avc" and passing the encoded data (video-only, no audio) to MediaMuxer . The muxer seems to run fine and creates a reasonably sized output file (i.e., gets larger the longer I record). However, when I try to stop the muxer I get the "Failed to stop the muxer" error: 10-21 10:39:40.755: E/AndroidRuntime(2166): Caused by: java.lang.IllegalStateException: Failed to stop the muxer There are some suspicious MPEG4Writer log messages preceding the failed stop: 10-21 10:39:40.740: D/MPEG4Writer(2166): Stopping Video track 10-21 10

Android encoder muxer: raw h264 to mp4 container

泪湿孤枕 提交于 2019-11-27 12:34:48
问题 I created a h264 raw video file, and I was able to mux it with Android MediaMuxer on Android 4.3 and up. Now I need to support Android versions 4.1 and 4.2. I found Jcodec. And there is an example for doing this: https://github.com/jcodec/jcodec/blob/master/samples/main/java/org/jcodec/samples/mux/AVCMP4Mux.java But I'm getting java.nio.ReadOnlyBufferException exception at line 70: H264Utils.encodeMOVPacket(data); I guess this code is not for Android? How do I fix this. Can someone familiar

MediaMuxer error “Failed to stop the muxer”

邮差的信 提交于 2019-11-26 21:48:02
问题 I'm encoding Camera preview data using MediaCodec with mime-type "video/avc" and passing the encoded data (video-only, no audio) to MediaMuxer . The muxer seems to run fine and creates a reasonably sized output file (i.e., gets larger the longer I record). However, when I try to stop the muxer I get the "Failed to stop the muxer" error: 10-21 10:39:40.755: E/AndroidRuntime(2166): Caused by: java.lang.IllegalStateException: Failed to stop the muxer There are some suspicious MPEG4Writer log