Problem reading raw yuv.
Hi, I'm enconding some raw yuv video with ffmpeg but my final video has a horizontal sync issue (it slides to the right) and really strange colors (it's almost completely black&white with a few strips of bright colors in the top area). I create the raw yuv video with transcode: /usr/local/transcode-beta/bin/transcode -i /dados01/videos/originais/globo_20050414_155300_160800.avi -y raw,null --ext none -o /dados01/videos/clipes/temp.yuv -c 00:00:35-00:02:36,00:04:16-00:05:20 Here is a selection of transcode's output: transcode v1.0.0beta3 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg [transcode] (probe) suggested AV correction -D 0 (0 ms) | AV 0 ms | 0 ms [transcode] auto-probing source /dados01/videos/originais/globo_20050414_155300_160800.avi (ok) [transcode] V: import format | DivX RIFF data, AVI (V=ffmpeg|A=mp3) [transcode] V: import frame | 320x240 1.33:1 [transcode] V: bits/pixel | 1.562 [transcode] V: decoding fps,frc | 15.000,13 [transcode] V: Y'CbCr | YV12/I420 . . . [export_raw.so] codec=YV12, fps=15.000, width=320, height=240 I want to encode this video with ffmpeg. I'm using: /usr/local/ffmpeg-cvs/bin/ffmpeg -f rawvideo -pix_fmt yuv420p -s 320x240 -r 15 -i /dados01/videos/clipes/temp.yuv -an -vcodec msmpeg4 -f avi /dados01/videos/clipes/final.avi Here is ffmpeg's output: ffmpeg version 0.4.9-pre1, build 4752, Copyright (c) 2000-2004 Fabrice Bellard configuration: --prefix=/usr/local/ffmpeg-cvs --enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-gpl built on Apr 7 2005 13:57:09, gcc: 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) Input #0, rawvideo, from '/dados01/videos/clipes/temp.yuv': Duration: N/A, bitrate: N/A Stream #0.0: Video: rawvideo, yuv420p, 320x240, 15.00 fps Output #0, avi, to '/dados01/videos/clipes/final.avi': Stream #0.0: Video: msmpeg4, 320x240, 15.00 fps, q=2-31, 200 kb/s Stream mapping: Stream #0.0 -> #0.0 [msmpeg4 @ 0x8363174]removing common factors from framerate Press [q] to stop encoding [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 2 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 frame= 2775 q=0.0 Lsize= 6223kB time=185.0 bitrate= 275.6kbits/s video:6152kB audio:0kB global headers:0kB muxing overhead 1.152064% What's wrong with my commands? Rodrigo Severo ------------------------------------------------------------- Don't anthropomorphize computers, they don't like it! ------------------------------------------------------------- Rodrigo Severo F?brica de Id?ias rodrigo at fabricadeideias.com SBS - Ed. Empire Center - Sala 1301 - Cobertura CEP: 70070-904 Fone: (61) 321 1357 Fax: (61) 223 1712 -------------------------------------------------------------
Rodrigo Severo ha scritto:
Hi,
I'm enconding some raw yuv video with ffmpeg but my final video has a horizontal sync issue (it slides to the right) and really strange colors (it's almost completely black&white with a few strips of bright colors in the top area).
I create the raw yuv video with transcode:
/usr/local/transcode-beta/bin/transcode -i /dados01/videos/originais/globo_20050414_155300_160800.avi -y raw,null --ext none -o /dados01/videos/clipes/temp.yuv -c 00:00:35-00:02:36,00:04:16-00:05:20
Here is a selection of transcode's output:
transcode v1.0.0beta3 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg [transcode] (probe) suggested AV correction -D 0 (0 ms) | AV 0 ms | 0 ms [transcode] auto-probing source /dados01/videos/originais/globo_20050414_155300_160800.avi (ok) [transcode] V: import format | DivX RIFF data, AVI (V=ffmpeg|A=mp3) [transcode] V: import frame | 320x240 1.33:1 [transcode] V: bits/pixel | 1.562 [transcode] V: decoding fps,frc | 15.000,13 [transcode] V: Y'CbCr | YV12/I420 . . . [export_raw.so] codec=YV12, fps=15.000, width=320, height=240
I want to encode this video with ffmpeg. I'm using:
/usr/local/ffmpeg-cvs/bin/ffmpeg -f rawvideo -pix_fmt yuv420p -s 320x240 -r 15 -i /dados01/videos/clipes/temp.yuv -an -vcodec msmpeg4 -f avi /dados01/videos/clipes/final.avi
Here is ffmpeg's output:
ffmpeg version 0.4.9-pre1, build 4752, Copyright (c) 2000-2004 Fabrice Bellard configuration: --prefix=/usr/local/ffmpeg-cvs --enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-gpl built on Apr 7 2005 13:57:09, gcc: 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) Input #0, rawvideo, from '/dados01/videos/clipes/temp.yuv': Duration: N/A, bitrate: N/A Stream #0.0: Video: rawvideo, yuv420p, 320x240, 15.00 fps Output #0, avi, to '/dados01/videos/clipes/final.avi': Stream #0.0: Video: msmpeg4, 320x240, 15.00 fps, q=2-31, 200 kb/s Stream mapping: Stream #0.0 -> #0.0 [msmpeg4 @ 0x8363174]removing common factors from framerate Press [q] to stop encoding [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 2 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 frame= 2775 q=0.0 Lsize= 6223kB time=185.0 bitrate= 275.6kbits/s video:6152kB audio:0kB global headers:0kB muxing overhead 1.152064%
What's wrong with my commands?
Rodrigo Severo
-------------------------------------------------------------
Don't anthropomorphize computers, they don't like it!
-------------------------------------------------------------
Rodrigo Severo F?brica de Id?ias rodrigo at fabricadeideias.com SBS - Ed. Empire Center - Sala 1301 - Cobertura CEP: 70070-904 Fone: (61) 321 1357 Fax: (61) 223 1712
-------------------------------------------------------------
_______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu http://mplayerhq.hu/mailman/listinfo/ffmpeg-user
I got the same issue coding some raw video file . I solved it specifing -f yuv4mpegpipe as input format in ffmpeg. Vito Pinto
On Apr 28, 2005, at 10:46 AM, Vito Pinto wrote:
Rodrigo Severo ha scritto:
Hi,
I'm enconding some raw yuv video with ffmpeg but my final video has a horizontal sync issue (it slides to the right) and really strange colors (it's almost completely black&white with a few strips of bright colors in the top area).
I create the raw yuv video with transcode:
/usr/local/transcode-beta/bin/transcode -i /dados01/videos/originais/globo_20050414_155300_160800.avi -y raw,null --ext none -o /dados01/videos/clipes/temp.yuv -c 00:00:35-00:02:36,00:04:16-00:05:20
Here is a selection of transcode's output:
transcode v1.0.0beta3 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg [transcode] (probe) suggested AV correction -D 0 (0 ms) | AV 0 ms | 0 ms [transcode] auto-probing source /dados01/videos/originais/globo_20050414_155300_160800.avi (ok) [transcode] V: import format | DivX RIFF data, AVI (V=ffmpeg|A=mp3) [transcode] V: import frame | 320x240 1.33:1 [transcode] V: bits/pixel | 1.562 [transcode] V: decoding fps,frc | 15.000,13 [transcode] V: Y'CbCr | YV12/I420 . . . [export_raw.so] codec=YV12, fps=15.000, width=320, height=240
I want to encode this video with ffmpeg. I'm using:
/usr/local/ffmpeg-cvs/bin/ffmpeg -f rawvideo -pix_fmt yuv420p -s 320x240 -r 15 -i /dados01/videos/clipes/temp.yuv -an -vcodec msmpeg4 -f avi /dados01/videos/clipes/final.avi
Here is ffmpeg's output:
ffmpeg version 0.4.9-pre1, build 4752, Copyright (c) 2000-2004 Fabrice Bellard configuration: --prefix=/usr/local/ffmpeg-cvs --enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-gpl built on Apr 7 2005 13:57:09, gcc: 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) Input #0, rawvideo, from '/dados01/videos/clipes/temp.yuv': Duration: N/A, bitrate: N/A Stream #0.0: Video: rawvideo, yuv420p, 320x240, 15.00 fps Output #0, avi, to '/dados01/videos/clipes/final.avi': Stream #0.0: Video: msmpeg4, 320x240, 15.00 fps, q=2-31, 200 kb/s Stream mapping: Stream #0.0 -> #0.0 [msmpeg4 @ 0x8363174]removing common factors from framerate Press [q] to stop encoding [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 2 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 frame= 2775 q=0.0 Lsize= 6223kB time=185.0 bitrate= 275.6kbits/s video:6152kB audio:0kB global headers:0kB muxing overhead 1.152064%
What's wrong with my commands?
Rodrigo Severo
-------------------------------------------------------------
Don't anthropomorphize computers, they don't like it!
-------------------------------------------------------------
Rodrigo Severo F?brica de Id?ias rodrigo at fabricadeideias.com SBS - Ed. Empire Center - Sala 1301 - Cobertura CEP: 70070-904 Fone: (61) 321 1357 Fax: (61) 223 1712
-------------------------------------------------------------
_______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu http://mplayerhq.hu/mailman/listinfo/ffmpeg-user
I got the same issue coding some raw video file . I solved it specifing -f yuv4mpegpipe as input format in ffmpeg.
yuv4mpeg != raw. Feeding raw video to -f yuv4mpegpipe should not be possible. yuv4mpeg is a really nice format; if transcode supports it use it instead of raw. Otherwise I cannot see any errors in your command prompt. Try playing the raw .yuv file with mplayer and see if it plays OK. Also you can try wrapping it in an avi container instead of using raw. /Roine
Roine Gustafsson wrote:
On Apr 28, 2005, at 10:46 AM, Vito Pinto wrote:
Rodrigo Severo ha scritto:
Hi,
I'm enconding some raw yuv video with ffmpeg but my final video has a horizontal sync issue (it slides to the right) and really strange colors (it's almost completely black&white with a few strips of bright colors in the top area).
I create the raw yuv video with transcode:
/usr/local/transcode-beta/bin/transcode -i /dados01/videos/originais/globo_20050414_155300_160800.avi -y raw,null --ext none -o /dados01/videos/clipes/temp.yuv -c 00:00:35-00:02:36,00:04:16-00:05:20
Here is a selection of transcode's output:
transcode v1.0.0beta3 (C) 2001-2003 Thomas Oestreich, 2003-2004 T. Bitterberg [transcode] (probe) suggested AV correction -D 0 (0 ms) | AV 0 ms | 0 ms [transcode] auto-probing source /dados01/videos/originais/globo_20050414_155300_160800.avi (ok) [transcode] V: import format | DivX RIFF data, AVI (V=ffmpeg|A=mp3) [transcode] V: import frame | 320x240 1.33:1 [transcode] V: bits/pixel | 1.562 [transcode] V: decoding fps,frc | 15.000,13 [transcode] V: Y'CbCr | YV12/I420 . . . [export_raw.so] codec=YV12, fps=15.000, width=320, height=240
I want to encode this video with ffmpeg. I'm using:
/usr/local/ffmpeg-cvs/bin/ffmpeg -f rawvideo -pix_fmt yuv420p -s 320x240 -r 15 -i /dados01/videos/clipes/temp.yuv -an -vcodec msmpeg4 -f avi /dados01/videos/clipes/final.avi
Here is ffmpeg's output:
ffmpeg version 0.4.9-pre1, build 4752, Copyright (c) 2000-2004 Fabrice Bellard configuration: --prefix=/usr/local/ffmpeg-cvs --enable-mp3lame --enable-faad --enable-faac --enable-xvid --enable-gpl built on Apr 7 2005 13:57:09, gcc: 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1) Input #0, rawvideo, from '/dados01/videos/clipes/temp.yuv': Duration: N/A, bitrate: N/A Stream #0.0: Video: rawvideo, yuv420p, 320x240, 15.00 fps Output #0, avi, to '/dados01/videos/clipes/final.avi': Stream #0.0: Video: msmpeg4, 320x240, 15.00 fps, q=2-31, 200 kb/s Stream mapping: Stream #0.0 -> #0.0 [msmpeg4 @ 0x8363174]removing common factors from framerate Press [q] to stop encoding [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 2 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 [msmpeg4 @ 0x8363174]warning, cliping 1 dct coefficents to -127..127 frame= 2775 q=0.0 Lsize= 6223kB time=185.0 bitrate= 275.6kbits/s video:6152kB audio:0kB global headers:0kB muxing overhead 1.152064%
What's wrong with my commands?
Rodrigo Severo
-------------------------------------------------------------
Don't anthropomorphize computers, they don't like it!
-------------------------------------------------------------
Rodrigo Severo F?brica de Id?ias rodrigo at fabricadeideias.com SBS - Ed. Empire Center - Sala 1301 - Cobertura CEP: 70070-904 Fone: (61) 321 1357 Fax: (61) 223 1712
-------------------------------------------------------------
_______________________________________________ ffmpeg-user mailing list ffmpeg-user at mplayerhq.hu http://mplayerhq.hu/mailman/listinfo/ffmpeg-user
I got the same issue coding some raw video file . I solved it specifing -f yuv4mpegpipe as input format in ffmpeg.
yuv4mpeg != raw. Feeding raw video to -f yuv4mpegpipe should not be possible.
yuv4mpeg is a really nice format; if transcode supports it use it instead of raw. Otherwise I cannot see any errors in your command prompt. Try playing the raw .yuv file with mplayer and see if it plays OK. Also you can try wrapping it in an avi container instead of using raw.
First of all, thanks for you Roine and Vito for your help. yuv4mpeg seems to be a quite usefull format but as Roine pointed, it isn't raw. I wanted raw because I want to "cat 1.raw 2.raw > complete.raw" before compression. I couldn't find a way to join several yuv4mpeg files. Neither I could do it with the avi with yv12 video inside created by transcode as I couldn't make ffmpeg import it. In the end I decided to drop transcode for video processing as ffmpeg is faster and, most important, really does the job. Here is the working solution I have right now: # Extract all the pieces I need: ffmpeg -ss 00:00:10 -t 20 -i original1.avi temp1.yuv ffmpeg -ss 00:15:10 -t 45 -i original1.avi temp2.yuv ffmpeg -ss 00:05:00 -t 15 -i original2.avi temp3.yuv # Join them in a single raw stream: cat temp1.yuv temp2.yuv temp3.yuv > temp.yuv # Encode in the final format: ffmpeg -s 320x240 -r 15 -t 80 -i temp.yuv -vcodec msmpeg4 -an final.avi Of course this is a slight simplification of what I'm actually doing as the final encoding will occur several times. I need several versions of the final movie. The sound processing will probably be a bit complicated also. Rodrigo ------------------------------------------------------------- The truth is rarely pure, and never simple. -- Oscar Wilde ------------------------------------------------------------- Rodrigo Severo F?brica de Id?ias rodrigo at fabricadeideias.com SBS - Ed. Empire Center - Sala 1301 - Cobertura CEP: 70070-904 Fone: (61) 321 1357 Fax: (61) 223 1712 -------------------------------------------------------------
On Fri, 2005-04-29 at 09:34 -0300, Rodrigo Severo wrote:
In the end I decided to drop transcode for video processing as ffmpeg is faster and, most important, really does the job. Here is the working solution I have right now:
# Extract all the pieces I need: ffmpeg -ss 00:00:10 -t 20 -i original1.avi temp1.yuv ffmpeg -ss 00:15:10 -t 45 -i original1.avi temp2.yuv ffmpeg -ss 00:05:00 -t 15 -i original2.avi temp3.yuv
# Join them in a single raw stream: cat temp1.yuv temp2.yuv temp3.yuv > temp.yuv
# Encode in the final format: ffmpeg -s 320x240 -r 15 -t 80 -i temp.yuv -vcodec msmpeg4 -an final.avi
Of course this is a slight simplification of what I'm actually doing as the final encoding will occur several times. I need several versions of the final movie. The sound processing will probably be a bit complicated also.
Can't you just demux, concatenate, and mux again, instead of completely re-encoding?
Erik Slagter wrote:
On Fri, 2005-04-29 at 09:34 -0300, Rodrigo Severo wrote:
In the end I decided to drop transcode for video processing as ffmpeg is faster and, most important, really does the job. Here is the working solution I have right now:
# Extract all the pieces I need: ffmpeg -ss 00:00:10 -t 20 -i original1.avi temp1.yuv ffmpeg -ss 00:15:10 -t 45 -i original1.avi temp2.yuv ffmpeg -ss 00:05:00 -t 15 -i original2.avi temp3.yuv
# Join them in a single raw stream: cat temp1.yuv temp2.yuv temp3.yuv > temp.yuv
# Encode in the final format: ffmpeg -s 320x240 -r 15 -t 80 -i temp.yuv -vcodec msmpeg4 -an final.avi
Of course this is a slight simplification of what I'm actually doing as the final encoding will occur several times. I need several versions of the final movie. The sound processing will probably be a bit complicated also.
Can't you just demux, concatenate, and mux again, instead of completely re-encoding?
Not really as I need to create several different versions (encoding options) of the same original. I'm not sure yet but probably there won't be any version with the same encoding options as the original. As "encoding options" I mean not only bitrate, fps, frame size but also audio and video codec. As you see, re-encoding isn't optional. As fast as it can be, I trying to decode only once to have a, probably little, speed gain. Is there a better way to get this kind of results? Rodrigo Severo
participants (4)
-
erik@slagter.name -
letwave2000@yahoo.it -
rodrigo.lists@fabricadeideias.com -
roine@users.sourceforge.net