Re: [FFmpeg-user] encoding video from png diffs
I'm not really sure why, but I got it to work with the following cmd... Thanks for your patience! ./shm | ffmpeg -f rawvideo -pixel_format bgr32 -video_size 1274x541 -framerate 30 -i - out.mp4 On Sat, 3 Sep 2016, Joshua Grauman wrote: Sorry for another question, but I'm having a hard time figuring out why this doesn't work. I've written a program to output raw image data (32-bit rgba), frame after frame. I'm trying a test to encode it to mp4, but this command says: ./shm | ffmpeg -f image2 -r 30 -s 1274x541 -pix_fmt rgb32 -vcodec rawvideo -i - out.mp4 Could find no file with path 'pipe:' and index in the range 0-4 pipe:: No such file or directory What am I doing wrong? Thanks! Josh On Fri, 2 Sep 2016, Joshua Grauman wrote: I've been looking for a way to screencast an app with alpha, but I haven't found one yet (but if someone knows of one, I'd love it). So I'm working on modifying my app to generate png's at 30 frames per second. Josh > 2016-09-02 7:29 GMT+02:00 Joshua Grauman: > > I have another different, but related question. What format would you > > suggest for storing my screencast in? The resulting video is going to > > be > > 1080p30 and it needs to have an alpha channel > > Which screencast technology allows to record an alpha channel? > mpng should be best for screencasts, some people like utvideo. > > Carl Eugen > ___ > ffmpeg-user mailing list > ffmpeg-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-user > > To unsubscribe, visit link above, or email > ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
Sorry for another question, but I'm having a hard time figuring out why this doesn't work. I've written a program to output raw image data (32-bit rgba), frame after frame. I'm trying a test to encode it to mp4, but this command says: ./shm | ffmpeg -f image2 -r 30 -s 1274x541 -pix_fmt rgb32 -vcodec rawvideo -i - out.mp4 Could find no file with path 'pipe:' and index in the range 0-4 pipe:: No such file or directory What am I doing wrong? Thanks! Josh On Fri, 2 Sep 2016, Joshua Grauman wrote: I've been looking for a way to screencast an app with alpha, but I haven't found one yet (but if someone knows of one, I'd love it). So I'm working on modifying my app to generate png's at 30 frames per second. Josh 2016-09-02 7:29 GMT+02:00 Joshua Grauman: > I have another different, but related question. What format would you > suggest for storing my screencast in? The resulting video is going to be > 1080p30 and it needs to have an alpha channel Which screencast technology allows to record an alpha channel? mpng should be best for screencasts, some people like utvideo. Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
I've been looking for a way to screencast an app with alpha, but I haven't found one yet (but if someone knows of one, I'd love it). So I'm working on modifying my app to generate png's at 30 frames per second. Josh 2016-09-02 7:29 GMT+02:00 Joshua Grauman: I have another different, but related question. What format would you suggest for storing my screencast in? The resulting video is going to be 1080p30 and it needs to have an alpha channel Which screencast technology allows to record an alpha channel? mpng should be best for screencasts, some people like utvideo. Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
> > > > I have another different, but related question. What format would you > suggest for storing my screencast in? The resulting video is going to be > 1080p30 and it needs to have an alpha channel (the input png's will use the > alpha channel). The screencast is going to be overlaid at a later time > (with ffmpeg) onto another 1080p30 avchd video from my canon camera. > In order to overlay one video on top of another you don't need anything related to an alpha channel. ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
2016-09-02 7:29 GMT+02:00 Joshua Grauman: > I have another different, but related question. What format would you > suggest for storing my screencast in? The resulting video is going to be > 1080p30 and it needs to have an alpha channel Which screencast technology allows to record an alpha channel? mpng should be best for screencasts, some people like utvideo. Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
2016-09-02 10:21 GMT+02:00 Moritz Barsnick: > $ ffmpeg -h encoder=ffvhuff ffv1 should always work better than ffvhuff. Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
2016-09-02 0:17 GMT+02:00 Cley Faye: > $ your_script | ffmpeg -f png_pipe -i - out.mp4 It should not be necessary (would be a bug if so) to specify the "_pipe" formats: $ ffmpeg -i - out.mp4 Carl Eugen ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
On Thu, Sep 01, 2016 at 22:29:01 -0700, Joshua Grauman wrote: > > from my program that I'm screencasting, which I haven't found screencast > > software that can do. Unfortunately, I'm not sure that I'm going to be able > > to get vcdiff to run fast enough to create the diffs at 30 frames/sec :(. > I have another different, but related question. What format would you > suggest for storing my screencast in? The resulting video is going to be > 1080p30 and it needs to have an alpha channel (the input png's will use > the alpha channel). The screencast is going to be overlaid at a later time > (with ffmpeg) onto another 1080p30 avchd video from my canon camera. All along, I was going to suggest: Why not use an existing codec? These can have various advantages, such as they have already been analyzed and optimized for performance, they can go into containers, they may have safety measures such as I-frames (picture recovery mid-stream), and so on. There are dozens of lossless codecs, and as many comparisons out there. Some of them do support alpha, probably with ffmpeg as well. You can check with: $ ffmpeg -h encoder=ffvhuff for the "Supported pixel formats:" output. You will probably even find articles about saving screencasts losslessly, and which codec to choose. But you can also experiment for yourself. > > Plus, this allows me to save the alpha channel from my program that > > I'm screencasting, which I haven't found screencast software that > > can do. I don't understand your specific requirements, but ffmpeg can also screencast: https://trac.ffmpeg.org/wiki/Capture/Desktop (If your alpha channel reflects the opacity of your windows, I presume ffmpeg can't do that. But what do I know.) Cheers, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
Hello everyone, I have another different, but related question. What format would you suggest for storing my screencast in? The resulting video is going to be 1080p30 and it needs to have an alpha channel (the input png's will use the alpha channel). The screencast is going to be overlaid at a later time (with ffmpeg) onto another 1080p30 avchd video from my canon camera. Josh The compression level is great. I thought of this because I am doing a screencast, so most screens are identical or very similar. So if I have an initial .tga file with size ~3 megabytes, most of the diffs will be less than 1k in size (some will be more like 15k, and some quite a bit more, but those should just be single frames). Plus, this allows me to save the alpha channel from my program that I'm screencasting, which I haven't found screencast software that can do. Unfortunately, I'm not sure that I'm going to be able to get vcdiff to run fast enough to create the diffs at 30 frames/sec :(. Josh On Thu, Sep 01, 2016 at 10:31:15 -0700, Joshua Grauman wrote: > So I know ffmpeg can encode video from a list of pngs. (img1.png, > img2.png, img3.png, etc). But what if I have one png, and then a list of > diffs (using vcdiff) like (img1.png, img2.diff, img3.diff, etc.). So you basically created a lossless codec of your own. ;-) How good is the compression level for your use cases? > I could of course generate all the pngs, but it would take up a lot > of space and I'm wondering if anyone knows of any creative way to do > this? Thanks! ffmpeg can handle image pipes. So what you would do is to pipe the first PNG to ffmpeg. Then create the seconds frame from img1.png and img2.diff, and pipe that to ffmpeg. Reuse that second frame to create the third one from img3.diff, and pipe that to ffmpeg. You can then always "reuse" or drop the previous result, and always have no more than two frames to keep for the moment. It would be something like $ create_png.sh | ffmpeg -f png_pipe -i - ... (Untested. create_png.sh could be a complex command line instead of a script.) I don't see any documentation right now, so just check $ ffmpeg -h demuxer=png_pipe I don't think you need most of the options, except the framerate perhaps. Disclaimer: I haven't actually tested this. ;-) Cheers, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
The compression level is great. I thought of this because I am doing a screencast, so most screens are identical or very similar. So if I have an initial .tga file with size ~3 megabytes, most of the diffs will be less than 1k in size (some will be more like 15k, and some quite a bit more, but those should just be single frames). Plus, this allows me to save the alpha channel from my program that I'm screencasting, which I haven't found screencast software that can do. Unfortunately, I'm not sure that I'm going to be able to get vcdiff to run fast enough to create the diffs at 30 frames/sec :(. Josh On Thu, Sep 01, 2016 at 10:31:15 -0700, Joshua Grauman wrote: So I know ffmpeg can encode video from a list of pngs. (img1.png, img2.png, img3.png, etc). But what if I have one png, and then a list of diffs (using vcdiff) like (img1.png, img2.diff, img3.diff, etc.). So you basically created a lossless codec of your own. ;-) How good is the compression level for your use cases? I could of course generate all the pngs, but it would take up a lot of space and I'm wondering if anyone knows of any creative way to do this? Thanks! ffmpeg can handle image pipes. So what you would do is to pipe the first PNG to ffmpeg. Then create the seconds frame from img1.png and img2.diff, and pipe that to ffmpeg. Reuse that second frame to create the third one from img3.diff, and pipe that to ffmpeg. You can then always "reuse" or drop the previous result, and always have no more than two frames to keep for the moment. It would be something like $ create_png.sh | ffmpeg -f png_pipe -i - ... (Untested. create_png.sh could be a complex command line instead of a script.) I don't see any documentation right now, so just check $ ffmpeg -h demuxer=png_pipe I don't think you need most of the options, except the framerate perhaps. Disclaimer: I haven't actually tested this. ;-) Cheers, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
That's exactly what I need! Hadn't heard of the png_pipe option. I was thinking I might have to write a kernel module to create a bunch of /proc files or something! Thanks! Josh On Fri, 2 Sep 2016, Cley Faye wrote: 2016-09-01 19:31 GMT+02:00 Joshua Grauman: I could of course generate all the pngs, but it would take up a lot of space and I'm wondering if anyone knows of any creative way to do this? Thanks! You could just do that. There is no need to write them anywhere though; you can pipe png sequences into ffmpeg directly (I create animations this way). I'm not familiar with vcdiff, but as long as you have a tool that produce a png on a standard output, you could loop over your diffs, piping the output info ffmpeg. Maybe you'll need a temporary variable storing the resulting png for the next step, but that will be held in RAM so no worries. Be careful if you do that though; binary data and shell script variables are not too friendly. I'd do that in python or another language. Once you have your script that output the sequence of png on it's standard output, you can pipe them to ffmpeg using '-' as the input name. Something like this: $ your_script | ffmpeg -f png_pipe -i - out.mp4 Don't forget to specify framerate etc. (of course, if ffmpeg does support such format by itself, ignore this message; I'm not familiar with *all* the stuff ffmpeg supports either). ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
On Thu, Sep 01, 2016 at 10:31:15 -0700, Joshua Grauman wrote: > So I know ffmpeg can encode video from a list of pngs. (img1.png, > img2.png, img3.png, etc). But what if I have one png, and then a list of > diffs (using vcdiff) like (img1.png, img2.diff, img3.diff, etc.). So you basically created a lossless codec of your own. ;-) How good is the compression level for your use cases? > I could of course generate all the pngs, but it would take up a lot > of space and I'm wondering if anyone knows of any creative way to do > this? Thanks! ffmpeg can handle image pipes. So what you would do is to pipe the first PNG to ffmpeg. Then create the seconds frame from img1.png and img2.diff, and pipe that to ffmpeg. Reuse that second frame to create the third one from img3.diff, and pipe that to ffmpeg. You can then always "reuse" or drop the previous result, and always have no more than two frames to keep for the moment. It would be something like $ create_png.sh | ffmpeg -f png_pipe -i - ... (Untested. create_png.sh could be a complex command line instead of a script.) I don't see any documentation right now, so just check $ ffmpeg -h demuxer=png_pipe I don't think you need most of the options, except the framerate perhaps. Disclaimer: I haven't actually tested this. ;-) Cheers, Moritz ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
2016-09-01 19:31 GMT+02:00 Joshua Grauman: > I could of course generate all the pngs, but it would take up a lot of > space and I'm wondering if anyone knows of any creative way to do this? > Thanks! You could just do that. There is no need to write them anywhere though; you can pipe png sequences into ffmpeg directly (I create animations this way). I'm not familiar with vcdiff, but as long as you have a tool that produce a png on a standard output, you could loop over your diffs, piping the output info ffmpeg. Maybe you'll need a temporary variable storing the resulting png for the next step, but that will be held in RAM so no worries. Be careful if you do that though; binary data and shell script variables are not too friendly. I'd do that in python or another language. Once you have your script that output the sequence of png on it's standard output, you can pipe them to ffmpeg using '-' as the input name. Something like this: $ your_script | ffmpeg -f png_pipe -i - out.mp4 Don't forget to specify framerate etc. (of course, if ffmpeg does support such format by itself, ignore this message; I'm not familiar with *all* the stuff ffmpeg supports either). ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
Re: [FFmpeg-user] encoding video from png diffs
Sorry, I just realized I forgot to mention I'm on Linux... Josh Hello all, So I know ffmpeg can encode video from a list of pngs. (img1.png, img2.png, img3.png, etc). But what if I have one png, and then a list of diffs (using vcdiff) like (img1.png, img2.diff, img3.diff, etc.). Each diff would be based upon the last. I could of course generate all the pngs, but it would take up a lot of space and I'm wondering if anyone knows of any creative way to do this? Thanks! Josh ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe". ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
[FFmpeg-user] encoding video from png diffs
Hello all, So I know ffmpeg can encode video from a list of pngs. (img1.png, img2.png, img3.png, etc). But what if I have one png, and then a list of diffs (using vcdiff) like (img1.png, img2.diff, img3.diff, etc.). Each diff would be based upon the last. I could of course generate all the pngs, but it would take up a lot of space and I'm wondering if anyone knows of any creative way to do this? Thanks! Josh ___ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".