ffmpeg yuvj422p color movie conversion avi2ogv - ffmpeg

While converting avi video to ogv, there is a color problem in output file.
How can I solve this issue ?
normal colors altered colors
Actually a part of the problem is from the player - so weak question
Command using ffmpeg-3.3.2-1.mga6.tainted :
ffmpeg -i dscn0146.avi -pix_fmt yuv422p -s 640x480 dscn0146_hq.ogv -y
And input metadata:
Guessed Channel Layout for Input Stream #0.1 : mono
Input #0, avi, from 'dscn0146.avi':
Metadata:
encoder :
maker : NIKON
model : COOLPIX S3500
creation_time : 2017-07-22 12:09:06
Duration: 00:00:07.33, start: 0.000000, bitrate: 11091 kb/s
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 640x480, 10770 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 22050 Hz, mono, s16, 352 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> theora (libtheora))
Stream #0:1 -> #0:1 (pcm_s16le (native) -> vorbis (libvorbis))
Processes normaly, but fires a warning:
[swscaler # 0xd3c3a0] deprecated pixel format used, make sure you did set range correctly
Output metadata:
Output #0, ogv, to 'dscn0146_hq.ogv':
Metadata:
model : COOLPIX S3500
maker : NIKON
encoder : Lavf57.71.100
Stream #0:0: Video: theora (libtheora), yuv422p(progressive), 640x480, q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc
Metadata:
encoder : Lavc57.89.100 libtheora
model : COOLPIX S3500
maker : NIKON
Stream #0:1: Audio: vorbis (libvorbis), 22050 Hz, mono, fltp
Metadata:
encoder : Lavc57.89.100 libvorbis
model : COOLPIX S3500
maker : NIKON

this working code
ffmpeg -i totoa.avi -c:v libtheora -q:v 10 -c:a libvorbis -q:a 5 -s 640x480 -y toto.ogv

Related

I try to reduce a MPEG-4 video's bitrate with GPU acceleration,but something is wrong

ffmpeg -vsync 0 -hwaccel cuda -hwaccel_output_format cuda -c:v
mpeg4_cuvid -i "F:\dataset\celeb-df-v1\Celeb-real\id0_0002.mp4"
-vcodec mpeg4 -b:v 574k -y "F:\dataset\celeb-df-v1\compress\id0_0002.mp4"
It keeps reporting errors like:
Impossible to convert between the formats supported by the filter
'Parsed_null_0' and the filter 'auto_scaler_0' Error reinitializing
filters! Failed to inject frame into filter network: Function not
implemented Error while processing the decoded data for stream #0:0
Here is my video info
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\dataset\celeb-df-v1\\Celeb-real\id0_0002.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2mp41
encoder : Lavf58.3.100
Duration: 00:00:11.67, start: 0.000000, bitrate: 1148 kb/s
Stream #0:0(und): Video: mpeg4 (Simple Profile) (mp4v / 0x7634706D), yuv420p, 942x500 [SAR 1:1 DAR 471:250], 1146 kb/s, 30 fps, 30 tbr, 90k tbn, 30 tbc (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (mpeg4 (mpeg4_cuvid) -> mpeg4 (native))
Press [q] to stop, [?] for help

Scale2ref then join two video clips using ffmpeg

I have two video (with audio) clips that I want to join. The first clip has the following format:
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 358 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, stereo, fltp, 192 kb/s (default)
Metadata:
handler_name : SoundHandler
Side data:
audio service type: main
And the second:
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 320x240, 88 kb/s, 8 fps, 8 tbr, 16384 tbn, 16 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: ac3 (ac-3 / 0x332D6361), 11025 Hz, mono, fltp, 96 kb/s (default)
Metadata:
handler_name : SoundHandler
Side data:
audio service type: main
I want to join the two clips; the first followed by the latter while keeping the format options of the second clip.
Based on reading the documentation and other questions I have reached the following command:
ffmpeg -i secondClip.mp4 -i firstClip.mpg -filter_complex "[1:v:0][0:v:0]scale2ref=oh*mdar:ih[2nd][ref],[2nd][1:a:0][ref][0:a:0]concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" output.mp4
This gives the following errors:
Stream mapping:
Stream #0:0 (h264) -> scale2ref:ref
Stream #0:1 (ac3) -> concat:in1:a0
Stream #1:0 (mpeg2video) -> scale2ref:default
Stream #1:1 (mp2) -> concat:in0:a0
concat:out:v0 -> Stream #0:0 (libx264)
concat:out:a0 -> Stream #0:1 (aac)
Press [q] to stop, [?] for help
[Parsed_concat_1 # 0000017896b6f400] Input link in1:v0 parameters (size 320x240, SAR 0:1) do not match the corresponding output link in0:v0 parameters (426x240, SAR 640:639)
[Parsed_concat_1 # 0000017896b6f400] Failed to configure output pad on Parsed_concat_1
Error reinitializing filters!
Failed to inject frame into filter network: Invalid argument
Error while processing the decoded data for stream #0:0
Conversion failed!

ffmpeg: "Referenced QT chapter track not found"

Using ffmpeg to replace audio in a QuickTime with audio from a WAV.
Anyone know why I'm getting Referenced QT chapter track not found?
Command:
$ ffmpeg \
-i "$video" -t 25 \
-i "$audio" -map 0:v -c:v copy -map 1:a -c:a pcm_s24le -ar 48000 \
-hide_banner "$output"
Output:
[mov,mp4,m4a,3gp,3g2,mj2 # 0x7faf62010600] Referenced QT chapter track not found
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
creation_time : 2018-11-06T09:27:43.000000Z
Duration: 00:00:25.00, start: 0.000000, bitrate: 186987 kb/s
Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709, progressive), 1920x1080, 185115 kb/s, SAR 1:1 DAR 16:9, 25 fps, 25 tbr, 25 tbn, 25 tbc (default)
Metadata:
creation_time : 2018-11-06T09:27:43.000000Z
handler_name : Apple Alias Data Handler
encoder : Apple ProRes 422 (HQ)
timecode : 00:00:00:00
Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, stereo, s16, 1536 kb/s (default)
Metadata:
creation_time : 2018-11-06T09:27:43.000000Z
handler_name : Apple Alias Data Handler
timecode : 00:00:00:00
Stream #0:2(eng): Data: none (tmcd / 0x64636D74), 0 kb/s (default)
Metadata:
creation_time : 2018-11-06T09:27:43.000000Z
handler_name : Apple Alias Data Handler
timecode : 00:00:00:00
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, wav, from 'audio.wav':
Metadata:
encoded_by : Pro Tools
originator_reference: aaOpKJaTN7Nk
date : 2018-11-08
creation_time : 13:53:50
time_reference : 166698000
Duration: 00:00:25.00, bitrate: 2128 kb/s
Stream #1:0: Audio: pcm_s24le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s32 (24 bit), 2116 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (pcm_s24le (native) -> pcm_s24le (native))
Press [q] to stop, [?] for help
Output #0, mov, to 'test19.mov':
Metadata:
major_brand : qt
minor_version : 537199360
compatible_brands: qt
encoder : Lavf58.12.100
Stream #0:0(eng): Video: prores (apch / 0x68637061), yuv422p10le(bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 185115 kb/s, 0.04 fps, 25 tbr, 12800 tbn, 25 tbc (default)
Metadata:
creation_time : 2018-11-06T09:27:43.000000Z
handler_name : Apple Alias Data Handler
encoder : Apple ProRes 422 (HQ)
timecode : 00:00:00:00
Stream #0:1: Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32 (24 bit), 2304 kb/s
Metadata:
encoder : Lavc58.18.100 pcm_s24le
frame= 625 fps=277 q=-1.0 Lsize= 566343kB time=00:00:24.96 bitrate=185876.0kbits/s speed=11.1x
video:564928kB audio:1406kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.001496%
Same error with -map 0:v:0
Output looks to be created without errors.
What the error means is that MOV header indicates that a text track with chapter titles and timestamps is present but FFmpeg can't actually find that track in the file.
Adding -ignore_chapters 1 before -i "$video" will stop ffmpeg from looking for that track.
While traversing my personal video collection with ffprobe, I ran into several such errors, including:
[mov,mp4,m4a,3gp,3g2,mj2 # 000000000039a980] Referenced QT chapter
track not found
and...
[mp3float # 000000000079bb80] Header missing
From what I can tell, these are non-fatal errors that seem to simply be an indicator of the video's original encoder doing a bad or incomplete job, and so for a video collection that's large enough and sourced from enough disparate sources, I'd guess that it would be a mathematical likelihood to run into at least a few of these errors while analysing the entire collection. For obvious reasons, however, it makes sense to want to suppress these errors since they aren't needed and look unseemly in STDOUT.
There seems to be no such -ignore-chapters option for ffprobe, but I was able to suppress all of these non-fatal errors by adding -v fatal, which changes the command's loglevel to only display fatal errors (the default shows fatal and non-fatal errors, warnings and extra information). This option doesn't suppress ffprobe's output, which is printed as normal.

ffmpeg for android, out of memory on decoding rotate mp4 file with openh264

Version
ffmpeg : 4.0.2
openh264: 1.8.0
Problem
I try to trim a .mp4 file which metadata info contains rotate info, but I failed with the error information.
The file stream info :
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2018-10-09T09:40:53.000000Z
location : +39.8983+116.4145/
location-eng : +39.8983+116.4145/
com.android.version: 6.0
Duration: 00:00:10.56, start: 0.000000, bitrate: 8671 kb/s
Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720, 8563 kb/s, SAR 1:1 DAR 16:9, 30.01 fps, 30 tbr, 90k tbn, 180k tbc (default)
Metadata:
rotate : 180
creation_time : 2018-10-09T09:40:53.000000Z
handler_name : VideoHandle
Side data:
displaymatrix: rotation of -180.00 degrees
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
creation_time : 2018-10-09T09:40:53.000000Z
handler_name : SoundHandle
ffmpeg cmd
ffmpeg -y -i 1.mp4 -threads 4 -b:v 2000k -vcodec libopenh264 -acodec copy -ss 0 -t 3 -f mp4 -movflags faststart -strict -2 ./output.mp4
result
Error reinitializing filters!
Failed to inject frame into filter network: Out of memory
Error while processing the decoded data for stream #0:0
Then I found this answer: ffmpeg-for-android-out-of-memory, after i added -noautorotate command to my cmd, the video is trimmed successful.
If I use -vcodec copy instead of -vcodec libopenh264, the result also is ok, I wonder if there is a bug when libopenh264 decode with ffmpeg's autorotate function.
I wipe the video's rotate info from metadata with -metadata:s:v:0 command, the newly video can be trimmed successful with the origin cmd :(
The error message is misleading. Due to your usage of --disable-filters you need to manually enable the hflip/vflip filters:
--enable-filter=aresample,crop,hflip,scale,transpose,vflip
Some filters (such as the format filter) will be automatically enabled in this case.

FFmpeg error m4v to flv requested bitrate is too low

FFMPEG OUTPUT
COMMAND
/usr/local/bin/ffmpeg -i '/home/machine/public_html/video_1355531272.m4v' -s '640x480' -sameq -ab '64k' -ar '44100' -f 'flv' -pass '1' -passlogfile '/home/machine/public_html/tmp/1355531273-50cbc4090d696-multipass' -y /home/machine/public_html/tmp/1355531273-50cbc4090d2a9.flv &> /home/machine/public_html/tmp/1355531273-50cbc4090da7c.info
/usr/local/bin/ffmpeg -i '/home/machine/public_html/video_1355531272.m4v' -s '640x480' -sameq -ab '64k' -ar '44100' -f 'flv' -pass '2' -passlogfile '/home/machine/public_html/tmp/1355531273-50cbc4090d696-multipass' -y /home/machine/public_html/tmp/1355531273-50cbc4090d2a9.flv &> /home/machine/public_html/tmp/1355531273-50cbc4090da7c.info
eng): Video: h264, yuv420p, 960x540, 3428 kb/s, 29.97 fps, 29.97 tbr, 2997 tbn, 5994 tbc
Metadata:
creation_time : 2012-12-14 22:50:55
Stream #0.1(eng): Audio: aac, 44100 Hz, stereo, s16, 111 kb/s
Metadata:
creation_time : 2012-12-14 22:50:55
[buffer # 0xdd079d0] w:960 h:540 pixfmt:yuv420p
[scale # 0xdd07da0] w:960 h:540 fmt:yuv420p -> w:640 h:480 fmt:yuv420p flags:0xa0000004
[flv # 0xdd041c0] requested bitrate is too low
Output #0, flv, to '/home/machine/public_html/tmp/1355531273-50cbc4090d2a9.flv':
Stream #0.0(eng): Video: flv, yuv420p, 640x480, q=2-31, pass 2, 200 kb/s, 90k tbn, 29.97 tbc
Metadata:
creation_time : 2012-12-14 22:50:55
Stream #0.1(eng): Audio: adpcm_swf, 44100 Hz, stereo, s16, 64 kb/s
Metadata:
creation_time : 2012-12-14 22:50:55
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
-------------------------------
RESULT
-------------------------------
Execute error. Output for file "/home/machine/public_html/video_1355531272.m4v" was found, but the file contained no data. Please check the available codecs compiled with FFmpeg can support this type of conversion. You can check the encode decode availability by inspecting the output array from PHPVideoToolkit::getFFmpegInfo().
Remove the -sameq option. It does not mean same quality.

Resources