[Ffmpeg-devel-irc] ffmpeg.log.20150130

burek burek021 at gmail.com
Sat Jan 31 02:05:01 CET 2015


[00:42] <TwisteR> Greetings! I have a problem similar to one described here: http://stackoverflow.com/questions/25849875/ffmpeg-very-big-duration-and-very-small-fps-with-mpeg4-rtsp-input
[00:42] <TwisteR> trying to find out what is the problem
[00:47] <TwisteR> lol, problem solved :D forgot to set pkt.duration ;)
[00:48] <TwisteR> like this (unsure, if this is correct, but it works for me)
[00:48] <TwisteR> pkt.duration = av_rescale_q(pkt.duration, ifcx->streams[i_index]->codec->time_base, ofcx->streams[i_index]->codec->time_base);
[01:42] <debianuser> Hello, how to recover an incomplete .mp4 file? I.e. a recording process was killed while writing .mp4 file. So I have 1+GB file that fails to play because "moov atom not found".
[01:42] <debianuser> ("recording process" was actually ffmpeg, if that can help)
[01:44] Action: debianuser thinks it's a rather common problem, maybe there's a common solution to it?
[02:03] <c_14> Short answer, you can't.
[02:03] <c_14> At least not easily, and not reproduceably.
[02:07] <debianuser> :( It there a long answer? I know almost everything about that video (h264 1920x1080 yuv420p 30 fps video, aac 48kHz stereo audio), what information is missing to make that file playable again?
[02:11] <c_14> Intricate knowledge of the internals of the encoder/muxer/mp4 format and a willingness to work with raw binary data/hex as well as knowledge of at least 1 programming language.
[02:19] <c_14> I've found a couple of links to programs that might be able to recover something from the file.
[02:20] <c_14> But if you still have the source it's probably less work/time to just reencode.
[02:23] <ribasushi> c_14: I find your answer kinda odd - if the parameters of the streams are known, isn't the moov more or less redundant...?
[02:23] <ribasushi> I am not arguing with you, I am wondering what am I missing
[02:23] <c_14> The moov atom is an index of everything, until you write it you don't know where in the file the video is, where the audio is etc
[02:24] <ribasushi> bleh
[02:24] <c_14> http://forum.doom9.org/archive/index.php/t-169815.html
[02:24] <c_14> read the 2nd post
[02:24] Action: ribasushi makes a note to always record to matroska (with a copy-remux to mp4 if needed)
[02:24] <ribasushi> c_14: thanks!
[02:25] <debianuser> No, I don't have the source, it was a stream capture. (currently trying to solve some ffmpeg linking problems http://pastebin.com/kc1VYWFr and build https://github.com/ponchio/untrunc)
[02:25] <ribasushi> c_14: huh... that's one bizarre mux format...
[02:26] <ribasushi> any idea why anyone would design things this way...? I mean there had to be some reason
[02:29] <c_14> It's relatively simple
[02:29] <c_14> The muxer can just start writing data however it wants and then when it's done write out what's where.
[02:30] <c_14> And nobody thought about what would happen if the process aborted...
[02:32] <ribasushi> c_14: that'd be fine if they were working on a greenfield thing
[02:32] <ribasushi> but both avi and matroska existed before mp4 was finalized (afaik)
[02:33] <debianuser> (well `-Lffmpeg/libswresample -lswresample -lrt` did the trick, now ./untrunk prints lots of something to the screen, waiting and hoping...)
[02:34] <c_14> debianuser: oh, and next time. When doing stream captures, (or any long-runnig encode especially if you don't have the source) don't mux to mp4. If you need it in mp4 either remux afterwards, or at very least also mux to another format like matroska or mpegts
[02:34] <debianuser> :)
[02:35] Action: c_14 wonders if he should stick a giant disclaimer somewhere
[02:37] <debianuser> Technically it should not be impossible to recover even in case of mp4. (1) guess the codecs: read first 10MB and attempt to decode as much as possible with all the available codecs, cut that, repeat. (2) knowing the codec: read and decode as much as possible, switch to another codec, repeat.
[02:38] <c_14> It's not _impossible_, but bruteforce is neither fast, nor pretty.
[02:39] <c_14> And not really something you want to was^h^h^hspend your time doing
[02:40] <debianuser> It was just a little unexpected that there's no known tool doing that, since it's really easy to get a broken mp4 because of a camera/mobile phone shut down during recording...
[02:44] <c_14> You'd think so, but most of the time it just isn't worth the effort
[02:49] <debianuser> Ok, it took ./untrunc 67 seconds to process 50MB of that file, and the result was indeed playable, video was very broken, however, the sound was not bad.
[03:15] <k_sze[work]> ugh, transcoding ffv1 from 8-bit grayscale to 16-bit grayscale doubled in size.
[03:16] <k_sze[work]> even though my video should have reaaaally low entropy.
[03:18] <ribasushi> k_sze[work]: ffv1 does not do any meaningful compression
[03:19] <ribasushi> k_sze[work]: I do a lot of 264 lossless (it truly is lossless, did a ton of tests with reassembled stream checksums etc)
[03:20] <k_sze[work]> Can H.264 do 8-bit or 16-bit grayscale lossless?
[03:21] <k_sze[work]> I forget how to list codec-specific help using the ffmpeg command line.
[03:23] <k_sze[work]> Or was that only possible with libav's avconv command? I forget.
[03:23] <c_14> ffmpeg -h codec=
[03:24] <ribasushi> k_sze[work]: here are some timings I did just 3 days ago: http://paste.scsys.co.uk/460352
[03:24] <ribasushi> (clearly x265 is a work in progress :)
[03:25] <k_sze[work]> yeah, x265 is clearly not doable in real-time with current cheap hardware.
[03:25] <ribasushi> k_sze[work]: note - these are CPUtimes, not walltimes
[03:26] <k_sze[work]> c_14: strange, it's not doing the right thing.
[03:26] <k_sze[work]> I have ffmpeg 2.5.3
[03:26] <k_sze[work]> `ffmpeg -h codec=libx264` isn't giving me any info about the libx264 codec.
[03:27] <k_sze[work]> I used to be able to see the supported pixel formats on another computer.
[03:27] <c_14> eh, sorry
[03:27] <c_14> -h encoder=
[03:27] <k_sze[work]> ah, right
[03:27] <k_sze[work]> encoder, not codec
[03:28] <k_sze[work]> hmm, no grayscale pixel format for h264
[03:29] <k_sze[work]> What's the difference between the yuv* and yuvj* pixel formats?
[03:29] <k_sze[work]> yuvj* use the full dynamic range of 0-255?
[03:37] <k_sze[work]> And I get "Multple keyframes with same PTS" when remuxing 8-bit grayscale ffv1 avi to nut.
[03:37] <k_sze[work]> Not sure if I should be worried about that.
[03:38] <k_sze[work]> e.g. would that affect seeking?
[03:40] <k_sze[work]> shit
[03:40] <k_sze[work]> so it discarded the frame.
[03:42] <debianuser> c_14 (and maybe ribasushi): SUCCESS! I commented out a few lines in untrunc/track.cpp (diff: http://pastebin.com/qHFVRnD8 ) and got first 50MB of .mp4 file recovered PERFECTLY (perfect enough for mplayer to play it with no video/audio distortions). Now waiting for it to process the whole file...
[03:42] <k_sze[work]> The original AVI was encoded with ffmpeg. Looks like ffmpeg has a bug when remuxing to nut
[03:43] <k_sze[work]> if I remux the avi -> nut -> another nut, ffmpeg still drops a frame on the second remux
[04:01] <k_sze[work]> Actually, it maybe it didn't drop a frame the second time, but it still gave me a warning. Very weird.
[04:05] <debianuser> c_14: Yes, it looks working! So if someone else asks how to repair an incomplete .mp4 file suggest "untrunc", optionally with http://pastebin.com/qHFVRnD8 patch. :) Worked for my h264+aac mp4.
[04:05] <c_14> I'll keep it in mind.
[04:21] <k_sze[work]> when exactly was ffmpeg 1.2 released? I can't seem to find that info on ffmpeg.org
[04:21] <k_sze[work]> march 15, 2013, right?
[04:21] <k_sze[work]> (I wish there's just a release history table somewhere)
[04:24] <relaxed> k_sze[work]: http://git.videolan.org/?p=ffmpeg.git;a=tags  http://git.videolan.org/?p=ffmpeg.git;a=tag;h=a700d997996e94944fed4c440ff8a0b1703bd9fd
[04:25] <k_sze[work]> ok
[07:53] <deasy22> hello all
[07:53] <deasy22> i want to ask about ffmpeg problem
[07:54] <deasy22> i want to make video like this
[07:54] <deasy22> https://www.youtube.com/watch?v=1Jdf_aIFCsE
[07:54] <deasy22> i have a png file name test.png and video file name video1.mp4
[07:55] <deasy22> about ffmpeg pip..
[07:55] <deasy22> what command in ffmpeg to create video pip ?
[07:56] <deasy22> thanks for answer :)
[08:09] <grepper> deasy22: have a look at the -loop_input option
[08:10] <deasy22> greeper
[08:10] <deasy22> i use this command
[08:11] <deasy22> ffmpeg -i video1.mp4 -loop 1 -i test.png -filter_complex "[0:v]scale=-1:624[bgVideo]; [1:v]scale=-1[myFrame]; [1:v][bgVideo]overlay=10:(main_h/2)-(overlay_h/2):shortest=1[myBgOverlay]; [myBgOverlay][myFrame]overlay=main_w-overlay_w-10:(main_h/2)-(overlay_h/2)[video]" -map "[video]" -s:v 1280x720 -map 0:a -codec:a copy output.mkv -y
[08:11] <deasy22> but still eror
[08:12] <deasy22> [mov,mp4,m4a,3gp,3g2,mj2 @ 00000000002ede80] Invalid stream specifier: '[v]'.     Last message repeated 1 times Stream map ''[v]'' matches no streams.
[08:18] <deasy22> i dont know how to resolved that error
[08:21] <grepper> dunno, perhaps it is asking for the output stream number?
[08:22] <k_sze[work]> Weird, I have an H.264 in FLV video.
[08:22] <k_sze[work]> Somehow the first frame decoded does not even start at time 0
[08:22] <k_sze[work]> it starts at 0.067 second.
[08:22] <k_sze[work]> It's a 30fps video.
[08:24] <k_sze[work]> And then there another one where the first frame starts at 0.0 second, but then the next frames are at 0.04, 0.073, 0.107, 0.14, etc.
[08:28] <k_sze[work]> This makes my life really miserable when I want to perform frame accurate seek in different video files.
[08:29] <k_sze[work]> Because there is no guarantee at all about the way the frames are timestamped.
[08:33] <grepper> deasy22: I have used filters to overlay a movie on an image background, but nothing near as complex, I used the 'movie' filter
[08:34] <grepper>  -vf movie=/tmp/todisc-work.0/quick_menu_bg.png [wm];[in][wm] overlay=0:0 [wm2]; [wm2] setdar=4:3 [out]
[08:34] <grepper> I honestly doubt I could be of much help, much of it is voodo to me
[08:35] <deasy22> do you have reference about PIP in ffmpeg?
[08:35] <deasy22> picture in picture
[08:35] <deasy22> link about pip ffmpeg i mean
[08:36] <grepper> I just know of these, which you have probably seen: https://ffmpeg.org/ffmpeg-filters.html  and https://trac.ffmpeg.org/wiki/FilteringGuide
[08:37] <deasy22> thanks greeper
[09:53] <fffan> why some versions of ffplay use packet_temp.size -= result after avcodec_decode_audio4, some versions of ffplay  dosen't ?
[11:39] <JoshX> Goodday :) I'm trying to figure out if the segment filter provides me with some kind of event when a segment is finished?
[11:39] <JoshX> all i can find is someone suggesting it in a forum and some patches that show there _could_ be such a thing :)
[11:39] <JoshX> now the question is how to use it then :)
[12:46] <saste> JoshX, no, there is no such thing as an event callback in segment.c
[12:57] <Diego___> Hello!
[13:10] <Diego___> Hi, does anybody have any experience compiling ffmpeg on centos? Im following this guide http://trac.ffmpeg.org/wiki/CompilationGuide/Centos but when I try to configure libvpx I get this error nasm  -Ox -f elf64 does not support section alignment (nasm <=2.08?) Ive tried updating nasm but the most recent version I can find is 2.07, is it possible to configure it using yasm instead?
[13:11] <durandal_1707> if you have yasm installed, yes.
[13:26] <Diego___> I do have yasm installed, how would I get it to use yasm instead (I have tried searching but couldnt find anything)
[13:27] <durandal_1707> maybe with --yasmexe=EXE
[13:43] <Diego___> thanks for your help durandal, I got it working using as=yasm, I also had to specify the path to yasm because it couldnt find it (PATH=$PATH:/usr/local/bin)
[14:22] <posseeDeestroyah> Hello.
[14:22] <posseeDeestroyah> I have one trouble.
[14:22] <JoshX> I wish i had only 1 problem ;-)
[14:22] <posseeDeestroyah> Me too, yep. That's not my only problem.
[14:23] <posseeDeestroyah> FFmpeg is capturing sound with -f pulse -stream_name record_monitor -i `pactl list sources | awk '/Name:/ && /monitor/ {print $2}'` -f pulse -channels 1 -i default.
[14:23] <posseeDeestroyah> So there is monitor of playback and micro.
[14:23] <posseeDeestroyah> But it captures only playback in 2 streams.
[14:23] <posseeDeestroyah> Is that pulse bug?
[14:24] <BtbN> what?
[14:25] <posseeDeestroyah> FFmpeg captures playback twice instead of capturing playback and micro.
[14:25] <posseeDeestroyah> I dunno what causes it.
[14:27] <BtbN> propably you told it to do so? Or how do you know what default is?
[14:28] <posseeDeestroyah> Yes, default is micro.
[14:28] <posseeDeestroyah> Wait.
[14:28] <posseeDeestroyah> Without 'yes'.
[14:28] <posseeDeestroyah> Just 'default is micro'.
[14:28] <posseeDeestroyah> pactl info | grep 'Default So'
[14:28] <posseeDeestroyah> Default Source: alsa_input.pci-0000_00_1b.0.analog-stereo
[14:31] <posseeDeestroyah> Maybe pulse is too old.
[14:32] <BtbN> Or the ffmpeg pulseaudio source isn't intended to be used more than once
[16:56] <brontosaurusrex> JEEB: http://shrani.si/f/I/RA/2CbHtqm/virtualenginesspeed.png < vmware test .....
[18:02] <ramiro> brontosaurusrex: why are you trying to run video encoding in a virtual environment?
[18:02] <ramiro> ffmpeg runs equally well under linux, mac, and windows
[18:02] <brontosaurusrex> ramiro: vm  is meant to be copy/pasted among macs/windows
[18:03] <ramiro> yes, but why? =)
[18:03] <brontosaurusrex> ffmpeg is just part of the story
[18:03] <ramiro> the performance hit is huge, like you've seen already
[18:05] <brontosaurusrex> i could live with it, if the performance were 5-15 percent slower i guess
[18:05] <brontosaurusrex> but not 400 percent
[18:07] <ramiro> does the rest of the system only run on linux?
[18:08] <brontosaurusrex> ramiro: what do you mean, guest?
[18:08] <ramiro> yes
[18:08] <ramiro> you say ffmpeg is just part of the story. what's the rest like?
[18:08] <brontosaurusrex> no, it could be made into separated windows and osx version
[18:08] <ramiro> because you make it sound like there's no way out of using the vm
[18:09] <brontosaurusrex> there is a way
[18:10] <brontosaurusrex> still surprised by this crapy performnce, i guess waiting for someone to tell me that i need to clicky-clicky this and that and performance will magically improve ;)
[18:11] <ramiro> brontosaurusrex: https://bgrins.github.io/videoconverter.js/
[18:12] <ramiro> (this is just a joke, don't actually try it =)
[18:12] <foonix> brontosaurusrex: maybe you dont have all cpu features/flags or not all cpu/cores assigned to your vm?
[18:13] <brontosaurusrex> foonix: its not a cpu issues, bottleneck is definately io speed
[18:15] <brontosaurusrex> which will be less imortant when encoding to say x264 or even dv
[18:15] <brontosaurusrex> my examples is huge input and huge output
[18:16] <ramiro> are you sure about that? try to encode from a test source and into /dev/null
[18:16] <ramiro> that way you get I/O out of the equation
[18:16] <brontosaurusrex> ramiro: what would be the test.source ?
[18:17] <ramiro> https://trac.ffmpeg.org/wiki/FilteringGuide#TestSource
[18:17] <brontosaurusrex> let me try ...
[18:23] <brontosaurusrex> 53 fps vs 37 fps (but the vm has only half cores), so that makes sense, right?
[18:23] <brontosaurusrex> its IO!
[18:24] <brontosaurusrex> I used: ffmpeg_static -f lavfi -i testsrc=duration=10:size=1280x720:rate=30 -vf yadif=0,scale=1920:1080 -aspect 16:9 -c:v prores -profile:v 3 -pix_fmt yuv422p10le -f mov -y /dev/null
[18:26] <ramiro> try a simpler non-multi-threaded codec
[18:29] <ramiro> or use -threads 1 before /dev/null
[18:29] <brontosaurusrex> why?
[18:30] <ramiro> to have a better comparison in regards to cpu usage
[18:30] <ramiro> oh, you did set your HD to a fixed size in VMWare, right? dynamic disks will take a toll on disk I/O because they have to expand.
[18:32] <brontosaurusrex> ramiro: its reading writing to host shared folder
[18:36] <brontosaurusrex> ok, x264 is 2.25x faster
[18:37] <brontosaurusrex> using ffmpeg -f lavfi -i testsrc=duration=10:size=1920x1080:rate=25 -an -vcodec libx264 -preset slow -tune film -crf 21 -f mp4 -y /dev/null
[19:14] <brontosaurusrex> http://paste.debian.net/plain/143120 < noio tests
[19:25] <nyuszika7h> hi, how can I remove the subtitle track from an mkv file and get it as a separate srt file?
[19:25] <c_14> ffmpeg -i mkv -map 0:s out.srt
[19:25] <nyuszika7h> thanks
[19:26] <c_14> Note, depending on your definition of "remove" it won't actually remove the subtitle track since it'll still be in the mkv.
[19:26] <c_14> If you want an mkv without the subtitle track, `ffmpeg -i mkv -map -0:s -c copy out.mkv'
[19:27] <nyuszika7h> the latter gives "Stream map '0:s' matches no streams."
[19:27] <c_14> You can also combine both commands `ffmpeg -i mkv -map -0:s -c copy out.mkv -map 0:s out.srt'
[19:27] <c_14> But the first command worked?
[19:28] <nyuszika7h> yes
[19:28] <nyuszika7h> there seem to be two subtitle tracks actually (I want the first one, the other one seems to be broken)
[19:28] <c_14> -map 0:s:0 for the ones producing the srt
[19:29] <c_14> And replace the -map -0:s with -map 0:v -map 0:a
[19:30] <nyuszika7h> ok, thanks
[19:30] <nyuszika7h> seems to work
[19:32] <nyuszika7h> yup. my TV is picky about embedded subtitles, it won't let me change the settings like subtitle size
[19:32] <nyuszika7h> it works with a separate srt though
[19:54] Action: c_14 loves TVs
[19:54] <c_14> They're so
[19:54] <c_14> stupid
[20:03] <klaxa> especially "smart" TVs
[20:03] <klaxa> i just plug in a computer and do whatever i want
[20:17] <nyuszika7h> klaxa: yeah, my smart TV has some pretty stupid restrictions in some places
[20:17] <nyuszika7h> like, I can't adjust the volume in the file manager
[20:18] <nyuszika7h> and I can't change some things like the menu language when I'm in the file manager or playing something from an USB device
[20:19] <relaxed> connect pc through hdmi, mpv, ???, profit
[20:20] <nyuszika7h> I'd need a really long HDMI cable - I have a laptop but moving it around is not an option
[20:21] <nyuszika7h> and I don't think I could control the playback with my TV's remote in that case, anyway (pause, rewind, etc.)
[20:22] <nyuszika7h> (also, someone may want to change s/experimental/sid/ in the topic)
[20:22] <relaxed> push keys on the keyboard or use an ir remote
[20:23] Action: relaxed 
[20:23] Action: relaxed 's muscle memory prefers the keyboard
[20:23] <nyuszika7h> my laptop is too far from the TV, not an option
[20:23] <nyuszika7h> also, my TV does have an universal remote feature but does that work with computers?
[20:24] <relaxed> yes
[20:25] <klaxa> i once wrote an android app and a simple rest-service in python to use my phone as a remote
[20:26] <relaxed> nyuszika7h: go to monoprice and buy a super long hdmi cable
[20:26] <nyuszika7h> it would be a PITA to walk past the cable every time I want to enter or exit the room though, so no thanks
[20:29] <relaxed> yeah, that sound brutal
[23:11] <anon-1235623463> Does ffmpeg support PixelCrop in MKV containers? http://matroska.org/technical/specs/index.html
[23:12] <anon-1235623463> ^ The purpose being to take a 1920x1080 video with black bars on the top/bottom or left/right and losslessly crop it at the container level, without re-encoding. the alternative is a lossless-re-encode. I losslessly re-encoded an 11 minute HD video from 16:9 to 4:3 and it went from 2 GB to 11 GB.
[23:13] <klaxa> lossless encodes tend to use up more storage
[23:15] <klaxa> anon-1235623463: maybe try mkvtoolnix see https://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html under 2.8. --cropping
[23:15] <anon-1235623463> Thanks.
[00:00] --- Sat Jan 31 2015


More information about the Ffmpeg-devel-irc mailing list