h.264
convert H264 video to raw YUV format
Yes you can, you just have to specific the pixel format. To get the whole list of the format: ffmpeg -pix_fmts | grep -i pixel_format_name For example if you want to save the 1st video track of an mp4 file as a yuv420p (p means planar) file: ffmpeg -i video.mp4 -c:v rawvideo -pix_fmt yuv420p out.yuv
How can I convert .MTS file (AVCHD) to .mp4 by ffmpeg without re-encoding H264 video stream correctly?
Here it is: ffmpeg -i input.m2ts -c:v copy -c:a aac -strict experimental -b:a 128k output.mp4 This will only copy the video stream without re-encoding and encode the audio track to AAC VBR stereo, it requires a recent FFmpeg version.
Convert videos from .264 to .265 (HEVC) with ffmpeg
This answer was posted (under the CC BY-SA 4.0 license) as a comment by Gyan to the question Convert videos from .264 to .265 (HEVC) with ffmpeg. Run this command for x265 conversion: ffmpeg -i input.mp4 -c:v libx265 -vtag hvc1 output.mp4
How to get h264 video info?
I’ve found out that the best way for this is using FFprobe with -show_streams parameter. It shows both h.264 profile and B-frames usage for video streams of the movie. ffprobe -show_streams -i “file.mp4” [STREAM] index=0 codec_name=h264 codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 profile=High codec_type=video codec_time_base=1001/48000 codec_tag_string=avc1 codec_tag=0x31637661 width=1920 height=1080 has_b_frames=0 sample_aspect_ratio=0:1 … Read more
How to use hardware accelerated video decoding on Android?
To answer the above question, let me introduce few concepts related to Android OpenMAX Android uses OpenMAX for codec interface. Hence all native codecs (hardware accelerated or otherwise) provide OpenMAX interface. This interface is used by StageFright(Player framework) for decoding media using codec NDK Android allows Java Applications to interact with underlying C/C++ native libraries … Read more
Decoding Raw H264 stream in android?
I can’t provide any code for this unfortunately, but I’ll do my best to explain it based on how I got it to work. So here is my overview of how I got raw H.264 encoded video to work using the MediaCodec class. Using the link above there is an example of getting the decoder … Read more
Raw H264 frames in mpegts container using libavcodec
I believe if you set the following, you will see video playback. packet.flags |= AV_PKT_FLAG_KEY; packet.pts = packet.dts = 0; You should really set packet.flags according to the h264 packet headers. You might try this fellow stack overflowian’s suggestion for extracting directly from the stream. If you are also adding audio, then pts/dts is going … Read more
Live streaming through MP4
You may use fragmented MP4. A fragmented MP4 file is built a follows: moov [moof mdat]+ The moov box then only contains basic information about the tracks (how many, their type , codec initialization and so on) but no information about the samples in the track. The information about sample locations and sample sizes is … Read more