I have googled a bit but was never able to find an answer. What should be my first approach to simulate a video and audio noise from TV on screen? I mean, when my TV antenna is removed but the TV is still on (like they show in Japanese horror movies sometimes). I can use ffmpeg or any other technique but what is the simplest possible form of the signal?
相关问题
- Improving accuracy of Google Cloud Speech API
- MP4 codec support in Chromium
- Streaming video (C# using FFmpeg AutoGen) sends mu
- How do I decode opus file to pcm file using libavc
- ffmpeg for Android: neon build has text relocation
相关文章
- Handling ffmpeg library interface change when upgr
- How to use a framework build of Python with Anacon
- c++ mp3 library [closed]
- Passing a native fd int to FFMPEG from openable UR
- FFmpeg - What does non monotonically increasing dt
- ffmpeg run from shell runs properly, but does not
- Issues in executing FFmpeg command in Java code in
- Terminal text becomes invisible after terminating
Create video and audio noise, artifacts, and errors with
ffmpeg
Noise
Using filters
The
geq
(video "generic equation") filter (withnullsrc
as its "blank canvas") can create video noise, and theaevalsrc
filter can create white noise audio:Note that this will create black and white video noise.
Using
/dev/urandom
Although I recommend using the
geq
filter you can also use/dev/urandom
to generate video and audio noise (Windows users will have to use thegeq
filter as shown above). This is a small screeenshot, but of course the video will not be a static image:This will create color video noise. If you just want black and white you can add the
hue
filter.Adding random visual noise and errors to an existing video
Using the
noise
bitstream filter:Original and modified versions.
According to the documentation:
This bitstream filter can accept a value to increase or decrease the amount of noise. It's inverse, so a higher number is less noise, and 1 is the lowest number and therefore the most noise. You will need to experiment to see what works best for you.
This first example stream copied the audio and only glitched the video, but you can apply the filter to both audio and video by removing the stream specifier:
Or provide separate values for video and audio:
This seems to work well with
rawvideo
orhuffyuv
for video, andpcm_s16le
for audio, but I recommend experimenting. See lossless vs corruption (notes) for a video showing how different encoders react to noise corruption.The output
noise.mkv
is damaged, but you can re-encode it so it will work in your player:See the H.264 and AAC encoding guides on the FFmpeg Wiki for more encoding info.
Macroblock effect
There are several methods to do this, but in this example the noise bitstream filter will be used. Output to MPEG-2 video in TS as this will be more susceptible to the desired effect:
Increase
-q:v
value to ~20 if you want a more "encoded" look. Add a noise value as shown in the section above if you want more noise.The output
macroblock.ts
is damaged, but you can re-encode it so it will work in your player:See the section above for more info on the noise bitstream filter.
Results may vary, so you may not get what you're looking for. See hex editor method below.
Using a hex editor
Another method is to use a hex editor which you may find to be easier and more controllable and more consistent. See:
Forcing a pixel format
You can lie to ffmpeg and make it think that the colorspace and chroma subsampling is different that it actually is resulting in strange, error-like effects.
Original and modified versions.
Probe your input.
Note the frame rate and video frame size.
Refer to
ffmpeg -pix_fmts
and choose one of the available formats such asyuv420p16le
.Create rawvideo and pipe it to another
ffmpeg
instance:The
-framerate
and-video_size
values were copied from the original input file information shown in the console output of step 1. Of course you can also manipulate these for various effects.Mux audio if desired
yes, you can use
ffmpeg
:it's white noise
create images in grayscale with a random intensity and audio with completely random samples