I'm attempting to perform a seek operation in an MPEG-TS stream that contains a HEVC encoded bit stream. The HEVC stream is encoded using the following command;
ffmpeg -s:v 1920x1080 -i kimono.yuv -c:v libx265 -x265-params crf=23:fps=30:keyint=10:min-keyint=10 -c:a copy -f mpegts testhevc.ts
The seek operation is attempted with ffplay as;
ffplay testhevc.ts -ss 5 -vf showinfo
The information shown gives multiple initial errors with missing POCs, such as;
Could not find ref with POC 126
However, everything works fine when the same operation is performed with H.264. The encoding with H.264/AVC is performed as;
ffmpeg -s:v 1920x1080 -i kimono.yuv -c:v libx265 -c:v libx264 -crf 23 -r 30 -keyint_min 10 -g 10 -c:a copy -f mpegts testh264.ts
Is this an issue with the ffmpeg tools for HEVC or am I missing something in these commands?.
Thanks.
Related
I am streaming to YouTube and Facebook using ffmpeg , also writing data into disk (recording).
it's working fine on Facebook and recording but on YouTube it's giving warning that is
Please check the video resolution. The current resolution is (65535x65535), which is not optimal.
and output on YouTube is also 1:1 aspect ratio due to the above resolution.
I am using tee mux in ffmpeg Command.
ffmpeg -f dshow -framerate 30 -i video="Integrated Webcam":audio="Microphone Array (IntelĀ® Smart Sound Technology (IntelĀ® SST))" -s 1920x1080 -c:v libx264 -r 30 -preset ultrafast -tune zerolatency -crf 28 -pix_fmt yuv420p -c:a aac -strict -2 -ac 2 -b:a 128k -t 4 -map 0 -f tee "[f=ismv]pipe:1 | [f=flv]rtmps://youtube | [f=flv]facebook"
I am trying to get ffmpeg to work as expected however I am having all kinds of trouble getting it to work.
I need to output a webm and h264 for web play. However, the command I am using, while it used to work a few years ago, does not work at all now.
Both my webm and h264 do not have audio, and neither will play in any browser.
My command for webm is:
ffmpeg -y -i "$KMVAR_File" -c:v libvpx -crf 24 -b:v 1000k -vf scale=720:-2 -c:a libvorbis "$KMVAR_webmPath"
and my command for mp4 is:
ffmpeg -y -i "$KMVAR_File" -c:v libx264 -pix_fmt yuv420p -profile:v baseline -level 3.0 -crf 32 -b:v 1M -minrate 1M -maxrate 1M -bufsize 2M -vf scale=720:-2 -c:a aac -strict experimental -movflags +faststart "$KMVAR_mp4Path"
When playing with multiple audio, downmixing or extracting, there's no "one size fit all" solution with ffmpeg.
Look at https://trac.ffmpeg.org/wiki/AudioChannelManipulation as it provides multiple possible solution to your problem.
(I usually go with the pan filter : not the easiest to use, but more powerful than the map_channel approach)
I've got an odd issue that's been bugging me for a while. I'm converting another format to video using FFmpeg; the conversion takes place prior and is fed into FFmpeg to be finally converted to an mp4.
Oddly, I seem to be getting a little click at the start of the resulting video; it's not present in the original audio but shows up in the final video.
Here is the sample audio. You'll notice that it has no pop at the start.
Here is the raw video input.
Here is the video my command is generating.
Here is the command I'm using to reproduce the issue (the actual conversion takes place in a Python script feeding FFmpeg the video via stdin and the audio via a temp file)
cat debug_raw_video.bin| ffmpeg -hide_banner -loglevel info -y -s 256x192 -r 30 -f rawvideo -thread_queue_size 600 -pix_fmt rgb8 -i pipe:0 -f s16le -ar 11025 -ac 1 -guess_layout_max 0 -i ./debug_audio.wav -vcodec libx264 -pix_fmt yuv420p -movflags faststart -acodec aac -strict experimental -vf scale=512:384:flags=neighbor -threads 0 -preset medium -tune animation ./out.mp4
FFmpeg version:
ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers
Also have the same issue with this version:
ffmpeg version 3.3.4-static http://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2017 the FFmpeg developers
Why am I getting a little click/pop at the beginning? I've been trying to figure this out for quite a while.
It appears you're specifying that the input audio is raw, but it's not:
$ file debug_audio.wav
debug_audio.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 11025 Hz
So I imagine the click you're hearing is the wav header being processed as audio. If I remove the related options, -f s16le and -ar 11025, ffmpeg correctly determines that the audio input is in wav format and produces a click-less output:
cat debug_raw_video.bin | ffmpeg -hide_banner -loglevel info -y -s 256x192 -r 30 -f rawvideo -thread_queue_size 600 -pix_fmt rgb8 -i pipe:0 -ac 1 -i ./debug_audio.wav -vcodec libx264 -pix_fmt yuv420p -movflags faststart -acodec aac -strict experimental -vf scale=512:384:flags=neighbor -threads 0 -preset medium -tune animation ./out.mp4
At the moment, I'm trying to convert with FFMPEG my raw data in uint16 format from an infrared camera to MP4 format or at least to .h264.
My current command for ffmpeg is here:
ffmpeg -f rawvideo -pix_fmt gray16be -s:v 140x110 -r 30 -i binaryMarianData.bin -c:v libx264 -f rawvideo -pix_fmt yuv420p output.264
But my ouput File is not really looking good :(
Frame of My Input, its a Nose
Frame of My Output
Here is my Input File: http://fileshare.link/91a43a238e0de75b/binaryMarianData.bin
Update 1: Little Endian
Hey guys, would be great if it's possible to get the video output in the little endian byte order.
This is a frame shown with ImageJ with the following settings
Settings of the shown frame above in ImageJ
Unfortunaley my output doesn't look like this.
Output Frame Little Endian
This is my command used to convert the RAW File:
ffmpeg -f rawvideo -pixel_format gray16le -video_size 110x140 -framerate 30 -i binaryMarianData.bin -vf transpose=clock -c:v libx264 -pix_fmt yuv420p output.264
It is sideways, so the stride has to be corrected and the image rotated.
ffmpeg -f rawvideo -pixel_format gray16be -video_size 110x140 -framerate 30 -i binaryMarianData.bin -vf transpose=clock -c:v libx264 -pix_fmt yuv420p output.264
I want to get the file which is non-decoded h264 format to use in another client application. I know how to stream to disk using below command from the docs.
Example to encode video from /dev/video0:
ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 output.mp4
High level Diagram
This is typical producer and consumer problem -
Webcam =============> ffmpeg to video stream into file. (producer)
^
|
|
Client ________________________________|
(consumer)
// reads only Non-decoded h264 format from a file.
Use
ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 output.mp4 -c copy out.h264
out.h264 is the received H264 bitstream, saved as a file.
I found this as solution
ffmpeg -pix_fmt yuv420p -y -f v4l2 -vcodec h264 -i /dev/video0 out.h264