{"id":33,"date":"2021-05-27T10:07:00","date_gmt":"2021-05-27T10:07:00","guid":{"rendered":""},"modified":"2022-11-21T18:10:19","modified_gmt":"2022-11-21T18:10:19","slug":"reparar-videos-mp4-en-una-carpeta-con-ffmpeg","status":"publish","type":"post","link":"http:\/\/aldarias.es\/wordpress\/?p=33","title":{"rendered":"Reparar videos mp4 en una carpeta con ffmpeg"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><i>fmpeg<\/i>: es una herramienta de <a href=\"https:\/\/es.wikipedia.org\/wiki\/L%C3%ADnea_de_comandos\" title=\"L\u00ednea de comandos\">l\u00ednea de comandos<\/a> para convertir audio o video de un formato a otro.<\/p>\n<p>&nbsp;<\/p>\n<p>1. Un archivo.&nbsp; El comando que repara el video es: <\/p>\n<div style=\"left: -99999px; position: absolute;\"><a href=\"https:\/\/www.enmimaquinafunciona.com\/pregunta\/37728\/reparar-corruptos-mp4\" style=\"color: inherit; font-weight: inherit; text-decoration: none;\">ffmpeg<\/a> -i input<span>.mp4<\/span> -c <span>copy<\/span> output<span>.mp4<\/span><\/p>\n<p> Fuente: https:\/\/www.enmimaquinafunciona.com\/pregunta\/37728\/reparar-corruptos-mp4<\/p><\/div>\n<p>ffmpeg -i input.mp4 -c copy output.mpo4<\/p>\n<p>&nbsp;<\/p>\n<p>2.&nbsp; Para toda la carpeta&nbsp; seria:<\/p>\n<div style=\"left: -99999px; position: absolute;\"><a href=\"https:\/\/www.enmimaquinafunciona.com\/pregunta\/37728\/reparar-corruptos-mp4\" style=\"color: inherit; font-weight: inherit; text-decoration: none;\">ffmpeg<\/a> -i input<span>.mp4<\/span> -c <span>copy<\/span> output<span>.mp4<\/span><\/p>\n<p> Fuente: https:\/\/www.enmimaquinafunciona.com\/pregunta\/37728\/reparar-corruptos-mp4<\/p><\/div>\n<div style=\"left: -99999px; position: absolute;\"><a href=\"https:\/\/www.enmimaquinafunciona.com\/pregunta\/37728\/reparar-corruptos-mp4\" style=\"color: inherit; font-weight: inherit; text-decoration: none;\">ffmpeg<\/a> -i input<span>.mp4<\/span> -c <span>copy<\/span> output<span>.mp4<\/span><\/p>\n<p> Fuente: https:\/\/www.enmimaquinafunciona.com\/pregunta\/37728\/reparar-corruptos-mp4<\/p><\/div>\n<div style=\"left: -99999px; position: absolute;\">ffmpeg -i input<span>.mp4<\/span> -c <span>copy<\/span> output<span>.mp4<\/span><\/p>\n<p> Fuente: https:\/\/www.enmimaquinafunciona.com\/pregunta\/37728\/reparar-corruptos-mp4<\/p><\/div>\n<div style=\"left: -99999px; position: absolute;\">ffmpeg -i input<span>.mp4<\/span> -c <span>copy<\/span> output<span>.mp4<\/span><\/p>\n<p> Fuente: https:\/\/www.enmimaquinafunciona.com\/pregunta\/37728\/reparar-corruptos-mp4<\/p><\/div>\n<p>for f in *;do ffmpeg -i \u00ab$f\u00bb -c copy \u00abXXX$f\u00bb; done<\/p>\n<p>Borramos los ficheros que no empiezen por XXX, y renombramos para quitar el XXX con:&nbsp; rename &#8216;s\/XXX\/\/&#8217; *<\/p>\n<p>&nbsp;<\/p>\n<p>3. Una carpeta de carpetas de m\u00fasica.&nbsp; Para trabajar con todas las carpetas a la vez seria crearemos el script:<\/p>\n<p>\/media\/backup\/videosmusica$ cat reparamp4.sh&nbsp; <\/p>\n<p>for d in *;do <br \/>&nbsp;&nbsp; cd \u00ab$d\u00bb<br \/>&nbsp;&nbsp; echo \u00abProcesando carpeta $d ****************\u00bb<br \/>&nbsp;&nbsp; for f in *;do <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo \u00abProcesando fichero $f &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..\u00bb &nbsp;<br \/>&nbsp; &nbsp; &nbsp; ffmpeg -i \u00ab$f\u00bb -c copy \u00abXXX$f\u00bb &nbsp;<br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rm -f \u00ab$f\u00bb <br \/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mv&nbsp; \u00abXXX$f\u00bb \u00ab$f\u00bb <br \/>&nbsp;&nbsp; done<br \/>&nbsp;&nbsp; cd ..<br \/>done<\/p>\n<p><\/p>\n<p><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; fmpeg: es una herramienta de l\u00ednea de comandos para convertir audio o video de un formato a otro. &nbsp; 1. Un archivo.&nbsp; El comando que repara el video es: ffmpeg -i input.mp4 -c copy output.mp4 Fuente: https:\/\/www.enmimaquinafunciona.com\/pregunta\/37728\/reparar-corruptos-mp4 ffmpeg -i &hellip; <a href=\"http:\/\/aldarias.es\/wordpress\/?p=33\">Sigue leyendo <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"episode_type":"","audio_file":"","podmotor_file_id":"","podmotor_episode_id":"","cover_image":"","cover_image_id":"","duration":"","filesize":"","filesize_raw":"","date_recorded":"","explicit":"","block":"","itunes_episode_number":"","itunes_title":"","itunes_season_number":"","itunes_episode_type":"","footnotes":""},"categories":[3,2],"tags":[],"class_list":["post-33","post","type-post","status-publish","format-standard","hentry","category-ffmpeg","category-for"],"_links":{"self":[{"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/33","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=33"}],"version-history":[{"count":1,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions"}],"predecessor-version":[{"id":220,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/33\/revisions\/220"}],"wp:attachment":[{"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=33"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=33"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/aldarias.es\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=33"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}