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

burek burek021 at gmail.com
Fri Mar 1 03:05:02 EET 2019


[01:16:54 CET] <brimestone> Hey guys, I'm doing " ffprobe -I input -show_entries packet=pos,pts_time,flags -select_streams v -of compact=p=0:nk=1 -v 0 " on an hour long footage.. how do can I identify Key frames around specific point in time..  so it doesn't do every single frame?
[01:19:33 CET] <Umori> brimestone: with the -read-intervals option maybe?
[01:20:06 CET] <brimestone> wow.. checking
[01:22:13 CET] <brimestone> Wow, this interval is more complicated that I thought
[01:24:52 CET] <Umori> well, I never used it to be honest...
[01:25:24 CET] <brimestone> :) let me change my question to where I really want to get to.
[01:26:09 CET] <brimestone> I have an hour long ProRes 4444 footage and I want to encode it a 480x270 libx264 using 10 CPU.
[01:27:03 CET] <brimestone> Well, 10 computers. I'm planing to identify where the k frames are split footage across 10 machine and muxed it in the end..
[01:29:43 CET] <Umori> I might sound totally dumb if I am wrong there but isn't ProRes an intraframe codec? What is a keyframe in a ProRes sequence?
[01:31:28 CET] <Umori> couldn't you split the ProRes source in 10 parts equals in length, have each computer do the encoding and then mux it?
[01:32:04 CET] <brimestone> Well, you are correct.. every frame in prores is a key.. which takes almost realtime to identify the k frames.
[01:32:36 CET] <brimestone> I was trying to do what intervals as you suggested.. but documentation is a little outthere.
[01:41:05 CET] <Umori> if it's just the syntax you need help with, basically -read_intervals 1:30%+20 will start the analysis at 1min30s and stop it 20 seconds after
[01:42:14 CET] <Umori> it works if I add it to the command you provided
[01:43:47 CET] <Umori> if you need absolute times, you can just do 1:30%1:50 instead
[03:57:52 CET] <wbarksdale> can anyone explain to me why there is a disparity between AVPacket.size and AVPacket.buffer->size?
[04:01:59 CET] <wbarksdale> While working on some c++ code for remuxing, I was parsing an AVPacket while demuxing, then when remuxing i was passing the data from the source AVPacket.buf and setting AVPacket.size to the buf.size, took me ages to realize that those sizes are different. Was wondering how the muxing context is using the padding? also how does the muxing context know the size of it's data pointer?
[05:25:42 CET] <wfbarksdale> there appears to be a delta of 32 between AVPacket.size and AVPacket.buf->size, Does anybody understand why?
[05:26:02 CET] <wfbarksdale> for every frame
[05:31:53 CET] <pink_mist> a wild guess ... the buffer is only part of the packet; the other parts may be 32bytes large
[05:32:27 CET] <wfbarksdale> seems to be related to the constant AV_INPUT_BUFFER_PADDING_SIZE
[05:32:46 CET] <wfbarksdale> so at least I have a constant I can use to determine that number instead of a magic number
[13:33:53 CET] <emsjessec> is there a good way to launch ffmpeg so that the output filename is date-time?
[13:34:13 CET] <emsjessec> i know it's possible to launch ffmpeg from PHP or Java
[13:35:15 CET] <ln-> is this question specific to ffmpeg at all?
[13:36:46 CET] <emsjessec> possibly, can ffmpeg automatically set output filename to a timestamp?
[13:37:45 CET] <BtbN> Your shell can
[13:38:10 CET] <BtbN> And for special cases like the segment muxer ffmpeg can do it by itself.
[14:16:43 CET] <Blacker47> emsjessec, with bash shell you can use something like "ffmpeg [...] out_$(date --iso-8601=seconds).mkv"
[14:20:44 CET] <tytan> hey guys, I am currently trying to get rid of DRM from a movie bought on iTunes for a friend but I struggle to do so. Do you know how to do it with ffmpeg? If not, do you know a service at which you can buy DRM free movies?
[14:29:15 CET] <BtbN> no, and no. It's not legal and nobody here will recommend anything like that to you.
[14:30:03 CET] <tytan> buying movies is illegal? didn't know that, sorry
[14:31:58 CET] <tytan> anyway, have a nice day everyone
[14:33:06 CET] <durandal_1707> BtbN: what? you did not wanted to help poor fellow? how rude
[14:43:20 CET] <richar_d> it's not illegal to remove DRM in all countries
[14:45:33 CET] <pink_mist> indeed not, but #ffmpeg isn't the right place for it
[14:54:24 CET] <iive> if it was for him, it might have been legal, but he said it is for a friend.
[14:55:13 CET] <pink_mist> that is also not illegal in all countries
[14:56:49 CET] <xantoz> removing DRM is legal in most of the civilized world
[14:57:24 CET] <iive> if you have obtained it legally.
[14:57:30 CET] <iive> he is not even the owner.
[14:57:31 CET] <pink_mist> he had.
[14:57:37 CET] <pink_mist> he bought it on iTunes
[14:58:59 CET] <pink_mist> and gifting things you own to friends is legal in ... well, I've never heard of anywhere where it's illegal except if it's movies in the US
[14:59:53 CET] <BtbN> You don't technically own movies you bought on iTunes
[15:00:04 CET] <BtbN> You own a license to watch it, which is non-transferrable.
[15:00:09 CET] <pink_mist> depends on the laws in your country
[15:01:10 CET] <iive> if it is linked to account, then it is not transferable.
[15:03:25 CET] <richar_d> companies can invent any kind of quasi-legal, "you don't own anything you buy" nonsense they want, but whether they'll be laughed out of court is another matter entirely
[15:04:19 CET] <iive> the thing is that you don't buy it, even if they say you do.
[15:04:33 CET] <iive> it's like subscription for netflix.
[15:04:39 CET] <pink_mist> iive: that really does depend on the laws in your country
[15:04:45 CET] <iive> it's a scam, but so far nobody have gone to court for it.
[15:04:45 CET] <pink_mist> netflix is different, granted
[15:04:51 CET] <pink_mist> but itunes is not
[15:04:53 CET] <richar_d> money has exchanged hands. people don't give away money and expect nothing in return
[15:05:06 CET] <richar_d> therefore the customer must have acquired something tangible
[15:05:33 CET] <BtbN> They required a license to watch the movie as long as apple feels like it
[15:05:36 CET] <BtbN> *aquired
[15:06:05 CET] <pink_mist> again, how true that is depends on the laws in your country
[15:17:56 CET] <CoreX> is this even worth talking about considering people come in here from time to time asking about remuxing pirated stuff
[15:18:16 CET] <furq> it's not worth talking about because ffmpeg can't do it anyway
[15:18:40 CET] <CoreX> exactly
[15:19:14 CET] <richar_d> it was pointed out because someone who joined the channel was falsely accused of doing something illegal
[17:17:18 CET] <brimestone> Anyone knows of an ffmpeg distributed setup?
[17:23:43 CET] <kepstin> brimestone: not sure exactly what you mean by "distributed"
[17:24:19 CET] <kepstin> I've definitely heard of people distributing video encoding work by cutting video into segments, encoding each one separately, then combining them later, if that counts.
[17:24:55 CET] <kepstin> nothing builtin to ffmpeg, but that's not conceptually complicated to build with a queue and some scripting.
[17:31:07 CET] <brimestone> thanks, I building something like that.. I know ffmpeg can do -ss to mark and in and out - should I let ffmpeg do that or, split the file into segments then feed to ffmpeg?
[17:38:01 CET] <DHE> segments might be best to ensure there's neither overlap nor missed segments
[17:53:03 CET] <olavx200> hello, is it possible to convert bluray movies in the BDMV folderstructure to mkv
[17:53:06 CET] <olavx200> with ffmpeg
[20:13:20 CET] <richar_d> is there a difference between `-x264-params ref=4` and `-refs 4` when encoding with libx264?
[20:15:27 CET] <goldbox> hi all
[20:16:14 CET] <goldbox> why the support of ffmpeg on win7 is so terrible?
[20:16:22 CET] <ChocolateArmpits> richar_d, nope
[20:16:47 CET] <richar_d> ChocolateArmpits, thanks
[20:16:48 CET] <goldbox> ChocolateArmpits it's very bad:(
[20:17:21 CET] <JEEB> richar_d: x264-params passes options straight into libx264 and takes in key=val:key=val pairs according to libx264's spec
[20:17:29 CET] <goldbox> ffmpeg -list_devices true -f dshow -i dummy failed
[20:17:31 CET] <JEEB> -refs X sets the FFmpeg global reference frame count option
[20:17:34 CET] <goldbox> https://pastebin.ubuntu.com/p/GsY9yrxkXP/
[20:17:57 CET] <JEEB> richar_d: so the difference is "is the option set the FFmpeg way or are you using some x264 specific thing"
[20:18:04 CET] <ChocolateArmpits> goldbox, what devices are you searching for in particular?
[20:18:37 CET] <ChocolateArmpits> goldbox, also what is the source of your binary
[20:18:40 CET] <goldbox> ChocolateArmpits want to list all devices, especially audio device
[20:19:07 CET] <goldbox> ChocolateArmpits i download the binary from https://ffmpeg.zeranoe.com/builds/
[20:19:14 CET] <ChocolateArmpits> goldbox, are you sure those devices are available via directshow? Do you see them, for instance in Audacity or other applications that support directshow input?
[20:19:59 CET] <ChocolateArmpits> You can also use GraphEdit to see if those devices are actually available to directshow
[20:20:01 CET] <goldbox> ChocolateArmpits i can listen music on my win7 pc, so i think there is audio device
[20:20:09 CET] <ChocolateArmpits> That's not enough
[20:20:32 CET] <ChocolateArmpits> And what do you mean listen to music? Do you mean audio playback?
[20:20:40 CET] <JEEB> well you're specifically asking "can you please list me my directshow input devices"
[20:20:49 CET] <JEEB> or whatever the directshow module looks for
[20:20:54 CET] <goldbox> ChocolateArmpits i don't care about video device currently, so is there any way to list audio devices on my windows system?
[20:21:20 CET] <goldbox> ChocolateArmpits i wanna record the sound of speaker using ffmpeg command
[20:21:28 CET] <ChocolateArmpits> goldbox, do you understand that you are trying to list directshow devices specifically?
[20:21:54 CET] <goldbox> ChocolateArmpits i mean there is audio device on my windows system and it works well
[20:22:10 CET] <ChocolateArmpits> That doesn't mean it's available to directshow
[20:22:11 CET] <JEEB> probably not, but at least he has now said that he doesn't care if it's dshow or not
[20:22:19 CET] <ChocolateArmpits> yes probably
[20:22:38 CET] <JEEB> goldbox: you're basically asking FFMpeg's *DirectShow* *input* module if it can find anything it can get input from
[20:22:45 CET] <JEEB> which is a very specific Windows subsystem
[20:23:00 CET] <JEEB> so not surprising if you can't find much if you don't have DShow filters for that installed
[20:23:21 CET] <JEEB> for windows audio recording I'm not sure what the best module is, or if we have a nice one outside of dshow at all
[20:23:28 CET] Action: JEEB still has his development VM booting
[20:23:40 CET] <ChocolateArmpits> goldbox, try this one https://superuser.com/a/1262934
[20:24:00 CET] <goldbox> JEEB i think directshow is video related, but i only care about the audio
[20:24:18 CET] <ChocolateArmpits> then see if the stereo mix device appears in the dshow list ffmpeg outputs
[20:24:22 CET] <JEEB> goldbox: directshow is both video and audio
[20:24:34 CET] <JEEB> you just need to have a filter that gives you input enabled
[20:24:34 CET] <ChocolateArmpits> the change has to be made in the recording tab of the sound menu
[20:24:44 CET] <JEEB> and available through directshow
[20:28:45 CET] <goldbox> ChocolateArmpits seems i have to enable Stereo Mix device, why?
[20:29:05 CET] <JEEB> because that provides an audio input through directshow, maybe?
[20:29:07 CET] <ChocolateArmpits> Because it enables the stereo loop back for directshow
[20:29:32 CET] <ChocolateArmpits> It's the most straightforward way by the looks of it
[20:29:43 CET] <JEEB> if there are any better audio recording APIs for Windows feel free to look into it and request it as a feature on the trac
[20:29:54 CET] <JEEB> then maybe someone will have the free time and interest to code it
[20:33:27 CET] <goldbox> ChocolateArmpits this is command to capture audio  ffmpeg -f alsa -i hw:1 -t 30 out.wav
[20:33:34 CET] <goldbox> ChocolateArmpits https://trac.ffmpeg.org/wiki/Capture/ALSA
[20:34:25 CET] <JEEB> that's alsa yes, for linux. the difference is that alsa is a module that talks with audio devices specifically and DShow is a media framework on top of windows
[20:34:36 CET] <JEEB> so nobody has done a generic audio API input to Windows
[20:34:43 CET] <JEEB> feel free to find out what the required API for that is
[20:34:54 CET] <JEEB> and either find someone who wants to do something like that, or sponsor a feature
[20:35:13 CET] <ChocolateArmpits> goldbox, just follow the procedure to enable stereo mix and use that
[20:35:35 CET] <ChocolateArmpits> I don't think you will find anything other and just works without making adjustments to your system settings
[20:35:40 CET] <ChocolateArmpits> that just works**
[20:36:13 CET] <JEEB> if you want that as your input
[20:36:18 CET] <JEEB> as opposed to some microphone
[20:37:23 CET] <ChocolateArmpits> Well he said listen to music so I assume he meant system sounds
[20:38:13 CET] <goldbox> ChocolateArmpits failed with ffmpeg -f aac -i "DirectShow audio devices" -t 30 out.wav
[20:38:21 CET] <goldbox> ChocolateArmpits https://pastebin.ubuntu.com/p/h4B4PmsvRf/
[20:38:40 CET] <ChocolateArmpits> goldbox, have you enabled stereo mix?
[20:38:55 CET] <JEEB> use the UUID as input name
[20:38:56 CET] <goldbox> ChocolateArmpits yes,
[20:39:01 CET] <JEEB> the "alternative name"
[20:39:18 CET] <ChocolateArmpits> goldbox, what's the list_devices output now?
[20:39:21 CET] <JEEB> oh no, that's even longer
[20:39:25 CET] <ChocolateArmpits> oh it's there
[20:39:27 CET] <JEEB> ok, then just the name of the device :P
[20:39:35 CET] <JEEB> with the chinese symbols since they're part of the name
[20:39:38 CET] <JEEB> unfortunately
[20:39:54 CET] <ChocolateArmpits> they would come out as question marks in cmd
[20:40:04 CET] <ChocolateArmpits> not sure if the encoding would get preserved
[20:40:25 CET] <JEEB> at least ffmpeg.c should use wide char input and convert it to UTF-8 for internals, and then back for printing
[20:40:33 CET] <JEEB> (and the module probably does something as well)
[20:41:55 CET] <ChocolateArmpits> goldbox, your command isn't formatted correctly
[20:42:58 CET] <ChocolateArmpits> first, your input device format is dshow, so you must use -f dshow rather than -f aac. Secondly your device name is "Ô)‹¹H)Ê?(Realtek High Definition ", so you must use -i audio="Ô)‹¹H)Ê?(Realtek High Definition ". I don't know if those characters were pasted correctly
[20:43:45 CET] <ChocolateArmpits> next you need to find input format settings via "-list_options true" input setting
[20:43:59 CET] <ChocolateArmpits> then mimic the input options found there in your input settings
[20:45:51 CET] <goldbox> ChocolateArmpits failed with dshow
[20:46:37 CET] <ChocolateArmpits> goldbox, see if this works https://pastebin.com/raw/NfTmA0QB
[20:47:05 CET] <ChocolateArmpits> you may have to change sample rate from 44100 to 48000
[20:49:32 CET] <goldbox> ChocolateArmpits failed:( https://pastebin.ubuntu.com/p/z7Nvt8jW6D/
[20:50:06 CET] <ChocolateArmpits> ok you need to correct the device name
[20:50:34 CET] <ChocolateArmpits> because your paste with the list devices probably missed a character or misconverted something
[20:51:46 CET] <illuminated> I have not seen an example of this happening in any of the files I've ever analyzed, but is it possible to have a video with more than 1 video stream?
[20:52:17 CET] <JEEB> yes
[20:52:47 CET] <illuminated> ok thanks
[20:52:49 CET] <JEEB> I have plenty of broadcast streams that have one video that comprises of the video delivered over 12/13 of broadcast segments, and then you have an alternative "mobile" stream next to it
[20:53:13 CET] <JEEB> when you receive all 13 segments you get the full shebang with both the mobile and non-mobile program
[20:53:33 CET] <illuminated> hmm interesting
[20:57:36 CET] <goldbox> ChocolateArmpits is there any other way to specify input device? i tried many strings, all failed
[20:59:44 CET] <ChocolateArmpits> goldbox, did you try copying the name in the list_devices output directly from the cmd window?
[21:00:03 CET] <ChocolateArmpits> or pipe the output to a text file and then copy it from there?
[21:00:58 CET] <ChocolateArmpits> I've only ever used devices with latin chars and had no problems but this situation is different it seems
[21:01:25 CET] <goldbox> ChocolateArmpits yes, but the name has some string characters, failed, i try to replace it with name shown in windows gui, also failed
[21:01:51 CET] <JEEB> that sucks. does just the UUID work by chance?
[21:01:54 CET] <Tiwanaku> Hi devs, i am an rpi user and need some advice.I have a memory fault on openmw and one of open morrowind devs said than for him, reading the log, its probably related to libswscale. for me its just a warning, but him know more than I. I compiled the latest and install the latest ffmpeg release and the problem remains. the dev tell me than libswscal
[21:01:55 CET] <Tiwanaku> e its calling the crash handler. I could share the log if you could take a look on it.
[21:02:26 CET] <JEEB> Tiwanaku: most devs are not here because doing user support requires you to be a masochist
[21:02:39 CET] <JEEB> you might want to post your issue on the trac issue tracker
[21:03:01 CET] <JEEB> esp. if you can post a nice stack trace
[21:03:10 CET] <Tiwanaku> ok, keep on your masochist task hahahahaha bye!
[21:04:16 CET] <ChocolateArmpits> goldbox, could you try running the command in powershell rather than cmd and then copy the output?
[21:04:29 CET] <ChocolateArmpits> the output name that is
[21:04:35 CET] <ChocolateArmpits> for list_devices
[21:08:05 CET] <goldbox> ChocolateArmpits with the same error
[21:13:17 CET] <goldbox> ChocolateArmpits ffmpeg is powerful, but not friend to record audio as a command line tool
[21:14:24 CET] <JEEB> sounds like text coding conversion is going funky somewhere
[21:14:25 CET] <ChocolateArmpits> I would probably try copying the name from GraphEdit in this case
[21:14:27 CET] <JEEB> try filing a bug
[21:14:42 CET] <JEEB> although the bug is probably unlikely to be replicated outside of chinese language system or so :/
[21:15:06 CET] <JEEB> or well, any unicode kind of thing where the name has characters that can' tbe converted
[21:15:16 CET] <JEEB> goldbox: did you check if just the UUID of the filter is enough?
[21:25:59 CET] <goldbox> ChocolateArmpits are u familiar with ffmpeg code?
[21:26:20 CET] <ChocolateArmpits> goldbox, I only know cli parameters
[21:26:48 CET] <reinier12> anyone online?
[21:26:54 CET] <goldbox> ChocolateArmpits there are lot's of parameters, haha
[21:27:19 CET] <reinier12> Quick question if I may
[21:27:33 CET] <reinier12> I want to output variable frame rate video. I have RGB frames sitting in memory as well as PTS. How can I pipe both of them to Ffmpeg, so that a variable frame rate mp4 comes out?
[21:27:36 CET] <ChocolateArmpits> there was only one time I had to alter the source but that was to have the decklink input act differently to account for bugs in the decklink drivers the card itself
[21:28:27 CET] <JEEB> reinier12: -vsync passthrough -copyts if you are using ffmpeg.c
[21:29:37 CET] <reinier12> thanks. How do I supply pts in this case? there is no input demuxing because I have the raw rgb frames in memory already.
[21:30:04 CET] <JEEB> reinier12: you'll have to present ffmpeg.c the video in some container
[21:30:12 CET] <JEEB> if it's VFR you probably want something like NUT
[21:30:24 CET] <JEEB> or use the API :P
[21:30:33 CET] <reinier12> Gotcha
[21:31:41 CET] <reinier12> the trick is then to put my input frames in a container that uses my pts in muxing, then transcode to whatever format
[21:32:10 CET] <JEEB> yes, for ffmpeg.c
[21:32:23 CET] <JEEB> with the API you can just generate AVFrames with the correct PTS
[21:32:29 CET] <JEEB> and have your raw video buffers connected to that
[21:35:35 CET] <reinier12> cool thanks
[22:25:56 CET] <mantaalex> i have a question i'm using motion snapshot jpg's of my camera system to make a .mp4 file
[22:26:24 CET] <mantaalex> all jpg's are stored in a directory and when i make the movie with this command:
[22:26:29 CET] <mantaalex> ffmpeg -r 0.5 -pattern_type glob -i '/home/myuser/mydir/*.jpg' -c:v libx264 /home/mydir/myfile_`date +%Y%m%d-%H%M`.mp4
[22:26:51 CET] <mantaalex> it works but some pictures are not on the right time i guess it has something to do with the file names
[22:27:06 CET] <mantaalex> but can't ffmpeg not take them from old to new (as file age)
[22:28:12 CET] <mantaalex> my motion software that makes that snapshots has this settings for file name: picture_filename CAM5_%v-%Y%m%d%H%M%S-%q
[22:29:00 CET] <mantaalex> CAM5_266-20190228213054-05.jpg as example jpg file
[22:29:24 CET] <mantaalex> but i guess if the numbers are in incorrect sorting i could have wrong jpg's on the wrong timings
[22:29:36 CET] <mantaalex> anyone has a solution? many thanks
[22:32:39 CET] <mantaalex> and if someone has an idea how to add jpg frames after the .mp4 (so i can make a cronjob every hour that could add more jpg's to the mp4 so i have 1 file for every cam every day
[22:32:53 CET] <mantaalex> so its easyer to look if i have motion that day :) thanks on advance sorry for spamming
[22:35:52 CET] <iive> mantaalex, usually ffmpeg prefers .jpg to be numbered in sequential older.
[22:36:13 CET] <mantaalex> hm
[22:36:23 CET] <iive> i'm not familiar with image2 input, does it support filelist?
[22:36:32 CET] <mantaalex> i really don't know ;)
[22:36:39 CET] <mantaalex> thanks for answearing btw
[22:37:04 CET] <furq> it doesn't accept a list
[22:37:10 CET] <mantaalex> after the build of the mp4 i remove the jpg' files so i get newer every day i don't know if i get new or the same numbers
[22:37:34 CET] <mantaalex> CAM5_%v-%Y%m%d%H%M%S-%q
[22:37:37 CET] <furq> you could probably script something that renames all the files sequentially in the order of ls -1t
[22:37:41 CET] <mantaalex> is the name of the jpg files now
[22:37:52 CET] <furq> or symlinks them somewhere in that order
[22:38:07 CET] <furq> that's the simplest thing i can think of
[22:38:08 CET] <mantaalex> hm ok will look for that
[22:38:31 CET] <mantaalex> and another thing is it possible to add more frames to a mp4 file
[22:38:56 CET] <mantaalex> so for example i make cronjob every hour (if every hour has motion) i should add every hour jpg's to the same mp4 file
[22:39:08 CET] <iive> check the `man ffmpeg-formats` the image2 is there. no file lists :(
[22:39:14 CET] <mantaalex> so the first frames of the movie should be the oldest and the newest latest ;)
[22:39:18 CET] <furq> IFS=$'\n'; i=0; for f in $(ls -1t); do i=$((i+1)); ln -s "$f" out/$i.jpg; done
[22:39:20 CET] <furq> something like that
[22:39:25 CET] <furq> ls -1tr if you want them in reverse order
[22:40:24 CET] <mantaalex> i have made a script to make the movies starting with the ffmpeg line
[22:40:47 CET] <mantaalex> than it does rm -rf /mydir/*.jpg
[22:41:22 CET] <furq> you can't add frames but you can concat two mp4s together
[22:41:24 CET] <mantaalex> so i need to place something before the ffmpeg line
[22:41:33 CET] <mantaalex> oh ok
[22:41:35 CET] <furq> since you're encoding them then you know they use the exact same encoder settings etc
[22:41:39 CET] <furq> so that should all work fine
[22:41:59 CET] <mantaalex> thanks
[22:42:14 CET] <mantaalex> IFS=$'\n'; i=0; for f in $(ls -1t); do i=$((i+1)); ln -s "$f" out/$i.jpg; done
[22:42:28 CET] <mantaalex> before that line i think i must do cd /mydirofimages first ?
[22:42:38 CET] <mantaalex> for the script i mean
[22:42:38 CET] <furq> yeah
[22:42:43 CET] <furq> or just run the script from there
[22:43:12 CET] <mantaalex> i don't understand the out/
[22:43:16 CET] <mantaalex> do i have to change that?
[22:43:30 CET] <furq> you'd need to create that directory before running it
[22:44:34 CET] <mantaalex> ok
[22:46:32 CET] <furq> oh whoops
[22:46:33 CET] <mantaalex> i tryed it i saved the ls -l before and after gonne look if the order is correct :)
[22:46:41 CET] <furq> IFS=$'\n'; i=0; for f in $(ls -1t *.jpg); do i=$((i+1)); ln -s "$f" out/$i.jpg; done
[22:46:46 CET] <furq> otherwise it'll create a link for out/
[22:46:51 CET] <mantaalex> yeah i seen this :)
[22:47:42 CET] <mantaalex> np
[22:48:54 CET] <mantaalex> i did not tryed your last command i just looking at the one with the symlink
[22:49:01 CET] <mantaalex> but i think the order is wrong
[22:49:06 CET] <mantaalex>  3 Feb 28 22:45 1.jpg -> out
[22:49:36 CET] <mantaalex> but when i look at 2.jpg than i see its the latest added jpg (so  the newest)
[22:49:39 CET] <furq> use ls -1tr if the order is backwards
[22:50:20 CET] <mantaalex> IFS=$'\n'; i=0; for f in $(ls -1tr *.jpg); do i=$((i+1)); ln -s "$f" out/$i.jpg; done
[22:50:27 CET] <mantaalex> should be correct than i guess
[22:50:46 CET] <mantaalex> sorry for the noob questions i'm new at this all ;)
[22:53:47 CET] <mantaalex> i think it will not work
[22:53:52 CET] <mantaalex> maybe stupid of me
[22:54:17 CET] <mantaalex> when i look at the list before i see 6 jpg's saved on the same time Feb 28 18:51
[22:54:33 CET] <mantaalex> but ls -l showing it correct order i think ;)
[22:54:53 CET] <mantaalex> but 1.jpg is the first 2.jpg is the 5 jpg used from original list
[22:55:23 CET] <mantaalex> i hope you understand what i mean :)
[22:56:37 CET] <mantaalex> maybe an idea can't i just change the line that creates the jpg to an other format that could work ?
[22:57:03 CET] <mantaalex> picture_filename CAM5_%v-%Y%m%d%H%M%S-%q | that makes -> CAM5_229-20190228185113-05.jpg
[22:57:58 CET] <furq> if you can do that then that makes more sense
[22:58:13 CET] <furq> also if ls -l shows the correct order then ls -1 should be in the same order
[22:58:16 CET] <mantaalex> i can change the line but i'm bad at that coding part :)
[22:58:20 CET] <furq> you mentioned modified date so i figured you wanted -t as well
[22:58:42 CET] <mantaalex> yeah sorry i maybe explained it worng ;)
[22:58:44 CET] <mantaalex> wrong
[22:59:00 CET] <furq> a glob would normally be in the same order as ls though
[22:59:05 CET] <furq> so idk why that wouldn't work
[22:59:41 CET] <mantaalex> i have this setup raspberry pi with motion makes that jpg files scp to | big server this is where i making the ffmpeg
[23:00:03 CET] <mantaalex> the raspberry deletes jpg files locally after the scp
[23:00:17 CET] <mantaalex> so i may have all the same starting numbers in jpg if i don't look out :)
[23:01:18 CET] <mantaalex> ls -1 has the same result as creating time on the big server
[23:04:22 CET] <furq> ls usually only has second precision iirc
[23:04:31 CET] <furq> so if you're copying the files then the ordering is going to get screwed up
[23:04:49 CET] <furq> you'd probably just need to figure out a way to put the filenames in order in the first place
[23:04:59 CET] <mantaalex> yeah i guess so
[23:07:47 CET] <furq> you could potentially create an mjpeg stream on the pi and scp that across
[23:08:03 CET] <furq> ffmpeg -i %d.jpg -c:v copy out.mkv
[23:08:16 CET] <furq> then encode that on the real server
[23:09:46 CET] <mantaalex> i'm looking in the logs of motion to see the Real order
[23:10:13 CET] <mantaalex> but it looks like its the same order as 'ls -l'
[23:10:18 CET] <mantaalex> on the big server
[23:14:14 CET] <another> mantaalex: %v is the event number. so the files should already be in order
[23:15:09 CET] <mantaalex> hm true i overseen this
[23:15:26 CET] <another> however, i'm not sure if it gets reset on restart
[23:16:33 CET] <mantaalex> but when the .mp4 is created and i watch for example if i have snaps of 7am and 3pm (just giving example) it shows from 2pm till 7pm but after a while it uses snaps from 7am and 3pm all together
[23:16:37 CET] <mantaalex> its strange
[23:17:08 CET] <mantaalex> most jpg's are on position but some times it jumps back hours ago and then back on the right hour :)
[23:17:26 CET] <mantaalex> i think if restart it resets
[23:18:41 CET] <mantaalex> another: using motion software to ?
[23:19:40 CET] <another> i used to. haven't used it for quite a while
[23:19:46 CET] <mantaalex> oh ok
[23:20:31 CET] <mantaalex> https://www.lavrsen.dk/foswiki/bin/view/Motion/ConfigOptionFfmpegTimelapse
[23:20:44 CET] <mantaalex> maybe this is something i could make a work around?
[23:21:12 CET] <mantaalex> my motion software is at first sending me a mail with a snapshot
[23:21:20 CET] <mantaalex> so i want this mp4 as second option
[23:22:52 CET] <mantaalex> but thanks guys many times for helping me
[23:25:03 CET] <another> mantaalex: what version are you using?
[23:25:13 CET] <another> motion version
[23:25:23 CET] <mantaalex> sec
[23:25:36 CET] <mantaalex> motion Version 4.2.1
[23:26:11 CET] <another> because then you should look at the new documentation: https://motion-project.github.io/motion_config.html#picture_filename
[23:26:42 CET] <mantaalex> hm
[23:26:43 CET] <another> a lot of the config options got better names
[23:27:22 CET] <mantaalex> oh ok
[23:27:27 CET] <mantaalex> so new is Default: %v-%Y%m%d%H%M%S-%q
[23:27:47 CET] <mantaalex> and i have this set:
[23:27:48 CET] <mantaalex> picture_filename CAM5_%v-%Y%m%d%H%M%S-%q
[23:28:58 CET] <mantaalex> i don't know if cam5_ has something to do with the order it has the same cam5 names all the jpg's to keep the order on the camera's
[23:29:58 CET] <another> your problem is probably that the event counter %v got reset
[23:30:11 CET] <another> i suggest something like this: picture_filename CAM5_%Y-%m-%d_%H%M%S_%v-%q
[23:30:34 CET] <mantaalex> hm ok
[23:31:22 CET] <mantaalex> tx
[23:32:04 CET] <mantaalex> when i look at my mailbox i see it starting around cam5_100 and ends on cam5_268
[23:32:34 CET] <mantaalex> 208 mails in total
[23:32:39 CET] <mantaalex> maybe not the reset problem?
[23:32:47 CET] <mantaalex> but i know if i restart motion i will have other numbers
[23:32:59 CET] <mantaalex> or even pauze motion
[23:33:09 CET] <mantaalex> so your suggestion could zork
[23:33:11 CET] <mantaalex> work
[23:34:47 CET] <mantaalex> i ## my old line and added your new gonne try again tomorrow if the order is ok now
[23:35:00 CET] <another> good luck
[23:35:05 CET] <mantaalex> thanks
[23:35:30 CET] <mantaalex> thanks for the support all
[23:36:18 CET] <mantaalex> will try again with the same line
[23:36:20 CET] <mantaalex> ffmpeg -r 0.5 -pattern_type glob -i '/home/myuser/mydir/*.jpg' -c:v libx264 /home/mydir/myfile_`date +%Y%m%d-%H%M`.mp4
[23:36:26 CET] <mantaalex> and see if it works :)
[23:36:40 CET] <mantaalex> i will let you know maybe you need it for you later
[23:37:19 CET] <ricemuffinball> i have a video file that was separated into 2,  how do i join them back together into one file?
[23:38:21 CET] <mantaalex> another: CAM5_229-20190228185113-05.jpg was the old filename new -> CAM5_2019-02-28_233724_01-07.jpg
[23:38:27 CET] <mantaalex> guess its ok for that new name
[23:41:45 CET] <mantaalex> from old to new CAM5_2019-02-28_233724_01-07.jpg CAM5_2019-02-28_233936_02-06.jpg CAM5_2019-02-28_233937_03-07.jpg CAM5_2019-02-28_233939_04-06.jpg CAM5_2019-02-28_233941_05-00.jpg
[23:42:20 CET] <another> ricemuffinball: have you looked at https://ffmpeg.org/faq.html#How-can-I-concatenate-video-files_003f and https://trac.ffmpeg.org/wiki/Concatenate ?
[23:42:32 CET] <ricemuffinball> yes
[23:42:34 CET] <mantaalex> will see tomorrow how it goes on way more motions ;)
[23:42:46 CET] <ricemuffinball> another yes  they create corrupted file
[23:43:18 CET] <another> could you run an ffprobe on them?
[23:43:32 CET] <ricemuffinball> how do i do that
[23:44:05 CET] <ricemuffinball> right i have  1.mp4  2.mp4  3.mp4
[23:44:10 CET] <ricemuffinball> 3 being combined file
[23:44:27 CET] <another> ffprobe 1.mp4
[23:44:49 CET] <another> and also: ffprobe 2.mp4
[23:45:54 CET] <ricemuffinball> https://pastebin.com/AwvLTvWc
[23:46:09 CET] <ricemuffinball> 3.mp4 = corrupted file
[23:48:06 CET] <ricemuffinball> if 1.mp4 = 30 min  and  2.mp4 50 min   3.mp4  plays  fine until 30 min and shows garbage video at 31 min
[23:50:13 CET] <another> what command did you use to create 3.mp4?
[23:50:55 CET] <ricemuffinball> ffmpeg -safe 0 -f concat -i list.txt -c copy output.mp4
[23:51:06 CET] <ricemuffinball> ffmpeg -safe 0 -f concat -i list.txt -c copy 3.mp4
[23:51:49 CET] <ricemuffinball> (echo file '1.mp4' & echo file '2.mp4' )>list.txt
[23:53:15 CET] <another> hmm
[23:53:25 CET] <another> looks about right
[23:53:40 CET] <ricemuffinball> audio of 3.mp4 is fine
[23:53:52 CET] <ricemuffinball> just video shows garbage @ 31 min
[23:53:58 CET] <another> you could try with the concat protocol https://trac.ffmpeg.org/wiki/Concatenate#protocol
[23:54:15 CET] <another> like in the section "Using intermediate files"
[23:54:40 CET] <ricemuffinball> is that reencoding method?
[23:55:36 CET] <another> no
[23:55:57 CET] <ricemuffinball> okay let me try
[23:56:48 CET] <another> just putting it into a TS container
[23:57:52 CET] <ricemuffinball> ffmpeg -i input1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
[23:58:00 CET] <ricemuffinball> is that just converting mp4 to ts container
[00:00:00 CET] --- Fri Mar  1 2019


More information about the Ffmpeg-devel-irc mailing list